PrestaShop / PrestaShop/docker

PrestaShop docker Permission denied after " Launching the installer script..."

Open
#354 0 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 use presta with image: prestashop/prestashop:latest, which results 1.7.8.0 version (quite strange, because presta has higher versions than this one). "Permission denied" in "/var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:183" related with removal operation of the file "/var/www/html/var/cache/prod/class_index.php".

Docker version 24.0.5, build ced0996
docker-compose version 1.26.2, build eefe0d31
nginx/1.18.0 as a proxy for https and subdomain

Docker container logs below:

prestashop_1  | * Launching the installer script...
prestashop_1  | PHP Fatal error:  Uncaught Symfony\Component\Filesystem\Exception\IOException: Failed to remove file "/var/www/html/var/cache/prod/class_index.php": unlink(/var/www/html/var/cache/prod/class_index.php): Permission denied in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:183
prestashop_1  | Stack trace:
prestashop_1  | #0 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php(177): Symfony\Component\Filesystem\Filesystem->remove(Array)
prestashop_1  | #1 /var/www/html/classes/Tools.php(3558): Symfony\Component\Filesystem\Filesystem->remove(Array)
prestashop_1  | #2 [internal function]: ToolsCore::{closure}()
prestashop_1  | #3 {main}
prestashop_1  |   thrown in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 183
prestashop_1  | Symfony\Component\Filesystem\Exception\IOException: Unable to write to the "/var/www/html/var/cache/prod" directory. in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:680
prestashop_1  | Stack trace:
prestashop_1  | #0 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCache.php(124): Symfony\Component\Filesystem\Filesystem->dumpFile('/var/www/html/v...', '<?php\n\nuse Symf...')
prestashop_1  | #1 /var/www/html/modules/ps_checkout/vendor/prestashop/module-lib-service-container/src/DependencyInjection/ContainerProvider.php(95): Symfony\Component\Config\ResourceCheckerConfigCache->write('<?php\n\nuse Symf...', Array)
prestashop_1  | #2 /var/www/html/modules/ps_checkout/vendor/prestashop/module-lib-service-container/src/DependencyInjection/ServiceContainer.php(79): PrestaShop\ModuleLibServiceContainer\DependencyInjection\ContainerProvider->get('admin')
prestashop_1  | #3 /var/www/html/modules/ps_checkout/vendor/prestashop/module-lib-service-container/src/DependencyInjection/ServiceContainer.php(61): PrestaShop\ModuleLibServiceContainer\DependencyInjection\ServiceContainer->initContainer()
prestashop_1  | #4 /var/www/html/modules/ps_checkout/ps_checkout.php(1404): PrestaShop\ModuleLibServiceContainer\DependencyInjection\ServiceContainer->getService('ps_checkout.con...')
prestashop_1  | #5 /var/www/html/modules/ps_checkout/ps_checkout.php(1101): Ps_checkout->getService('ps_checkout.con...')
prestashop_1  | #6 /var/www/html/classes/PaymentModule.php(65): Ps_checkout->addCheckboxCarrierRestrictionsForModule()
prestashop_1  | #7 /var/www/html/modules/ps_checkout/ps_checkout.php(179): PaymentModuleCore->install()
prestashop_1  | #8 /var/www/html/src/Adapter/Module/Module.php(251): Ps_checkout->install()
prestashop_1  | #9 /var/www/html/src/Core/Addon/Module/ModuleManager.php(312): PrestaShop\PrestaShop\Adapter\Module\Module->onInstall()
prestashop_1  | #10 /var/www/html/src/PrestaShopBundle/Install/Install.php(1069): PrestaShop\PrestaShop\Core\Addon\Module\ModuleManager->install(NULL)
prestashop_1  | #11 /var/www/html/src/PrestaShopBundle/Install/Install.php(1036): PrestaShopBundle\Install\Install->installModules(Array)
prestashop_1  | #12 /var/www/html/removeinstall/controllers/console/process.php(298): PrestaShopBundle\Install\Install->installModulesAddons()
prestashop_1  | #13 /var/www/html/removeinstall/controllers/console/process.php(155): InstallControllerConsoleProcess->processInstallAddonsModules()
prestashop_1  | #14 /var/www/html/removeinstall/classes/controllerConsole.php(117): InstallControllerConsoleProcess->process()
prestashop_1  | #15 /var/www/html/removeinstall/index_cli.php(64): InstallControllerConsole::execute(17, Array)
prestashop_1  | #16 {main}
prestashop_1  |
prestashop_1  |
prestashop_1  | * Checking if mysql is available...
prestashop_1  |
prestashop_1  |
prestashop_1  | * DB server mysql is available, let's continue !
prestashop_1  |
prestashop_1  |
prestashop_1  | * PrestaShop Core already installed...
prestashop_1  |
prestashop_1  |
prestashop_1  | * Almost ! Starting web server now

I use docker-compose.yml:

    image: prestashop/prestashop:latest
    volumes:
      - ./viesintegration:/var/www/html/modules/viesintegration
    restart: always
    environment:
      PS_DOMAIN: demo.example.com
      PS_FOLDER_ADMIN: ${PS_FOLDER_ADMIN}
      PS_FOLDER_INSTALL: ${PS_FOLDER_INSTALL}
      PS_ENABLE_SSL: 1
      PS_INSTALL_AUTO: 1
      PS_ERASE_DB: 1
      PS_INSTALL_DB: 1
      DB_SERVER: ${DB_SERVER}
      DB_USER: ${DB_USER}
      DB_PASSWD: ${DB_PASSWD}
      DB_NAME: ${DB_NAME}
      DB_PREFIX: ${DB_PREFIX}
      ADMIN_MAIL: ${ADMIN_MAIL}
      ADMIN_PASSWD: ${ADMIN_PASSWD}
    ports:
      - "8081:80"
    depends_on:
      - mysql

  mysql:
    image: mysql:5.7
    restart: always
    volumes:
      - mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}

volumes:
  mysql:

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

Start with the supplied docker-compose.yml and reproduce the installer failure while inspecting ownership and permissions for /var/www/html/var/cache/prod, including the mounted modules path. Trace the reported calls through Symfony Filesystem.php and classes/Tools.php. Done means the installer and module setup complete without permission errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, mysql, php
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.