I'm fairly new to Symfony and API Platform but am otherwise a fairly experienced PHP developer.
I recently started a project using Symfony 5 and API Platform using JWT Tokens for authentication and Doctrine as the ORM.
Everything is working fine but after a while my app starts crashing on every request. And I really mean crashing: Apache dies and restarts with these 2 errors found in error.log:
PHP Warning: Uncaught ReflectionException: Class does not exist in D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ClassStub.php:52\nStack trace:\n#0 D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ClassStub.php(52): ReflectionMethod->__construct('', '')\n#1 D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ReflectionCaster.php(186): Symfony\\Component\\VarDumper\\Caster\\ClassStub->__construct('void', Array)\n#2 D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ExceptionCaster.php(328): Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster::castFunctionAbstract(Object(ReflectionMethod), Array, Object(Symfony\\Component\\VarDumper\\Caster\\CutStub), true, 1)\n#3 D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ExceptionCaster.php(233): Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster::extractSource(Array, 117, 1, 'php', 'D:\\\\Server\\\\Web\\\\t...', Array)\n#4 D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ExceptionCaster.php(149): Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster::castFra in D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ClassStub.php on line 52
PHP Stack trace:
PHP 1. {main}() D:\\Server\\Web\\project\\public\\index.php:0
PHP 2. App\\Kernel->terminate($request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = array (...) }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = array (...) }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = ''; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = array (0 => '*/*'); protected $pathInfo = '/api/v1/workouts'; protected $requestUri = '/Web/project/public/api/v1/workouts?XDEBUG_SESSION_START=batata'; protected $baseUrl = '/Web/project/public'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = NULL; protected $locale = NULL; protected $defaultLocale = 'en'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }, $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { protected $computedCacheControl = array (...); protected $cookies = array (...); protected $headerNames = array (...); protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = '{"code":401,"message":"Expired JWT Token"}'; protected $version = '1.1'; protected $statusCode = 401; protected $statusText = 'Unauthorized'; protected $charset = 'UTF-8' }) D:\\Server\\Web\\project\\public\\index.php:27
PHP 3. Symfony\\Component\\HttpKernel\\HttpKernel->terminate($request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = array (...) }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = array (...) }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = ''; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = array (0 => '*/*'); protected $pathInfo = '/api/v1/workouts'; protected $requestUri = '/Web/project/public/api/v1/workouts?XDEBUG_SESSION_START=batata'; protected $baseUrl = '/Web/project/public'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = NULL; protected $locale = NULL; protected $defaultLocale = 'en'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }, $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { protected $computedCacheControl = array (...); protected $cookies = array (...); protected $headerNames = array (...); protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = '{"code":401,"message":"Expired JWT Token"}'; protected $version = '1.1'; protected $statusCode = 401; protected $statusText = 'Unauthorized'; protected $charset = 'UTF-8' }) D:\\Server\\Web\\project\\vendor\\symfony\\http-kernel\\Kernel.php:156
PHP 4. Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher->dispatch($event = class Symfony\\Component\\HttpKernel\\Event\\TerminateEvent { private $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { ... }; protected $content = '{"code":401,"message":"Expired JWT Token"}'; protected $version = '1.1'; protected $statusCode = 401; protected $statusText = 'Unauthorized'; protected $charset = 'UTF-8' }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}kernel = class Symfony\\Component\\HttpKernel\\HttpKernel { protected $dispatcher = class Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher { ... }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { ... }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { ... }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { ... }; protected $content = ''; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = array (...); protected $pathInfo = '/api/v1/workouts'; protected $requestUri = '/Web/project/public/api/v1/workouts?XDEBUG_SESSION_START=batata'; protected $baseUrl = '/Web/project/public'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = NULL; protected $locale = NULL; protected $defaultLocale = 'en'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}requestType = 1; private ${Symfony\\Contracts\\EventDispatcher\\Event}propagationStopped = FALSE }, $eventName = 'kernel.terminate') D:\\Server\\Web\\project\\vendor\\symfony\\http-kernel\\HttpKernel.php:99
PHP 5. Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch($event = class Symfony\\Component\\HttpKernel\\Event\\TerminateEvent { private $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { ... }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { ... }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { ... }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { ... }; protected $content = ''; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}requestType = 1; private ${Symfony\\Contracts\\EventDispatcher\\Event}propagationStopped = FALSE }, $eventName = 'kernel.terminate') D:\\Server\\Web\\project\\vendor\\symfony\\event-dispatcher\\Debug\\TraceableEventDispatcher.php:151
PHP 6. Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners($listeners = array (0 => class Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener { private $listener = array (...); private $optimizedListener = class Closure { ... }; private $pretty = 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ProfilerListener::onKernelTerminate'; private $stub = NULL; private $priority = -1024 }), $eventName = 'kernel.terminate', $event = class Symfony\\Component\\HttpKernel\\Event\\TerminateEvent { private $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { ... }; protected $content = '{"code":401,"message":"Expired JWT Token"}'; protected $version = '1.1'; protected $statusCode = 401; protected $statusText = 'Unauthorized'; protected $charset = 'UTF-8' }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}kernel = class Symfony\\Component\\HttpKernel\\HttpKernel { protected $dispatcher = class Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher { ... }; protected $resolver = class Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver { ... }; protected $requestStack = class Symfony\\Component\\HttpFoundation\\RequestStack { ... }; private $argumentResolver = class Symfony\\Component\\HttpKernel\\Controller\\TraceableArgumentResolver { ... } }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { ... }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { ... }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { ... }; ) D:\\Server\\Web\\project\\vendor\\symfony\\event-dispatcher\\EventDispatcher.php:59
PHP 7. Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener->__invoke($event = class Symfony\\Component\\HttpKernel\\Event\\TerminateEvent { private $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { ... }; protected $content = '{"code":401,"message":"Expired JWT Token"}'; protected $version = '1.1'; protected $statusCode = 401; protected $statusText = 'Unauthorized'; protected $charset = 'UTF-8' }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}kernel = class Symfony\\Component\\HttpKernel\\HttpKernel { protected $dispatcher = class Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher { ... }; protected $resolver = class Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver { ... }; protected $requestStack = class Symfony\\Component\\HttpFoundation\\RequestStack { ... }; private $argumentResolver = class Symfony\\Component\\HttpKernel\\Controller\\TraceableArgumentResolver { ... } }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { ... }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { ... }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { ... }; protected $content = ''; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = array (...); protected $pathInfo = '/api/v1/workouts'; protected $requestUri = '/Web/project/public/api/v1/workouts?XDEBUG_SESSION_START=batata'; protected $baseUrl = '/Web/project/public'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = NULL; protected $locale = NULL; protected $defaultLocale = 'en'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}requestType = 1; private ${Symfony\\Contracts\\EventDispatcher\\Event}propagationStopped = FALSE }, $eventName = 'kernel.terminate', $dispatcher = class Symfony\\Component\\EventDispatcher\\EventDispatcher { private $listeners = array ('kernel.controller' => array (...), 'kernel.request' => array (...), 'kernel.response' => array (...), 'kernel.view' => array (...), 'kernel.exception' => array (...), 'lexik_jwt_authentication.on_jwt_created' => array (...), 'kernel.finish_request' => array (...), 'kernel.controller_arguments' => array (...), 'console.error' => array (...), 'console.terminate' => array (...), 'kernel.terminate' => array (...), 'console.command' => array (...), 'debug.security.authorization.vote' => array (...)); private $sorted = array (); private $optimized = array ('kernel.terminate' => array (...)) }) D:\\Server\\Web\\project\\vendor\\symfony\\event-dispatcher\\EventDispatcher.php:230
PHP 8. Symfony\\Component\\HttpKernel\\EventListener\\ProfilerListener->onKernelTerminate($event = class Symfony\\Component\\HttpKernel\\Event\\TerminateEvent { private $response = class Lexik\\Bundle\\JWTAuthenticationBundle\\Response\\JWTAuthenticationFailureResponse { private $message = 'Expired JWT Token'; protected $data = '{"code":401,"message":"Expired JWT Token"}'; protected $callback = NULL; protected $encodingOptions = 15; public $headers = class Symfony\\Component\\HttpFoundation\\ResponseHeaderBag { ... }; protected $content = '{"code":401,"message":"Expired JWT Token"}'; protected $version = '1.1'; protected $statusCode = 401; protected $statusText = 'Unauthorized'; protected $charset = 'UTF-8' }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}kernel = class Symfony\\Component\\HttpKernel\\HttpKernel { protected $dispatcher = class Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher { ... }; protected $resolver = class Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver { ... }; protected $requestStack = class Symfony\\Component\\HttpFoundation\\RequestStack { ... }; private $argumentResolver = class Symfony\\Component\\HttpKernel\\Controller\\TraceableArgumentResolver { ... } }; private ${Symfony\\Component\\HttpKernel\\Event\\KernelEvent}request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { ... }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { ... }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { ... }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { ... }; protected $content = ''; private ${Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher}callStack = class SplObjectStorage { private $storage = array (...) }; private ${Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher}dispatcher = class Symfony\\Component\\EventDispatcher\\EventDispatcher { private $listeners = array (...); private $sorted = array (...); private $optimized = array (...) }; private ${Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher}wrappedListeners = array ('kernel.terminate' => array (...)); private ${Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher}orphanedEvents = array ('000000007b5cad290000000031798e67' => array (...)); private ${Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher}requestStack = class Symfony\\Component\\HttpFoundation\\RequestStack { private $requests = array (...) }; private ${Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher}currentRequestHash = '' }) D:\\Server\\Web\\project\\vendor\\symfony\\event-dispatcher\\Debug\\WrappedListener.php:117
PHP 9. Symfony\\Component\\HttpKernel\\Profiler\\Profiler->saveProfile($profile = class Symfony\\Component\\HttpKernel\\Profiler\\Profile { private $token = '533f4e'; private $collectors = array ('request' => class Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector { ... }, 'api_platform.data_collector.request' => class ApiPlatform\\Core\\Bridge\\Symfony\\Bundle\\DataCollector\\RequestDataCollector { ... }, 'time' => class Symfony\\Component\\HttpKernel\\DataCollector\\TimeDataCollector { ... }, 'memory' => class Symfony\\Component\\HttpKernel\\DataCollector\\MemoryDataCollector { ... }, 'validator' => class Symfony\\Component\\Validator\\DataCollector\\ValidatorDataCollector { ... }, 'ajax' => class Symfony\\Component\\HttpKernel\\DataCollector\\AjaxDataCollector { ... }, 'exception' => class Symfony\\Component\\HttpKernel\\DataCollector\\ExceptionDataCollector { ... }, 'logger' => class Symfony\\Component\\HttpKernel\\DataCollector\\LoggerDataCollector { ... }, 'events' => class Symfony\\Component\\HttpKernel\\DataCollector\\EventDataCollector { ... }, 'router' => class Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector { ... }, 'cache' => class Symfony\\Component\\Cache\\DataCollector\\CacheDataCollector { ... }, 'security' => class Symfony\\Bundle\\SecurityBundle\\DataCollector\\SecurityDataCollector { ... }, 'twig' => class Symfony\\Bridge\\Twig\\DataCollector\\TwigDataCollector { ... }, 'db' => class Doctrine\\Bundle\\DoctrineBundle\\DataCollector\\DoctrineDataCollector { ... }, 'config' => class Symfony\\Component\\HttpKernel\\DataCollector\\ConfigDataCollector { ... }); private $ip = '127.0.0.1'; private $method = 'GET'; private $url = 'http://127.0.0.1/Web/project/public/api/v1/workouts?XDEBUG_SESSION_START=batata'; private $time = 1593283384; private $statusCode = 401; private $parent = NULL; private $children = array () }) D:\\Server\\Web\\project\\vendor\\symfony\\http-kernel\\EventListener\\ProfilerListener.php:112
PHP 10. Symfony\\Component\\HttpKernel\\DataCollector\\LoggerDataCollector->lateCollect() D:\\Server\\Web\\project\\vendor\\symfony\\http-kernel\\Profiler\\Profiler.php:97
PHP 11. Symfony\\Component\\HttpKernel\\DataCollector\\LoggerDataCollector->cloneVar($var = array ('error_count' => 0, 'deprecation_count' => 0, 'warning_count' => 0, 'scream_count' => 0, 'priorities' => array (100 => array (...), 200 => array (...)), 'compiler_logs' => array (), 'compiler_logs_filepath' => 'D:\\\\Server\\\\Web\\\\project\\\\var\\\\cache\\\\dev/App_KernelDevDebugContainerCompiler.log', 'logs' => array () D:\\Server\\Web\\project\\vendor\\symfony\\http-kernel\\DataCollector\\LoggerDataCollector.php:75
PHP 12. Symfony\\Component\\VarDumper\\Cloner\\VarCloner->cloneVar($var = array ('error_count' => 0, 'deprecation_count' => 0, 'warning_count' => 0, 'scream_count' => 0, 'priorities' => array (100 => array (...), 200 => array (...)), 'compiler_logs' => array (), 'compiler_logs_filepath' => 'D:\\\\Server\\\\Web\\\\project\\\\var\\\\cache\\\\dev/App_KernelDevDebugContainerCompiler.log', 'logs' => array (), $filter = *uninitialized*) D:\\Server\\Web\\project\\vendor\\symfony\\http-kernel\\DataCollector\\DataCollector.php:62
PHP 13. Symfony\\Component\\VarDumper\\Cloner\\VarCloner->doClone($var = array ('error_count' => 0, 'deprecation_count' => 0, 'warning_count' => 0, 'scream_count' => 0, 'priorities' => array (100 => array (...), 200 => array (...)), 'compiler_logs' => array (), 'compiler_logs_filepath' => 'D:\\\\Server\\\\Web\\\\project\\\\var\\\\cache\\\\dev/App_KernelDevDebugContainerCompiler.log', 'logs' => array () D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Cloner\\AbstractCloner.php:256
PHP 14. Symfony\\Component\\VarDumper\\Cloner\\VarCloner->castObject($stub = class Symfony\\Component\\VarDumper\\Cloner\\Stub { public $type = 4; public $class = ''; public $value = class Symfony\\Component\\VarDumper\\Caster\\TraceStub { public $keepArgs = TRUE; public $sliceOffset = 0; public $sliceLength = NULL; public $numberingOffset = 0; public $type = 1; public $class = ''; public $value = array (...); public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array (...) }; public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array () }, $isNested = TRUE) D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Cloner\\VarCloner.php:171
PHP 15. Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster::castTraceStub($trace = class Symfony\\Component\\VarDumper\\Caster\\TraceStub { public $keepArgs = TRUE; public $sliceOffset = 0; public $sliceLength = NULL; public $numberingOffset = 0; public $type = 1; public $class = ''; public $value = array (); public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array () }, $a = array ('keepArgs' => TRUE, 'sliceOffset' => 0, 'sliceLength' => NULL, 'numberingOffset' => 0, 'type' => 1, 'class' => '', 'value' => array (), 'cut' => 0, 'handle' => 0, 'refCount' => 0, 'position' => 0, 'attr' => array ()), $stub = class Symfony\\Component\\VarDumper\\Cloner\\Stub { public $type = 4; public $class = ''; public $value = class Symfony\\Component\\VarDumper\\Caster\\TraceStub { public $keepArgs = TRUE; public $sliceOffset = 0; public $sliceLength = NULL; public $numberingOffset = 0; public $type = 1; public $class = ''; public $value = array (...); public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array (...) }; public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array () }, $isNested = TRUE, 0) D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Cloner\\AbstractCloner.php:323
PHP 16. Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster::castFrameStub($frame = class Symfony\\Component\\VarDumper\\Caster\\FrameStub { public $keepArgs = FALSE; public $inTraceStub = TRUE; public $dumpKeys = TRUE; public $type = 1; public $class = ''; public $value = array ('object' => NULL, 'class' => 'Symfony\\\\Component\\\\EventDispatcher\\\\Debug\\\\WrappedListener', 'type' => '->', 'function' => '__invoke', 'file' => 'D:\\\\Server\\\\Web\\\\project\\\\vendor\\\\symfony\\\\event-dispatcher\\\\Debug\\\\WrappedListener.php', 'line' => 117, 'args' => array (...)); public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array () }, $a = array (), $stub = class Symfony\\Component\\VarDumper\\Caster\\FrameStub { public $keepArgs = FALSE; public $inTraceStub = TRUE; public $dumpKeys = TRUE; public $type = 1; public $class = ''; public $value = array ('object' => NULL, 'class' => 'Symfony\\\\Component\\\\EventDispatcher\\\\Debug\\\\WrappedListener', 'type' => '->', 'function' => '__invoke', 'file' => 'D:\\\\Server\\\\Web\\\\project\\\\vendor\\\\symfony\\\\event-dispatcher\\\\Debug\\\\WrappedListener.php', 'line' => 117, 'args' => array (...)); public $cut = 0; public $handle = 0; public $refCount = 0; public $position = 0; public $attr = array () }, $isNested = TRUE) D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ExceptionCaster.php:149
VirtualAlloc() failed: [0x000005af] The paging file is too small for this operation to complete.
PHP Fatal error: Out of memory (allocated 18874368) (tried to allocate 2869491634984 bytes) in D:\\Server\\Web\\project\\vendor\\symfony\\var-dumper\\Caster\\ClassStub.php on line 52
I've omitted the second stack trace as it's identical to the first one. The last error repeats itself several times. Notice how PHP tried to allocate a whopping 2869491634984 bytes!! I know it looks like a infinite loop / recursion problem, but I have no idea why / where is it.
I've tried clearing all caches but the problem persists, only to mysteriously go away all of a sudden and then come back after a while.
I suspect it has something to do with monolog and/or the symfony profiler, but both are being used with their default settings, as can be seen below:
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
and
web_profiler:
toolbar: true
intercept_redirects: false
framework:
profiler: { only_exceptions: false }
Since I'm fairly new to Symfony, I'll include some more info that might or might not be relevant, so please excuse me if there's anything missing.
Bundles:
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
];
Both routes.yaml
and services.yaml
are pretty much default so I won't include them here.
I've already wasted countless hours on this, including trying to debug symfony code with xdebug.
User contributions licensed under CC BY-SA 3.0