Skip to content

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

Closed
@mcitdev

Description

@mcitdev
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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy