Ask your Symfony questions! Pay money and get answers fast! (more info)

Where do appDevDebugProjectContainer errors come from? Symfony

  • SOLVED

I am working at a company. The project is Symfony 2.0, but it was hacked to use some new features, like composer.phar, that appeared in Symfony 2.1.

I checkout the master branch from github. I make my own branch. I am given a large project. I work for one month, alone, on my project, in my branch. The other developers are doing other work and committing their changes to master. I do not touch master for a month.

I finally get done with my project. Everything works great. The QA person says "Please merge master into your branch." I do so. There are many changes -- everything the other developers have done all month.

Suddenly my code, running on my local machine, is broken.

I get this error:

Warning: Uncaught exception 'ErrorException' with message 'Warning: require_once(/var/www/magnum.com/releases/lawrence_trout/front-end/app/../../vendor/leafo/lessphp/lessc.inc.php): failed to open stream: No such file or directory in /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/dev/appDevDebugProjectContainer.php line 113' in /var/www/magnum.com/releases/lawrence_trout/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php:67

Stack trace:

#0 /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/dev/appDevDebugProjectContainer.php(113): Symfony\Component\HttpKernel\Debug\ErrorHandler->handle(2, 'require_once(/v...', '/var/www/magnu...', 113, Array)

#1 /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/dev/appDevDebugProjectContainer.php(113): appDevDebugProjectContainer::getAssetic_Filter_LessphpService()

#2 /var/www/magnum.com/releases/lawrence_trout/front-end/app/bootstrap.php.cache(190): appDevDebugProjectContainer->getAssetic_Filter_Less in /var/www/magnum.com/releases/lawrence_trout/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php on line 67

Fatal error: appDevDebugProjectContainer::getAssetic_Filter_LessphpService(): Failed opening required '/var/www/magnum.com/releases/lawrence_trout/front-end/app/../../vendor/leafo/lessphp/lessc.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/dev/appDevDebugProjectContainer.php on line 113


I thought maybe there was a new dependency that had been added during the month, so perhaps I need to run composer.phar to get the new dependencies. So I try:

php composer.phar install

And I get the following error message:


Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files
Installing assets for Symfony\Bundle\FrameworkBundle into ./web/bundles/framework
Installing assets for Magnum\Bundle\SuperlistsAdminBundle into ./web/bundles/magnumsuperlistsadmin
Installing assets for Magnum\Bundle\ContentAdminBundle into ./web/bundles/magnumcontentadmin
Installing assets for Magnum\Bundle\ImageAdminBundle into ./web/bundles/magnumimageadmin
Installing assets for Symfony\Bundle\WebProfilerBundle into ./web/bundles/webprofiler
Installing assets for Sensio\Bundle\DistributionBundle into ./web/bundles/sensiodistribution
Clearing the cache for the prod environment with debug true
Clearing the cache for the dev environment with debug true
Installing assets for Symfony\Bundle\FrameworkBundle into ./web/bundles/framework
Installing assets for Magnum\Bundle\Web\FrontEndBundle into ./web/bundles/magnumfrontend
Installing assets for Magnum\Bundle\OmnitureBundle into ./web/bundles/magnumomniture
Installing assets for Magnum\Bundle\Web\BookingBundle into ./web/bundles/magnumbooking
Installing assets for Symfony\Bundle\WebProfilerBundle into ./web/bundles/webprofiler
Installing assets for Sensio\Bundle\DistributionBundle into ./web/bundles/sensiodistribution
Clearing the cache for the prod environment with debug true
Clearing the cache for the dev environment with debug true
PHP Warning: require_once(/var/www/magnum.com/releases/lawrence_trout/front-end/app/../../vendor/leafo/lessphp/lessc.inc.php): failed to open stream: No such file or directory in /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/prod/appProdProjectContainer.php on line 58
PHP Fatal error: require_once(): Failed opening required '/var/www/magnum.com/releases/lawrence_trout/front-end/app/../../vendor/leafo/lessphp/lessc.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/prod/appProdProjectContainer.php on line 58
Script cd front-end && php app/console assetic:dump --env=prod --no-debug handling the post-install-cmd event returned with an error



[RuntimeException]
Error Output: PHP Warning: require_once(/var/www/magnum.com/releases/lawrence_trout/front-end/app/../../vendor/leafo/lessphp/lessc.inc.php): failed to open stream: No such file or directory in /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/prod/appProdProjectContainer.php on line 58
PHP Fatal error: require_once(): Failed opening required '/var/www/magnum.com/releases/lawrence_trout/front-end/app/../../vendor/leafo/lessphp/lessc.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/magnum.com/releases/lawrence_trout/front-end/app/cache/prod/appProdProjectContainer.php on line 58




install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]


Any thoughts about what is wrong?

I am new to Symfony 2.x development, so feel free to point out obvious things to me..

Answers (1)

2013-07-12

Luis Cordova answers:

i think you need to know how to install that dependency leafo/less

https://github.com/leafo/lessphp/blob/master/lessc.inc.php

file is on the repo, maybe you are using the wrong version, or have not installed properly following the instructions


Luis Cordova comments:

most likely because thre are two methods for installing you need to be careful the other devs

have not done like


<?php
require "lessc.inc.php";

:)


Luis Cordova comments:

yeah it needs to be copied or be carefully written so that it will require rightly since this file has to be on the include path, or using the composer key for locating that classmap has to find the include. Definitely is not finding it, maybe because the other devs assumed yet do not persist it into the repo maybe


Lawrence Krubner comments:

There would be a lot of complaints from all the other devs if one of the devs committed the dependency but forgot to commit the code itself.


Luis Cordova comments:

the software does not lie, check physically that the file is not there on under your vendor

the path that is checking is maybe not the right one, don't assume just because other devs are doing stuff they have not solved it

you cannot assume they are perfect or have done it right. first check and see if the file is there


Lawrence Krubner comments:

This is line 58:

protected function getTemplating_Helper_RouterService()
{
return $this->services['templating.helper.router'] = new \Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper($this->get('router'));
}


Luis Cordova comments:

The lock file is not up to date with the latest changes in composer.json.

also maybe you have a badly merged composer.json

so what you need to do is

composer update leafo/less..

and see if that works :)

not sure why you are mentioning the error above, sounds like you are lost


Lawrence Krubner comments:

composer update did seem to fix it. At least I got past the fatal error. I'm still missing some css files and javascript files so the page is in disarray.


Luis Cordova comments:

php app/console assets:install web --symlink; php app/console assetic:dump --force;


Lawrence Krubner comments:

Good lord, how did you know that?

Anyway, thanks, that worked perfect.