Closed buzter closed 5 years ago
hm, please try to remove the cache first: bin/console cache:clear --env=prod
.
If the cache clear fails try the hard way: rm -rf var/cache/prod
Then run the update again.
Had to remove the cache the hard way for the following reason:
` In DefinitionErrorExceptionPass.php line 54:
Cannot autowire service "App\Repository\TeamRepository": argument "$class" of method "Doctrine\ORM\EntityRepository::__construct()" references class " Doctrine\ORM\Mapping\ClassMetadata" but no such service exists. `
When updating afterwards composer install ends this way:
`Executing script cache:clear [KO] [KO] Script cache:clear returned with error code 255 !! PHP Fatal error: During class fetch: Uncaught ReflectionException: Class Doctrine\Bundle\FixturesBundle\Fixture not found in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php:29 !! Stack trace: !! #0 /volume1/web/kimai2/vendor/composer/ClassLoader.php(444): include('/volume1/web/ki...') !! #1 /volume1/web/kimai2/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/volume1/web/ki...') !! #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('App\DataFixture...') !! #3 [internal function]: spl_autoload_call('App\DataFixture...') !! #4 /volume1/web/kimai2/vendor/symfony/config/Resource/ClassExistenceResource.php(78): class_exists('App\DataFixture...') !! #5 /volume1/web/kimai2/vendor/symfony/dependency-injection/ContainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0) !! #6 /volume1/web/kimai2/vendor/symfony/dependency-injection/Loader/FileLoader.php(151): Symfony\Component\DependencyInjection\ContainerBuilder->getReflectionClass('App\DataFixture...') !! #7 /volume1/web/kimai2/ in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php on line 29 !! !! Fatal error: During class fetch: Uncaught ReflectionException: Class Doctrine\Bundle\FixturesBundle\Fixture not found in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php:29 !! Stack trace: !! #0 /volume1/web/kimai2/vendor/composer/ClassLoader.php(444): include('/volume1/web/ki...') !! #1 /volume1/web/kimai2/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/volume1/web/ki...') !! #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('App\DataFixture...') !! #3 [internal function]: spl_autoload_call('App\DataFixture...') !! #4 /volume1/web/kimai2/vendor/symfony/config/Resource/ClassExistenceResource.php(78): class_exists('App\DataFixture...') !! #5 /volume1/web/kimai2/vendor/symfony/dependency-injection/ContainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0) !! #6 /volume1/web/kimai2/vendor/symfony/dependency-injection/Loader/FileLoader.php(151): Symfony\Component\DependencyInjection\ContainerBuilder->getReflectionClass('App\DataFixture...') !! #7 /volume1/web/kimai2/ in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php on line 29 !! Script @auto-scripts was called via post-install-cmd
` I updated PHP end of last week. Perhaps sth went wrong there...!?
These errors don't make a lot of sense to me.
Are you running in dev
or prod
?
Did you run composer install?
Make sure that you are using an up-to-date composer (1.9 would be best).
I'm running prod
.
Yes I did a composer install using v1.9.
Just checking my php-installation cause of the update in last week...
Hm, I don't understand why the missing classes throw an exception. They shouldn't be used. Doctrine\Bundle\FixturesBundle\Fixture is a class which is never used in prod and should not be loaded. It is not existing, because it is only existing in composers dev dependencies. Which commands are you running exactly?
When trying to clear cache (what always worked including last update from 1.1 to 1.2):
sudo --u http /usr/local/bin/php72 bin/console cache:clear --env=prod
This ends still with:
In DefinitionErrorExceptionPass.php line 54: Cannot autowire service "App\Repository\TeamRepository": argument "$class" of method "Doctrine\ORM\EntityRepository::__construct()" references class " Doctrine\ORM\Mapping\ClassMetadata" but no such service exists.
Try to delete the vendor directory and reinstall it completely. I think you can skip the "sudo -u http" part.
Thx for Your help. Got an error first and tried again. Finally it worked without any error. Thx!!!
Weird, but glad it works finally. Don't forget the database migration!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.
Executing script cache:clear [KO] [KO] Script cache:clear returned with error code 255 !! PHP Warning: include_once(/volume1/web/kimai2/src/Command/ConvertTimezoneCommand.php): failed to open stream: No such file or directory in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getConvertTimezoneCommandService.php on line 10 !! PHP Warning: include_once(): Failed opening '/volume1/web/kimai2/src/Command/ConvertTimezoneCommand.php' for inclusion (include_path='.:/var/packages/PEAR/target') in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getConvertTimezoneCommandService.php on line 10 !! !! Warning: include_once(/volume1/web/kimai2/src/Command/ConvertTimezoneCommand.php): failed to open stream: No such file or directory in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getConvertTimezoneCommandService.php on line 10 !! !! Warning: include_once(): Failed opening '/volume1/web/kimai2/src/Command/ConvertTimezoneCommand.php' for inclusion (include_path='.:/var/packages/PEAR/target') in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getConvertTimezoneCommandService.php on line 10 !! !! Warning: include_once(/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoderInterface.php): failed to open stream: No such file or directory in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 9 !! !! Warning: include_once(): Failed opening '/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoderInterface.php' for inclusion (include_path='.:/var/packages/PEAR/target') in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 9 !! PHP Warning: include_once(/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoderInterface.php): failed to open stream: No such file or directory in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 9 !! PHP Warning: include_once(): Failed opening '/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoderInterface.php' for inclusion (include_path='.:/var/packages/PEAR/target') in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 9 !! PHP Warning: include_once(/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoder.php): failed to open stream: No such file or directory in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 10 !! PHP Warning: include_once(): Failed opening '/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoder.php' for inclusion (include_path='.:/var/packages/PEAR/target') in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 10 !! !! Warning: include_once(/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoder.php): failed to open stream: No such file or directory in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 10 !! !! Warning: include_once(): Failed opening '/volume1/web/kimai2/vendor/symfony/security/Core/Encoder/UserPasswordEncoder.php' for inclusion (include_path='.:/var/packages/PEAR/target') in /volume1/web/kimai2/var/cache/prod/Container5rvBcSg/getSecurity_PasswordEncoderService.php on line 10 !! !! !! [WARNING] Some commands could not be registered: !! !! !! In getConvertTimezoneCommandService.php line 12: !! !! Class 'App\Command\ConvertTimezoneCommand' not found !! !! !! !! !! [WARNING] Some commands could not be registered: !! !! !! In getConvertTimezoneCommandService.php line 12: !! !! Class 'App\Command\ConvertTimezoneCommand' not found !! !! !! !! // Clearing the cache for the prod environment with debug !! // false !! !! !! Fatal error: During class fetch: Uncaught ReflectionException: Class Doctrine\Bundle\FixturesBundle\Fixture not found in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php:29 !! Stack trace: !! #0 /volume1/web/kimai2/vendor/composer/ClassLoader.php(444): include('/volume1/web/ki...') !! #1 /volume1/web/kimai2/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/volume1/web/ki...') !! #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('App\\DataFixture...') !! #3 [internal function]: spl_autoload_call('App\\DataFixture...') !! #4 /volume1/web/kimai2/vendor/symfony/config/Resource/ClassExistenceResource.php(78): class_exists('App\\DataFixture...') !! #5 /volume1/web/kimai2/vendor/symfony/dependency-injection/ContainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0) !! #6 /volume1/web/kimai2/vendor/symfony/dependency-injection/Loader/FileLoader.php(151): Symfony\Component\DependencyInjection\ContainerBuilder->getReflectionClass('App\\DataFixture...') !! #7 /volume1/web/kimai2/ in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php on line 29 !! PHP Fatal error: During class fetch: Uncaught ReflectionException: Class Doctrine\Bundle\FixturesBundle\Fixture not found in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php:29 !! Stack trace: !! #0 /volume1/web/kimai2/vendor/composer/ClassLoader.php(444): include('/volume1/web/ki...') !! #1 /volume1/web/kimai2/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/volume1/web/ki...') !! #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('App\\DataFixture...') !! #3 [internal function]: spl_autoload_call('App\\DataFixture...') !! #4 /volume1/web/kimai2/vendor/symfony/config/Resource/ClassExistenceResource.php(78): class_exists('App\\DataFixture...') !! #5 /volume1/web/kimai2/vendor/symfony/dependency-injection/ContainerBuilder.php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFresh(0) !! #6 /volume1/web/kimai2/vendor/symfony/dependency-injection/Loader/FileLoader.php(151): Symfony\Component\DependencyInjection\ContainerBuilder->getReflectionClass('App\\DataFixture...') !! #7 /volume1/web/kimai2/ in /volume1/web/kimai2/src/DataFixtures/CustomerFixtures.php on line 29 !! !! In CustomerFixtures.php line 29: !! !! Error: During class fetch: Uncaught ReflectionException: Class Doctrine\Bun !! dle\FixturesBundle\Fixture not found in /volume1/web/kimai2/src/DataFixture !! s/CustomerFixtures.php:29 !! Stack trace: !! #0 /volume1/web/kimai2/vendor/composer/ClassLoader.php(444): include('/volu !! me1/web/ki...') !! #1 /volume1/web/kimai2/vendor/composer/ClassLoader.php(322): Composer\Autol !! oad\includeFile('/volume1/web/ki...') !! #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('App\\Data !! Fixture...') !! #3 [internal function]: spl_autoload_call('App\\DataFixture...') !! #4 /volume1/web/kimai2/vendor/symfony/config/Resource/ClassExistenceResourc !! e.php(78): class_exists('App\\DataFixture...') !! #5 /volume1/web/kimai2/vendor/symfony/dependency-injection/ContainerBuilder !! .php(353): Symfony\Component\Config\Resource\ClassExistenceResource->isFres !! h(0) !! #6 /volume1/web/kimai2/vendor/symfony/dependency-injection/Loader/FileLoade !! r.php(151): Symfony\Component\DependencyInjection\ContainerBuilder->getRefl !! ectionClass('App\\DataFixture...') !! #7 /volume1/web/kimai2/ !! !! !! cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> !! !! Script @auto-scripts was called via post-install-cmd
Using kimai for a long time now and never experienced a similar problem.