Php Symfony 4偶尔编译错误:require():无法打开required
有时在生产过程中,由于本地无法复制,我们会遇到以下例外情况: getDoctrine\u Orm\u DefaultListeners\u AttachenTitylListenerService:Php Symfony 4偶尔编译错误:require():无法打开required,php,symfony,symfony4,Php,Symfony,Symfony4,有时在生产过程中,由于本地无法复制,我们会遇到以下例外情况: getDoctrine\u Orm\u DefaultListeners\u AttachenTitylListenerService: { "class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException", "message": "Compile Error: require(): Failed opening required '\/srv\/
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/ContainerWKxhZGH\/getDoctrine_Orm_DefaultListeners_AttachEntityListenersService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/ContainerWKxhZGH\/srcApp_KernelProdContainer.php:532"
}
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/ContainerAPB4itV\/getSession_Storage_NativeService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/ContainerAPB4itV\/srcApp_KernelProdContainer.php:532"
}
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/Container8GRzllw\/getApiPlatform_Listener_View_RespondService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/Container8GRzllw\/srcApp_KernelProdContainer.php:532"
}
getSession\u Storage\u NativeService:
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/ContainerWKxhZGH\/getDoctrine_Orm_DefaultListeners_AttachEntityListenersService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/ContainerWKxhZGH\/srcApp_KernelProdContainer.php:532"
}
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/ContainerAPB4itV\/getSession_Storage_NativeService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/ContainerAPB4itV\/srcApp_KernelProdContainer.php:532"
}
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/Container8GRzllw\/getApiPlatform_Listener_View_RespondService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/Container8GRzllw\/srcApp_KernelProdContainer.php:532"
}
GetAPIsplatform\u Listener\u View\u RespondService:
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/ContainerWKxhZGH\/getDoctrine_Orm_DefaultListeners_AttachEntityListenersService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/ContainerWKxhZGH\/srcApp_KernelProdContainer.php:532"
}
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/ContainerAPB4itV\/getSession_Storage_NativeService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/ContainerAPB4itV\/srcApp_KernelProdContainer.php:532"
}
{
"class": "Symfony\\Component\\Debug\\Exception\\FatalErrorException",
"message": "Compile Error: require(): Failed opening required '\/srv\/api\/var\/cache\/prod\/Container8GRzllw\/getApiPlatform_Listener_View_RespondService.php' (include_path='.:\/usr\/local\/lib\/php')",
"code": 0,
"file": "\/srv\/api\/var\/cache\/prod\/Container8GRzllw\/srcApp_KernelProdContainer.php:532"
}
我们有两个实例正在运行,并使用Symfony作为API。我们在引导时清除缓存,这也会使其升温
Symfony v4.3.4
有人知道从哪里开始寻找问题吗?我觉得cache:clear和cache:warmup各自的预热方式不同。到目前为止,我真的说不出区别在哪里。但是您是否尝试过直接预热缓存,只是为了查看是否出现相同的错误?如果我手动清除并预热缓存,则会出现相同的问题。因此。。您的项目中是否有可能清除部分缓存的代码?是否有多台服务器使用同一目录?该问题是由错误配置的Kubernetes readinessProbe引起的,该探测器导致缓存被清除并重新预热,因此有时会丢失引用。我感觉cache:clear和cache:warmup各自的预热方式不同。到目前为止,我真的说不出区别在哪里。但是您是否尝试过直接预热缓存,只是为了查看是否出现相同的错误?如果我手动清除并预热缓存,则会出现相同的问题。因此。。您的项目中是否有可能清除部分缓存的代码?是否有多台服务器使用同一目录?该问题是由错误配置的Kubernetes readinessProbe引起的,该探测器导致缓存被清除并再次预热,因此有时会丢失引用。