Sonataadminbundle: Getting error 500 in prod but not in dev

Created on 14 Mar 2018  路  6Comments  路  Source: sonata-project/SonataAdminBundle

Environment

Debian 9

Sonata packages

sonata-project/admin-bundle              3.33.0
sonata-project/block-bundle              3.12.1
sonata-project/cache                     1.0.7
sonata-project/core-bundle               3.9.1
sonata-project/datagrid-bundle           2.3.1
sonata-project/doctrine-orm-admin-bundle 3.4.2
sonata-project/exporter                  1.8.0 

Symfony packages

symfony/assetic-bundle     v2.8.2 v2.8.2
symfony/monolog-bundle     v3.2.0
symfony/phpunit-bridge     v3.4.6
symfony/polyfill-apcu      v1.7.0
symfony/polyfill-intl-icu  v1.7.0
symfony/polyfill-mbstring  v1.7.0
symfony/polyfill-php56     v1.7.0
symfony/polyfill-php70     v1.7.0
symfony/polyfill-util      v1.7.0
symfony/security-acl       v3.0.1
symfony/swiftmailer-bundle v2.6.7
symfony/symfony            v3.4.6

PHP version

php 7.0.27

I'm using sonata admin for managing some entities, all of them work great apart one. When i'm on the prod server in the prod environment (export SYMFONY_ENV=prod) and try to get the list of all rows, I get an error 500 with no further informations. But when i switch to the dev server or even to the app_dev.php environment on the prod server all is normal and functionning.

I only get this error with that one entity and since this week.

Do you know a way I can handle it ? Maybe roll back to an ancient version of sonata ?

Most helpful comment

Based on your error it seems that you have a problem with file permissions for your symfony application, check this and it should work after. Closing as not connected to sonata.

All 6 comments

Can you check your logs and give stack trace of the error?

Sorry but I'm a beginner and I don't know where to get them. If it's the /project/var/logs/prod.log you're asking, the last entry here is :
"Unable to write to the "/var/www/html/project/var/cache/prod" directory." at /var/www/html/project/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php line 681

I already handled that error with a chmod -R 777 on the project dir

Based on your error it seems that you have a problem with file permissions for your symfony application, check this and it should work after. Closing as not connected to sonata.

I already handled that error but i still get the http 500

Clear the cache and try again, if you still get the error, check your logs again and see if there is some other error.

I rewrited the ACL permissions, rebooted the serv and cache:clear. All is functionnal now. Thank you

Was this page helpful?
0 / 5 - 0 ratings