title: Symfony2 problems with assets
body: <p>I recently began to add new features on a website that uses Symfony2.
  After creating a new bundle that is very similar to the others already working, I created a button to access to the feature.</p>
  
  <p>But then I got the following errors in my browser's developer tool:</p>
  
  <pre><code>GET prod.project.local/bundles/calinobase/css//calino-main-colors.css            prod.project.local/:35
  GET prod.project.local/bundles/calinobase/css//main-colors.css                   prod.project.local/:28
  GET prod.project.local/bundles/calinobase/css//bootstrap-override-colors.css     prod.project.local/:27
  GET prod.project.local/bundles/calinobase/css//buttons-colors.css                prod.project.local/:29
  GET prod.project.local/bundles/calinobase/css//menus-colors.css                  prod.project.local/:33
  GET prod.project.local/bundles/calinobase/css//forms-colors.css                  prod.project.local/:32
  GET prod.project.local/bundles/calinobase/css//content-colors.css                prod.project.local/:30
  GET prod.project.local/bundles/calinobase/css//mag-colors.css                    prod.project.local/:31
  GET prod.project.local/bundles/calinobase/css//search-colors.css                 prod.project.local/:34
  </code></pre>
  
  <p>Plus an error 500 on my page.</p>
  
  <p>After some researches I found that it came from the stylesheets.html.twig file:</p>
  
  <pre><code>&lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/bootstrap-override-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/main-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/buttons-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/content-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/mag-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/forms-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/menus-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/search-colors.css') }}" type="text/css" media="screen" /&gt;
  &lt;link rel="stylesheet" href="{{ asset('bundles/calinobase/css/' ~ colorTheme ~ '/calino-main-colors.css') }}" type="text/css" media="screen" /&gt;
  </code></pre>
  
  <p>Apparently it doesn't find the colorTheme, which is set in the layout.html.twig when it uses the stylesheet:</p>
  
  <pre><code>{% block stylesheets %}
              {{ include('::stylesheets.html.twig', {colorTheme: app.user.color|default('bfc100')}, with_context = false) }}
  {% endblock %}
  </code></pre>
  
  <p>In my logs I have the following errors:</p>
  
  <pre><code>[2015-01-21 15:22:42] request.INFO: Matched route "calinobase_homepage" (parameters: "_controller": "Calino\BaseBundle\Controller\DefaultController::indexAction", "_route": "calinobase_homepage") [] []
  [2015-01-21 15:22:43] security.INFO: Populated SecurityContext with an anonymous Token [] []
  [2015-01-21 15:22:43] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: "An exception occurred while executing 'SELECT a0_.id AS id0, a0_.creaDate AS creaDate1, a0_.editDate AS editDate2, a0_.title AS title3, a0_.slug AS slug4, a0_.intro AS intro5, a0_.content AS content6, a0_.alaune AS alaune7, a0_.published AS published8, a0_.thread_id AS thread_id9, a0_.articleTheme_id AS articleTheme_id10, a0_.avatar_id AS avatar_id11 FROM article_mag a0_ WHERE a0_.alaune = 1 ORDER BY a0_.creaDate DESC LIMIT 1':  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'calinofriendsdb.article_mag' doesn't exist" at /var/www/prod.project.local/htdocs/current/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 53 {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 0): An exception occurred while executing 'SELECT a0_.id AS id0, a0_.creaDate AS creaDate1, a0_.editDate AS editDate2, a0_.title AS title3, a0_.slug AS slug4, a0_.intro AS intro5, a0_.content AS content6, a0_.alaune AS alaune7, a0_.published AS published8, a0_.thread_id AS thread_id9, a0_.articleTheme_id AS articleTheme_id10, a0_.avatar_id AS avatar_id11 FROM article_mag a0_ WHERE a0_.alaune = 1 ORDER BY a0_.creaDate DESC LIMIT 1':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'calinofriendsdb.article_mag' doesn't exist at /var/www/prod.project.local/htdocs/current/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:53, Doctrine\\DBAL\\Driver\\PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'calinofriendsdb.article_mag' doesn't exist at /var/www/prod.project.local/htdocs/current/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'calinofriendsdb.article_mag' doesn't exist at /var/www/prod.project.local/htdocs/current/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104)"} []
  [2015-01-21 15:22:43] security.DEBUG: Write SecurityContext in the session [] []
  [2015-01-21 15:22:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//forms-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//forms-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//main-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//main-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//bootstrap-override-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//bootstrap-override-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//content-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//content-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//buttons-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//buttons-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:43] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//mag-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//mag-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:44] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//search-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//search-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:44] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//calino-main-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//calino-main-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  [2015-01-21 15:22:44] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/calinobase/css//menus-colors.css" (from "http://prod.project.local/")" at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php line 3098 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/calinobase/css//menus-colors.css\" (from \"http://prod.project.local/\") at /var/www/prod.project.local/htdocs/current/app/cache/prod/classes.php:3098, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /var/www/prod.project.local/htdocs/current/app/cache/prod/appProdUrlMatcher.php:1498)"} []
  </code></pre>
  
  <p>I develop with PhpStorm so when I mouseover "calinobase" in my stylesheets.html.twig, it displays "Missing assets" so I tried to use <em>php app/console assets:install --verbose</em> but I got:</p>
  
  <pre><code>Installing assets as hard copies.
  Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
   
   
                                                                                
    [Symfony\Component\Filesystem\Exception\IOException]                      
    Failed to remove file "web/bundles/framework/images/blue_picto_more.gif". 
                                                                                
   
   
  Exception trace:
   () at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:173
   Symfony\Component\Filesystem\Filesystem-&gt;remove() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:160
   Symfony\Component\Filesystem\Filesystem-&gt;remove() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:160
   Symfony\Component\Filesystem\Filesystem-&gt;remove() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php:98
   Symfony\Bundle\FrameworkBundle\Command\AssetsInstallCommand-&gt;execute() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:253
   Symfony\Component\Console\Command\Command-&gt;run() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:882
   Symfony\Component\Console\Application-&gt;doRunCommand() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:195
   Symfony\Component\Console\Application-&gt;doRun() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
   Symfony\Bundle\FrameworkBundle\Console\Application-&gt;doRun() at /home/kemps/dev2/calinofriends/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
   Symfony\Component\Console\Application-&gt;run() at /home/kemps/dev2/calinofriends/app/console:22
   
   
  assets:install [--symlink] [--relative] [target]
  </code></pre>
  
  <p>Not knowing what to do to handle thoses errors, I will be glad to have any  help. Thanks in advance to anyone who will help me.</p>
  
  <p>EDIT: my Symfony project is on a virtual machine installed with Vagrant, configured with Puppetmaster and it has NFS shared folders</p>