<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes/no</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes/no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4.7</td>
</tr>
</tbody>
</table>
<p dir="auto">I have a Symfony 3.4 project and code from an old project (SF 2.1) - I want to migrade the code from the old project to the new one. In none of these both projects exists any service.</p>
<p dir="auto">By running <code class="notranslate">php bin/console</code> I get the error <code class="notranslate">Circular reference detected for service "routing.loader", path: "routing.loader".</code> -&gt; nothing works.</p>
<p dir="auto">Exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Symfony\Component\DependencyInjection\Container-&gt;get() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:56
 Symfony\Bundle\FrameworkBundle\Routing\Router-&gt;getRouteCollection() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:363
 Symfony\Component\Routing\Router-&gt;getGeneratorDumperInstance() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:328
 Symfony\Component\Routing\Router-&gt;Symfony\Component\Routing\{closure}() at n/a:n/a
 call_user_func() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php:43
 Symfony\Component\Config\ResourceCheckerConfigCacheFactory-&gt;cache() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:336
 Symfony\Component\Routing\Router-&gt;getGenerator() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:240
 Symfony\Component\Routing\Router-&gt;generate() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1444
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getDebug_FileLinkFormatterService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1009
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getTwigService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/getAssetic_AssetManagerService.php:21
 require() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:840
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;load() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/getRouting_LoaderService.php:46
 require() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:840
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;load() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:304
 Symfony\Component\DependencyInjection\Container-&gt;get() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:56
 Symfony\Bundle\FrameworkBundle\Routing\Router-&gt;getRouteCollection() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:363
 Symfony\Component\Routing\Router-&gt;getGeneratorDumperInstance() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:328
 Symfony\Component\Routing\Router-&gt;Symfony\Component\Routing\{closure}() at n/a:n/a
 call_user_func() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php:43
 Symfony\Component\Config\ResourceCheckerConfigCacheFactory-&gt;cache() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:336
 Symfony\Component\Routing\Router-&gt;getGenerator() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:240
 Symfony\Component\Routing\Router-&gt;generate() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1444
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getDebug_FileLinkFormatterService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1292
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getDebug_DebugHandlersListenerService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1365
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;ContainerYqoe0c9\{closure}() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:229
 Symfony\Component\EventDispatcher\EventDispatcher-&gt;sortListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:61
 Symfony\Component\EventDispatcher\EventDispatcher-&gt;getListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php:128
 Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;getListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:250
 Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher-&gt;preProcess() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:134
 Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher-&gt;dispatch() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:961
 Symfony\Component\Console\Application-&gt;doRunCommand() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86
 Symfony\Bundle\FrameworkBundle\Console\Application-&gt;doRunCommand() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248
 Symfony\Component\Console\Application-&gt;doRun() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74
 Symfony\Bundle\FrameworkBundle\Console\Application-&gt;doRun() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148
 Symfony\Component\Console\Application-&gt;run() at /private/var/www/html/treeconsult/test/bin/console:27"><pre class="notranslate"><code class="notranslate"> Symfony\Component\DependencyInjection\Container-&gt;get() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:56
 Symfony\Bundle\FrameworkBundle\Routing\Router-&gt;getRouteCollection() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:363
 Symfony\Component\Routing\Router-&gt;getGeneratorDumperInstance() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:328
 Symfony\Component\Routing\Router-&gt;Symfony\Component\Routing\{closure}() at n/a:n/a
 call_user_func() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php:43
 Symfony\Component\Config\ResourceCheckerConfigCacheFactory-&gt;cache() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:336
 Symfony\Component\Routing\Router-&gt;getGenerator() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:240
 Symfony\Component\Routing\Router-&gt;generate() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1444
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getDebug_FileLinkFormatterService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1009
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getTwigService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/getAssetic_AssetManagerService.php:21
 require() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:840
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;load() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/getRouting_LoaderService.php:46
 require() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:840
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;load() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:304
 Symfony\Component\DependencyInjection\Container-&gt;get() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:56
 Symfony\Bundle\FrameworkBundle\Routing\Router-&gt;getRouteCollection() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:363
 Symfony\Component\Routing\Router-&gt;getGeneratorDumperInstance() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:328
 Symfony\Component\Routing\Router-&gt;Symfony\Component\Routing\{closure}() at n/a:n/a
 call_user_func() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php:43
 Symfony\Component\Config\ResourceCheckerConfigCacheFactory-&gt;cache() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:336
 Symfony\Component\Routing\Router-&gt;getGenerator() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:240
 Symfony\Component\Routing\Router-&gt;generate() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1444
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getDebug_FileLinkFormatterService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1292
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;getDebug_DebugHandlersListenerService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1365
 ContainerYqoe0c9\appDevDebugProjectContainer-&gt;ContainerYqoe0c9\{closure}() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:229
 Symfony\Component\EventDispatcher\EventDispatcher-&gt;sortListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:61
 Symfony\Component\EventDispatcher\EventDispatcher-&gt;getListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php:128
 Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher-&gt;getListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:250
 Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher-&gt;preProcess() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:134
 Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher-&gt;dispatch() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:961
 Symfony\Component\Console\Application-&gt;doRunCommand() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86
 Symfony\Bundle\FrameworkBundle\Console\Application-&gt;doRunCommand() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248
 Symfony\Component\Console\Application-&gt;doRun() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74
 Symfony\Bundle\FrameworkBundle\Console\Application-&gt;doRun() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148
 Symfony\Component\Console\Application-&gt;run() at /private/var/www/html/treeconsult/test/bin/console:27
