Description
Symfony about
console command displays info about log directory. If executed in Lambda with pre-warmed cache, it fails with Error thrown while running command "about". Message: "RecursiveDirectoryIterator::__construct(/tmp/log): failed to open dir: No such file or directory"
error.
The relevant parts in the command are https://github.com/symfony/symfony/blob/db321016cc/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php#L87 and https://github.com/symfony/symfony/blob/db321016cc/src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php#L115-L120
The code assumes that the log dir always exist, which is true for a standard Symfony application – Kernel::buildContainer()
creates the dir if needed: https://github.com/symfony/symfony/blob/db321016cc693d7155042918c667fdaa2d5f72bc/src/Symfony/Component/HttpKernel/Kernel.php#L634-L642
However, if the app is pre-warmed before deploying to AWS, Kernel::buildContainer()
doesn't get called in Lambda, /tmp/log
isn't created and about
command fails.
There are probably more ways how to make sure the log dir exists, but I feel like it's something BrefKernel
should take care of.