Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying of cache folder breaks several components #54

Open
driskell opened this issue Jan 13, 2022 · 0 comments
Open

Copying of cache folder breaks several components #54

driskell opened this issue Jan 13, 2022 · 0 comments

Comments

@driskell
Copy link

Hi,

I was testing using symfony-bridge and hit a few issues. It all started when exceptions causing a 500 error from Symfony would no longer be logged to CloudWatch. It would just stop at the last log message and not log the exception.

I THINK I tracked the issue down to Monolog triggering a handler that logs to a file, and it being unable to log to the file, and thus the error handler itself breaks and it never continues to the stderr logger I have.

It appears related to the copying of the cache folder from project_root/var to /tmp/. The container file that is inside the container folder contains relative references to DIR when initialising services that use kernel.cache_dir or kernel.log_dir. As such, the container is initialising the Monolog service that logs to a file with a cache_dir value of "current directory, one parent". Of course, with standard setup, where cache is in var, this puts it at var/log. Now the issue is when symlinking to /tmp/... DIR is still the var so now cache_dir is var/log still which is unwritable.

I tested changing from symlink to mirror for the container folder but then of course the relative DIR references are all incorrect now so it cannot find the templates folder for twig.

I sense that copying the cache might be causing issues. I can think only way around it is when the cache is "warmed up" locally it likely needs to be generated in the /tmp on the machine and copied in place. Looking at Symfony though it seems it will generate DIR references as long as the cache folder is inside the project folder so only way to avoid it is to generate it outside of that folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant