Skip to content

[Bug] PHP Fatal error: Uncaught ValueError: Path cannot be empty in /var/www/html/config/local.php:4 #477

@Gp2mv3

Description

@Gp2mv3

Describe the bug

When running the cron container, I've the following error in the logs:

Fatal error: Uncaught ValueError: Path cannot be empty in /var/www/html/config/local.php:4
Stack trace:
#0 /var/www/html/config/local.php(4): file_get_contents('')
#1 /var/www/html/docroot/app/bundles/CoreBundle/Loader/ParameterLoader.php(158): include('/var/www/html/c...')
#2 /var/www/html/docroot/app/bundles/CoreBundle/Loader/ParameterLoader.php(34): Mautic\CoreBundle\Loader\ParameterLoader->loadLocalParameters()
#3 /var/www/html/docroot/app/AppKernel.php(349): Mautic\CoreBundle\Loader\ParameterLoader->__construct()
#4 /var/www/html/docroot/app/AppKernel.php(219): AppKernel->getParameterLoader()
#5 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(190): AppKernel->boot()
#6 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(72): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
#7 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/bin/console(16): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 {main}
  thrown in /var/www/html/config/local.php on line 4

However, when running the command directly with docker run, I don't have the error and the cron runs. Why ? What can be the cause, and what am I doing wrong ?

docker exec -it -u 33 mautic6-mautic_cron-1 php /var/www/html/bin/console mautic:segments:update
Rebuilding contacts for segment 69
...

I don't understand as I'm using the same user (www-data) for both. I'm using docker-compose from the repo.

Steps to reproduce

Look at the logs of the cron container. I see the errors.

Expected behavior

The command should run without any error.

Actual behavior

Errors in the cron logs, but not in the execution with docker exec

Docker Image Tag

mautic/mautic:latest

Server Architecture

AMD64 (Intel or AMD processors)

Docker Image Digest (Optional but helpful)

No response

Dockerfile (if applicable)

No response

Docker Compose (if applicable)


x-mautic-volumes:
  &mautic-volumes
  - /data/mautic6/config:/var/www/html/config:z
  - /data/mautic6/logs:/var/www/html/var/logs:z
  - /data/mautic6/media/files:/var/www/html/docroot/media/files:z
  - /data/mautic6/media/images:/var/www/html/docroot/media/images:z
  - /data/mautic6/cron:/opt/mautic/cron:z # Uncomment this line to customize your cron configuration

services:
  db:
    image: mysql:lts
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes:
      - /mnt/mautic-mysql-2026:/var/lib/mysql
    healthcheck:
      test: mysqladmin --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD ping
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 10
    networks:
      - default

  mautic_web:
    image: mautic/mautic:latest
    build:
      dockerfile: Dockerfile
    links:
      - db:mysql
#    ports:
#      - 8080:80
    volumes: *mautic-volumes
    environment:
      - DOCKER_MAUTIC_LOAD_TEST_DATA=${DOCKER_MAUTIC_LOAD_TEST_DATA}
    env_file:
      - .mautic_env
    healthcheck:
      test: curl http://localhost
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 10
    depends_on:
      db:
        condition: service_healthy
    networks:
      - default
    restart: unless-stopped

  mautic_cron:
    image: mautic/mautic:latest
    links:
      - db:mysql
    volumes: *mautic-volumes
    environment:
      - DOCKER_MAUTIC_ROLE=mautic_cron
      - PHP_INI_VALUE_MEMORY_LIMIT=1G
    env_file:
      - .mautic_env
    depends_on:
      mautic_web:
        condition: service_healthy
    networks:
      - default
    restart: unless-stopped

  mautic_worker:
    image: mautic/mautic:latest
    links:
      - db:mysql
    volumes: *mautic-volumes
    environment:
      - DOCKER_MAUTIC_ROLE=mautic_worker
    env_file:
      - .mautic_env
    depends_on:
      mautic_web:
        condition: service_healthy
    networks:
      - default
    restart: unless-stopped

volumes:
  mysql-data:

networks:
  default:
    name: ${COMPOSE_PROJECT_NAME}


Additional context (Optional)

No response

Acknowledgements

  • I agree to follow this project's Code of Conduct
  • This issue is NOT a security vulnerability. (Security vulnerabilities should be reported via the Security tab.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting issuer feedbackThe maintainers are waiting a feedback from the issuer.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions