Error installation with composer

Hello I’m new to Pimcore and I have some problem after running composer install process I have this error:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service “Pimcore\Helper\LongRunningHelper”: argument “$connectionRegistry” of method “__construct()” references interface “Doctrine\Common\Persistence\ConnectionRegistry” but no such service exists. It cannot be auto-registered because it is from a different root namespace. in D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass.php:37
Stack trace:
#0 D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass.php(60): Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue(Object(Symfony\Component\DependencyInjection\Definition), true)
#1 D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass.php(30): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->proc in D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass.php on line 37
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception

[RuntimeException]
An error occurred when executing the ““cache:clear --no-warmup”” command:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service “Pi
mcore\Helper\LongRunningHelper”: argument “$connectionRegistry” of method “__construct()” references interface “Doc
trine\Common\Persistence\ConnectionRegistry” but no such service exists. It cannot be auto-registered because it is
from a different root namespace. in D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\Depend
encyInjection\Compiler\DefinitionErrorExceptionPass.php:37
Stack trace:
#0 D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\AbstractRec
ursivePass.php(60): Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue(Objec
t(Symfony\Component\DependencyInjection\Definition), true)
#1 D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionE
rrorExceptionPass.php(30): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->proc in D:\laragon
\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorException
Pass.php on line 37

install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev] [–no-custom-installers] [–no-autoloader] [–no-scripts] [–no-progress] [–no-suggest] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–ignore-platform-reqs] [–] []…

and when i try to type

bin/console cache:clear

i received :
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service “Pimcore\Helper\LongRunningHelper”: argument “$connectionRegistry” of method “__construct()” references interface “Doctrine\Common\Persistence\ConnectionRegistry” but no such service exists. It cannot be auto-registered because it is from a different root namespace. in D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass.php:37
Stack trace:
#0 D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass.php(60): Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue(Object(Symfony\Component\DependencyInjection\Definition), true)
#1 D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass.php(30): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->proc in D:\laragon\www\bfi\docroot\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass.php on line 37

I was trying to install my team project but stuck with this error.
it was pimcore 5 project
I’m using bash

Thank you

try again, doctrine fucked up, but they fixed it couple of hours ago

still the same error. i guess they haven’t completely fixed it yet?

I’m having this error while trying to upgrade from 5.1 to 5.4. So this is Doctrine related bug? How come it is affecting me still?

As long as you’re on pimcore < 5.6 you need to add a service declaration manually.
Just create a _legacy.yml and include it in your app/config/config.yml:

Add to app/config/config.yml:

imports:
    - { resource: _legacy.yml }

Add file app/config/_legacy.yml:

services:
    _defaults:
        public: true

    Doctrine\Common\Persistence\ConnectionRegistry: '@doctrine'

Don’t forget to remove it after you’re on pimcore > 5.6.

1 Like