8000 `BrefKernel` should make sure `/tmp/log` dir exists · Issue #42 · brefphp/symfony-bridge · GitHub
[go: up one dir, main page]

Skip to content
BrefKernel should make sure /tmp/log dir exists #42
Closed
@vhenzl

Description

@vhenzl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0