</code></pre></div>
<p dir="auto">Installed packages (<code class="notranslate">composer info</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="composer/ca-bundle                   1.1.1   Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
doctrine/annotations                 v1.6.0  Docblock Annotations Parser
doctrine/cache                       v1.7.1  Caching library offering an object-oriented API for many cache backends
doctrine/collections                 v1.5.0  Collections Abstraction library
doctrine/common                      v2.8.1  Common Library for Doctrine projects
doctrine/dbal                        v2.7.0  Database Abstraction Layer
doctrine/doctrine-bundle             1.8.1   Symfony DoctrineBundle
doctrine/doctrine-cache-bundle       1.3.3   Symfony Bundle for Doctrine Cache
doctrine/inflector                   v1.3.0  Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                1.1.0   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                       v1.0.1  Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm                         v2.6.1  Object-Relational-Mapper for PHP
fig/link-util                        1.0.0   Common utility implementations for HTTP links
friendsofsymfony/user-bundle         v2.1.2  Symfony FOSUserBundle
incenteev/composer-parameter-handler v2.1.3  Composer script handling your ignored parameter file
jdorn/sql-formatter                  v1.2.17 a PHP SQL highlighting library
kriswallsmith/assetic                v1.4.0  Asset Management for PHP
monolog/monolog                      1.23.0  Sends your logs to files, sockets, inboxes, databases and various web services
paragonie/random_compat              v2.0.11 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
psr/cache                            1.0.1   Common interface for caching libraries
psr/container                        1.0.0   Common Container Interface (PHP FIG PSR-11)
psr/link                             1.0.0   Common interfaces for HTTP links
psr/log                              1.0.2   Common interface for logging libraries
psr/simple-cache                     1.0.1   Common interfaces for simple caching
sensio/distribution-bundle           v5.0.21 Base bundle for Symfony Distributions
sensio/framework-extra-bundle        v5.1.6  This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle              v3.1.7  This bundle generates code for you
sensiolabs/security-checker          v4.1.8  A security checker for your composer.lock
swiftmailer/swiftmailer              v5.4.9  Swiftmailer, free feature-rich PHP mailer
symfony/assetic-bundle               v2.8.2  Integrates Assetic into Symfony2
symfony/monolog-bundle               v3.2.0  Symfony MonologBundle
symfony/phpunit-bridge               v3.4.7  Symfony PHPUnit Bridge
symfony/polyfill-apcu                v1.7.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu            v1.7.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring            v1.7.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php56               v1.7.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70               v1.7.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util                v1.7.0  Symfony utilities for portability of PHP codes
symfony/swiftmailer-bundle           v2.6.7  Symfony SwiftmailerBundle
symfony/symfony                      v3.4.7  The Symfony PHP framework
twig/twig                            v2.4.8  Twig, the flexible, fast, and secure template language for PHP"><pre class="notranslate"><code class="notranslate">composer/ca-bundle                   1.1.1   Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
doctrine/annotations                 v1.6.0  Docblock Annotations Parser
doctrine/cache                       v1.7.1  Caching library offering an object-oriented API for many cache backends
doctrine/collections                 v1.5.0  Collections Abstraction library
doctrine/common                      v2.8.1  Common Library for Doctrine projects
doctrine/dbal                        v2.7.0  Database Abstraction Layer
doctrine/doctrine-bundle             1.8.1   Symfony DoctrineBundle
doctrine/doctrine-cache-bundle       1.3.3   Symfony Bundle for Doctrine Cache
doctrine/inflector                   v1.3.0  Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                1.1.0   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                       v1.0.1  Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm                         v2.6.1  Object-Relational-Mapper for PHP
fig/link-util                        1.0.0   Common utility implementations for HTTP links
friendsofsymfony/user-bundle         v2.1.2  Symfony FOSUserBundle
incenteev/composer-parameter-handler v2.1.3  Composer script handling your ignored parameter file
jdorn/sql-formatter                  v1.2.17 a PHP SQL highlighting library
kriswallsmith/assetic                v1.4.0  Asset Management for PHP
monolog/monolog                      1.23.0  Sends your logs to files, sockets, inboxes, databases and various web services
paragonie/random_compat              v2.0.11 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
psr/cache                            1.0.1   Common interface for caching libraries
psr/container                        1.0.0   Common Container Interface (PHP FIG PSR-11)
psr/link                             1.0.0   Common interfaces for HTTP links
psr/log                              1.0.2   Common interface for logging libraries
psr/simple-cache                     1.0.1   Common interfaces for simple caching
sensio/distribution-bundle           v5.0.21 Base bundle for Symfony Distributions
sensio/framework-extra-bundle        v5.1.6  This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle              v3.1.7  This bundle generates code for you
sensiolabs/security-checker          v4.1.8  A security checker for your composer.lock
swiftmailer/swiftmailer              v5.4.9  Swiftmailer, free feature-rich PHP mailer
symfony/assetic-bundle               v2.8.2  Integrates Assetic into Symfony2
symfony/monolog-bundle               v3.2.0  Symfony MonologBundle
symfony/phpunit-bridge               v3.4.7  Symfony PHPUnit Bridge
symfony/polyfill-apcu                v1.7.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu            v1.7.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring            v1.7.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php56               v1.7.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70               v1.7.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util                v1.7.0  Symfony utilities for portability of PHP codes
symfony/swiftmailer-bundle           v2.6.7  Symfony SwiftmailerBundle
symfony/symfony                      v3.4.7  The Symfony PHP framework
twig/twig                            v2.4.8  Twig, the flexible, fast, and secure template language for PHP
</code></pre></div>
<p dir="auto">Any ideas how to fix it? Thanks!</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4.7</td>
</tr>
</tbody>
</table>
<p dir="auto">after <code class="notranslate">composer up</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" [RuntimeException]
  An error occurred when executing the &quot;'cache:clear --no-warmup'&quot; command:

  In Container.php line 297:

    Circular reference detected for service &quot;routing.loader&quot;, path: &quot;routing.loader&quot;."><pre class="notranslate"><code class="notranslate"> [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command:

  In Container.php line 297:

    Circular reference detected for service "routing.loader", path: "routing.loader".
</code></pre></div>