Error 500 after upgrade

I went ahead and tried to upgrade from 2.4.9 to the latest version, and I’m getting Error 500 on trying to load any pages on the invoicing site.

Apache logs don’t appear to be showing anything under /var/apache2/error.log

Should I just try a clean install? No idea what’s causing the issue here after trying to copy over all the files as the instructions state on the installation page.

Please check storage/logs/laravel.log for details about the error.

Here’s an excerpt. Last few lines from the log.

{“context”:“PHP”,“user_id”:“1”,“account_id”:“1”,“user_name”:“Username”,“method”:“POST”,“url”:“http://url/public/setup",“user_agent”:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36”,“ip”:“173.56.112.227”,“count”:8}
[2016-01-22 21:06:42] production.ERROR: Email Error: Expected response code 220 but got code “”, with message “”
{“context”:“PHP”,“user_id”:“1”,“account_id”:“1”,“user_name”:“Username”,“method”:“POST”,“url”:“http://url/public/setup",“user_agent”:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36”,“ip”:“173.56.112.227”,“count”:8}
[2016-03-31 18:46:00] production.ERROR: PhantomJSCloud - failed to create pdf:

502 Server Error

Error: Server Error
The server encountered a temporary error and could not complete your request.Please try again in 30 seconds.

{“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“url”:“http://invoices.cursivebytes.com/public/complete",“user_agent”:"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36”,“ip”:“174.113.91.142”,“count”:1}

Thoughts? PHP isn’t seeing the server?

Two suggestions:

  • Try loading /public/update to make sure the update can complete successfully
  • Set APP_DEBUG to true in the .env file to show errors on the screen

I think I figured it out. The issue I think is that I didn’t properly chown all the directories over and set permissions properly. I had to reinstall for a separate reason but I think that was the problem all along.

I’m having the same error 500 problem when upgrading from 2.4.9 to 2.5.1.3.

I have made sure that all of the permissions are set to 755 and owned by www-data:www-data.
I have tried reinstalling php5-fpm and php5-mysql.

Here are the applicable contents of /storage/logs/laravel.log:
[2016-04-25 17:54:33] production.ERROR: exception ‘PDOException’ with message ‘could not find driver’ in /home/nate/snaptek/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
Stack trace:
#0 /home/nate/snaptek/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct(‘mysql:host=loca…’, ‘ininjauser’, ‘********’, Array)
#1 /home/nate/snaptek/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection(‘mysql:host=loca…’, Array, Array)
#2 /home/nate/snaptek/vendor/compiled.php(10992): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 /home/nate/snaptek/vendor/compiled.php(10988): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)
#4 /home/nate/snaptek/vendor/compiled.php(10904): Illuminate\Database\Connectors\ConnectionFactory->make(Array, ‘mysql’)
#5 /home/nate/snaptek/vendor/compiled.php(10859): Illuminate\Database\DatabaseManager->makeConnection(‘mysql’)
#6 /home/nate/snaptek/vendor/compiled.php(10737): Illuminate\Database\DatabaseManager->connection(NULL)
#7 /home/nate/snaptek/vendor/compiled.php(10724): Illuminate\Database\Eloquent\Model::resolveConnection(NULL)
#8 /home/nate/snaptek/vendor/compiled.php(10213): Illuminate\Database\Eloquent\Model->getConnection()
#9 /home/nate/snaptek/vendor/compiled.php(10190): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
#10 /home/nate/snaptek/vendor/compiled.php(10180): Illuminate\Database\Eloquent\Model->newQueryWithoutScopes()
#11 /home/nate/snaptek/vendor/compiled.php(745): Illuminate\Database\Eloquent\Model->newQuery()
#12 /home/nate/snaptek/vendor/compiled.php(476): Illuminate\Auth\EloquentUserProvider->retrieveByToken(‘1’, ‘ZbW4wBpa0qSY2nP…’)
#13 /home/nate/snaptek/vendor/compiled.php(452): Illuminate\Auth\Guard->getUserByRecaller(‘1|ZbW4wBpa0qSY2…’)
#14 /home/nate/snaptek/vendor/compiled.php(431): Illuminate\Auth\Guard->user()
#15 /home/nate/snaptek/vendor/compiled.php(435): Illuminate\Auth\Guard->check()
#16 /home/nate/snaptek/app/Http/Middleware/Authenticate.php(35): Illuminate\Auth\Guard->guest()
#17 /home/nate/snaptek/vendor/compiled.php(9236): App\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#18 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#19 /home/nate/snaptek/vendor/compiled.php(9227): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#20 /home/nate/snaptek/vendor/compiled.php(7220): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#21 /home/nate/snaptek/vendor/compiled.php(7209): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#22 /home/nate/snaptek/vendor/compiled.php(7194): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#23 /home/nate/snaptek/vendor/compiled.php(2040): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#24 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#25 /home/nate/snaptek/vendor/compiled.php(9244): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#26 /home/nate/snaptek/app/Http/Middleware/StartupCheck.php(43): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#27 /home/nate/snaptek/vendor/compiled.php(9236): app\Http\Middleware\StartupCheck->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /home/nate/snaptek/app/Http/Middleware/DuplicateSubmissionCheck.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#29 /home/nate/snaptek/vendor/compiled.php(9236): app\Http\Middleware\DuplicateSubmissionCheck->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 /home/nate/snaptek/vendor/compiled.php(2548): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#31 /home/nate/snaptek/app/Http/Middleware/VerifyCsrfToken.php(42): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 /home/nate/snaptek/vendor/compiled.php(9236): App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /home/nate/snaptek/vendor/compiled.php(12416): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#34 /home/nate/snaptek/vendor/compiled.php(9236): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /home/nate/snaptek/vendor/compiled.php(11106): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#36 /home/nate/snaptek/vendor/compiled.php(9236): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /home/nate/snaptek/vendor/compiled.php(12118): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#38 /home/nate/snaptek/vendor/compiled.php(9236): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /home/nate/snaptek/vendor/compiled.php(12066): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#40 /home/nate/snaptek/vendor/compiled.php(9236): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 /home/nate/snaptek/vendor/compiled.php(2589): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#42 /home/nate/snaptek/vendor/compiled.php(9236): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#44 /home/nate/snaptek/vendor/compiled.php(9227): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#45 /home/nate/snaptek/vendor/compiled.php(1996): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#46 /home/nate/snaptek/vendor/compiled.php(1983): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#47 /home/nate/snaptek/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#48 {main}

And here is /var/log/nginx/ininja.error.log:
2016/04/25 12:24:02 [error] 8534#8534: *31 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught exception ‘ReflectionException’ with message ‘Class log does not exist’ in /home/nate/snaptek/bootstrap/cache/compiled.php:1336
Stack trace:
#0 /home/nate/snaptek/bootstrap/cache/compiled.php(1336): ReflectionClass->__construct(‘log’)
#1 /home/nate/snaptek/bootstrap/cache/compiled.php(1290): Illuminate\Container\Container->build(‘log’, Array)
#2 /home/nate/snaptek/bootstrap/cache/compiled.php(1848): Illuminate\Container\Container->make(‘log’, Array)
#3 /home/nate/snaptek/bootstrap/cache/compiled.php(1391): Illuminate\Foundation\Application->make(‘Psr\Log\LoggerI…’)
#4 /home/nate/snaptek/bootstrap/cache/compiled.php(1368): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /home/nate/snaptek/bootstrap/cache/compiled.php(1354): Illuminate\Container\Container->getDependencies(Array, Array)
#6 /home/nate/snaptek/bootstrap/cache/compiled.php(1290): Illuminate\Container\Container->build(‘App\Exceptions\…’, Array)
#7 /home/nate/snaptek/boo” while reading response header from upstream, client: 10.1.10.14, server: invoice.snaptek.us, request: “GET /dashboard HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock:”, host: “invoice.snaptek.us

I think the important part of the error is ‘Class log does not exist’.

Please check your .env file for any values with spaces, you’ll need to change

KEY=some value

To

KEY=‘some value’

More info here: https://github.com/laravel/framework/issues/11715

Brilliant! Problem solved. Thanks Hillel.

For clarity, all keys in the .env file that have string values (as opposed to numberic, boolean, etc.) now require single quotes around them.