I trying to deploy my application (Symfony 6 and php 8) through the Gandi.net french service. When I run the command to deploy the app by ssh I get the following error message in my terminal :
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! Symfony\Component\ErrorHandler\Error\ClassNotFoundError {#75
!! #message: """
!! Attempted to load class "DebugBundle" from namespace "Symfony\Bundle\DebugBundle".\n
!! Did you forget a "use" statement for another namespace?
!! """
!! #code: 0
!! #file: "./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php"
!! #line: 131
!! trace: {
!! ./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php:131 { …}
!! ./vendor/symfony/http-kernel/Kernel.php:382 { …}
!! ./vendor/symfony/http-kernel/Kernel.php:768 { …}
!! ./vendor/symfony/http-kernel/Kernel.php:128 { …}
!! ./vendor/symfony/framework-bundle/Console/Application.php:166 { …}
!! ./vendor/symfony/framework-bundle/Console/Application.php:72 { …}
!! ./vendor/symfony/console/Application.php:171 { …}
!! ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …}
!! ./vendor/autoload_runtime.php:29 { …}
!! ./bin/console:11 {
!! ›
!! › require_once dirname(DIR).'/vendor/autoload_runtime.php';
!! ›
!! arguments: {
!! "/tmp/build.14jKbmPhHD/vendor/autoload_runtime.php"
!! }
!! }
!! }
!! }
!! 2022-03-11T15:10:40+00:00 [critical] Uncaught Error: Class "Symfony\Bundle\DebugBundle\DebugBundle" not found
!!
Script @auto-scripts was called via post-install-cmd
-----> Building new application failed
-----> Aborting deployment
This is the 2 files where the DebugBundle is mentioned.
Composer.lock
"autoload": { "psr-4": {
"Symfony\Bundle\DebugBundle\": ""
},
"exclude-from-classmap": [ "/Tests/"
]
},Bundles.php
['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], ];
The error suppose that I forgot a “use” but I never instantiate the DebugBundle so I never had to write a use for him. I try to run composer require symfony/debug-bundle and do a composer update but nothing change.
I already try to change de content of the composer.lock by changing :
"autoload": {
"psr-4": {
"Symfony\\Bundle\\DebugBundle\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
To
"autoload": {
"psr-4": {
"Symfony\\Bundle\\DebugBundle\\": “App\src”
},
"exclude-from-classmap": [
"/Tests/"
]
},
but when the composer install or update is run the “App/src” is delete and the file return to is original value.
I’m running out of idea so I hope your guys can help me.
Have a nice day.
Aimerick