PrestaShop / PrestaShop/docker

"PHP Fatal error ... Failed to remove directory" when "Launching the installer script" step

Open
#289 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
281
Forks
190
PR merge metrics
No merged PRs in 30d

Description

I have tried to install different combinations of PS-PHP but they all failed with the same "PHP Fatal error" when launching the installer script.
For example:

...
prestashop-1.7 | * Launching the installer script...
prestashop-1.7 | -- Installation successful! --
prestashop-1.7 | PHP Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Failed to remove directory "/var/www/html/var/cache/prod/ContainerKbxismu": rmdir(/var/www/html/var/cache/prod/ContainerKbxismu): Directory not empty in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:180
prestashop-1.7 | Stack trace:
prestashop-1.7 | #0 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php(177): Symfony\Component\Filesystem\Filesystem->remove(Array)
prestashop-1.7 | #1 /var/www/html/classes/Tools.php(3558): Symfony\Component\Filesystem\Filesystem->remove(Array)
prestashop-1.7 | #2 [internal function]: ToolsCore::{closure}()
prestashop-1.7 | #3 {main}
prestashop-1.7 | thrown in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 180
prestashop-1.7 exited with code 255

Indeed, the mentioned directory is not empty, so it fails when using rmdir. After error, running the process again will immediately abort because of the lock file presence.

The docker-compose file is:

version: '3.3'

services:
  db:
    image: mariadb
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=prestashop
      - MYSQL_DATABASE=prestashop
      - MYSQL_USER=prestashop
      - MYSQL_PASSWORD=prestashop
      
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: phpmyadmin
    environment:
      - pma_arbitrary=1
      - pma_host=mariadb
    depends_on:
      - db
    ports:
      - 8080:80
      
  prestashop-apache:
    build: ./prestashop
    image: prestashop-1.7
    container_name: prestashop-1.7
    environment:
      - DB_SERVER=mariadb
      - DB_USER=prestashop
      - DB_PASSWD=prestashop
      - DB_NAME=prestashop
      - PS_INSTALL_AUTO=1
      - PS_DOMAIN=localhost:8081
      - PS_FOLDER_ADMIN=admin_
      - PS_FOLDER_INSTALL=install_
    depends_on:
      - phpmyadmin
    volumes:
      - ../../fs:/var/www/html
    ports:
      - 8081:80 

I'm using Docker Desktop v4.3.2 on Win 10.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the supplied docker-compose configuration, then inspect classes/Tools.php around line 3558 and the Symfony Filesystem stack trace. Check the installer step and the reported cache directory behavior; done means installation exits successfully and a retry is not blocked by the lock file.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, php, symfony
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.