Reputation: 8901
I'm having this error in the bootstrap (both app_dev and app) and I'm actually quite lost at this point:
FatalThrowableError in ContainerBuilder.php line 219: Type error: Argument 1 passed to Symfony\Component\DependencyInjection\ContainerBuilder::addResource() must implement interface Symfony\Component\Config\Resource\ResourceInterface, instance of Symfony\Component\Config\Resource\FileResource given, called in /var/www/sellbytel2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 279
in ContainerBuilder.php line 219
at ContainerBuilder->addResource(object(FileResource)) in ContainerBuilder.php line 279
at ContainerBuilder->addClassResource(object(ReflectionClass)) in ContainerBuilder.php line 258
at ContainerBuilder->addObjectResource(object(AppKernel)) in Kernel.php line 578
at Kernel->buildContainer() in Kernel.php line 486
at Kernel->initializeContainer() in Kernel.php line 116
at Kernel->boot() in Kernel.php line 165
at Kernel->handle(object(Request)) in app_dev.php line 12
I've been digging a bit in the symfony code and I found that the error occurs when the kernel is iniciated (new AppKernel('dev', true)) but I don't understand why this could be happening.
To make things mmore strange thisi is only happening in my staging env, in my dev env works fine (vagrant with centos, same thing as staging).
I'm using Symfony 3.2.9 Here are the contents of the app_dev.php file
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
/** @var \Composer\Autoload\ClassLoader $loader */
$loader = require __DIR__.'/../app/autoload.php';
Debug::enable();
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Upvotes: 2
Views: 1457