Closed CvekCoding closed 5 months ago
At the same time, a simple restart of the container sometimes helps and Frankenphp begins to process requests successfully
This looks a lot like an opcache corruption issue: https://github.com/dunglas/symfony-docker/issues/578
Do you use any custom opcache option?
My opcache related configs.
#api/docker/frankenphp/conf.d/app.prod.ini
opcache.preload_user = root
opcache.preload = /app/config/preload.php
#api/config/preload.php
<?php
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
#api/docker/php/conf.d/api-platform.prod.ini
apc.enable_cli = 1
date.timezone = UTC
session.auto_start = Off
short_open_tag = Off
# https://symfony.com/doc/current/performance.html
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 20000
opcache.memory_consumption = 256
opcache.validate_timestamps = 0
realpath_cache_size = 4096K
realpath_cache_ttl = 600
BTW the file /var/cache/prod/App_KernelProdContainer.preload.php doesnt exist
Sorry, it does - this file exists in cache directory
If I'm understanding correctly, if dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php'
doesn't exist when the container starts, you'll run into this bug. Since it is in the cache, I suspect that is what is going on?
I think no. It's the same container and sometimes it runs to the issue, sometimes - not.
If you disable preloading, does the issue still occur?
You are right. When I disabled this script, the issue gone
in file #api/docker/frankenphp/conf.d/app.prod.ini opcache.preload should be the same as path to file #api/config/preload.php
What happened?
My Symfony6 application can not start with the following error:
My Dockerfile relevant part where I build frankenphp:
My index.php file is standard:
Probably it's important: Im wrapping frankenphp with supervisor:
So my container starts with Supervisor, which in turn runs Frankenphp and several other console listeners.
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output
No response