Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Symfony in Docker Swarm - ContextErrorException in Kernel.php cache/dev/classes.map failed to open stream: No such file or directory #23443

Copy link
Copy link
Closed
@mcitdev

Description

@mcitdev
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.9

I get this error when I tried to deploy symfony in a Docker swarm node

ContextErrorException in Kernel.php line 338:

Warning: file_put_contents(/home/backend_microservice/private_webapp/var/cache/dev/classes.map): failed to open stream: No such file or directory

    in Kernel.php line 338
    at Kernel->setClassCache(array('Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\AbstractProxy', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy', 'Symfony\\Component\\HttpFoundation\\Session\\Session', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateReference', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser', 'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocator', 'Symfony\\Component\\Cache\\Adapter\\ApcuAdapter', 'Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter', 'Symfony\\Component\\Cache\\CacheItem', 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'Symfony\\Component\\Routing\\RequestContext', 'Symfony\\Component\\Routing\\Router', 'Symfony\\Bundle\\FrameworkBundle\\Routing\\RedirectableUrlMatcher', 'Symfony\\Bundle\\FrameworkBundle\\Routing\\Router', 'Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter', 'Symfony\\Component\\Cache\\DoctrineProvider', 'Symfony\\Component\\Config\\ConfigCache', 'Symfony\\Component\\Config\\FileLocator', 'Symfony\\Component\\Debug\\ErrorHandler', 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', 'Symfony\\Component\\DependencyInjection\\Container', 'Symfony\\Component\\EventDispatcher\\Event', 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher', 'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener', 'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener', 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', 'Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver', 'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata', 'Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadataFactory', 'Symfony\\Component\\HttpKernel\\Event\\KernelEvent', 'Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent', 'Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent', 'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent', 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent', 'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent', 'Symfony\\Component\\HttpKernel\\HttpKernel', 'Symfony\\Component\\HttpKernel\\KernelEvents', 'Symfony\\Component\\HttpKernel\\Config\\FileLocator', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', 'Symfony\\Component\\Security\\Http\\Firewall', 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface', 'Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager', 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage', 'Symfony\\Component\\Security\\Core\\Authorization\\AccessDecisionManager', 'Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationChecker', 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface', 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallConfig', 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallMap', 'Symfony\\Bundle\\SecurityBundle\\Security\\FirewallContext', 'Symfony\\Component\\HttpFoundation\\RequestMatcher', 'Twig_Environment', 'Twig_Extension', 'Twig_Extension_Core', 'Twig_Extension_Escaper', 'Twig_Extension_Optimizer', 'Twig_LoaderInterface', 'Twig_Markup', 'Twig_Template')) in AddClassesToCachePass.php line 52
    at AddClassesToCachePass->process(object(ContainerBuilder)) in Compiler.php line 120
    at Compiler->compile(object(ContainerBuilder)) in ContainerBuilder.php line 573
    at ContainerBuilder->compile() in Kernel.php line 487
    at Kernel->initializeContainer() in Kernel.php line 116
    at Kernel->boot() in Kernel.php line 165
    at Kernel->handle(object(Request)) in app_dev.php line 31

I tried to remove the cache manually, I remove the vendor directory and I generate a new one with composer, but still give the same error.

Notice that the same config works fine with only docker engine

OS : CentOS 7.3
Virtualization : Docker swarm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.