0

I'm getting a doctrine error after deploying my app on PagodaBox. It works fine in both dev and prod environments on my local machine but the live site returns this error:

Fatal error: Uncaught exception 'LogicException' with message 'Illegal value passed (no array or string given)' in /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php:101 Stack trace: #0 /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php(101): spl_autoload_register(NULL) #1 /var/www/app/bootstrap.php.cache(2275): Doctrine\Bundle\DoctrineBundle\DoctrineBundle->boot() #2 /var/www/app/bootstrap.php.cache(2303): Symfony\Component\HttpKernel\Kernel->boot() #3 /var/www/web/app.php(23): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #4 {main} thrown in /var/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php on line 101

The cache is cleared every time the app is deployed. Any suggestions would be gratefully received because I'm totally stumped!

UPDATE:

I've done some more debugging and I have discovered that even in the prod environment the kernel.cache_dir parameter is set to /var/www/app/cache/dev. This means that the doctrine cache dir is being incorrectly set as it relies on this other parameter. I thought the kernel.cache_dir was set automatically depending on the environment.

musoNic80
  • 3,678
  • 9
  • 40
  • 48

2 Answers2

1

I finally got this sorted. It was down to using eAccelerator as my opcode cache. It turns out that there is a bug in eAccelerator that means it can't process closures correctly. I'm now using XCache and it is all working fine.

musoNic80
  • 3,678
  • 9
  • 40
  • 48
0

This is the auto-loading failing in DoctrineBundle.php Line 101:

 $this->autoloader = Autoloader::register($dir, $namespace, $proxyGenerator);

Your passing NULL to the $dir argument, which judging by the exception its requires either an array() or string.

You can see that the method uses $dir from the configuration variable doctrine.orm.proxy_dir (Line 64).

$dir = $this->container->getParameter('doctrine.orm.proxy_dir');`

My guess is that you have not defined this path correctly

Edit - Take a look here for Doctrine's configuration which includes the proxy_dir setting.

AlexP
  • 9,906
  • 1
  • 24
  • 43
  • Yes, I know what the error means, but it's not something I interact with directly. I'm not deliberately passing anything to this method - it will all be done under the hood by the framework. That parameter is not something that I've set in any config. Also, how come it works locally with exactly the same settings? – musoNic80 Dec 23 '13 at 17:17
  • @musoNic80 I've updated with a link to the configuration, as to why it's different on your dev vs production is difficult to answer as it could be any small variation in the PHP env – AlexP Dec 23 '13 at 17:33
  • Thanks AlexP, I've set that config option manually but I'm still getting the same error... – musoNic80 Dec 23 '13 at 19:49