500 Error /api/v2/system/environment

I have a new Bitnami Dreamfactory virtual machine. I’ve recreated the VM a couple of time now and have had the same issue. The VM runs fine for some period of time (hours not days) and then I suddenly start getting a “white” screen. It appears to coincide with a session timeout. I say that only because it happened when I left DreamFactory open without using it and then I’m auto logged out. After digging through the logs, I found that I’m getting a 500 error.

192.168.1.35 - - [11/Oct/2015:15:57:05 +0000] “GET /api/v2/system/environment HTTP/1.1” 500 4519

I saw another post indicating a similar issue. The suggested resolution was to change permissions, but I’m not sure which folder to change.

Thanks,
Craig

1 Like

Make sure webserver has read/write permissions to storage/ and bootstrap/cache/ directories.

I finally think I tracked this down. When I looked deeper at the error I got from /api/v2/system/environment, I noticed that there was a reference to /opt/bitnami/apps/dreamfactory/htdocs/storage/framework/cache. When I went to that directory, I discovered that some of the subdirectories of that folder had root:root permissions. I ran sudo chown -R daemon:daemon * and lo and behold the site fired back up. I’m not sure what created the root:root permissions.

I’ll continue to monitor as I test and see if it comes back or if it was a problem with the bitnami image to start with.

1 Like

I’m getting the exact same error, but immediately after installing from github. I cloned the repository, checked out the 2.0.1 version, and followed the instructions in the README.md file. After a variety of issues, I got what appears to be a clean install with postgres as the database, and apache as the web server, remembering to set the permissions and ownership of the recommended directories. In desperation, I even tried setting the entire /opt/dreamfactory directory to the same ownership and permissions, but to no avail.

I get the same 500 server error on the same url. When I run the url via ‘curl’, I get the following:

{
   "error" : {
      "message" : "Unexpected data found.\nUnexpected data found.\nUnexpected data found.\nData missing",
      "trace" : [
         "0 /opt/dreamfactory/bootstrap/cache/compiled.php(11003): Carbon\\Carbon::createFromFormat('Y-m-d H:i:s', '19-NOV-15 17:04...')",
         "1 /opt/dreamfactory/bootstrap/cache/compiled.php(10793): Illuminate\\Database\\Eloquent\\Model->asDateTime('19-NOV-15 17:04...')",
         "2 /opt/dreamfactory/vendor/dreamfactory/df-core/src/Models/BaseModel.php(1211): Illuminate\\Database\\Eloquent\\Model->attributesToArray()",
         "3 /opt/dreamfactory/bootstrap/cache/compiled.php(10783): DreamFactory\\Core\\Models\\BaseModel->attributesToArray()",
         "4 /opt/dreamfactory/bootstrap/cache/compiled.php(12419): Illuminate\\Database\\Eloquent\\Model->toArray()",
         "5 [internal function]: Illuminate\\Support\\Collection->Illuminate\\Support\\{closure}(Object(DreamFactory\\Core\\Models\\SystemResource))",
         "6 /opt/dreamfactory/bootstrap/cache/compiled.php(12420): array_map(Object(Closure), Array)",
         "7 /opt/dreamfactory/vendor/dreamfactory/df-core/src/Services/System.php(17): Illuminate\\Support\\Collection->toArray()",
         "8 /opt/dreamfactory/vendor/dreamfactory/df-core/src/Components/RestHandler.php(170): DreamFactory\\Core\\Services\\System->getResources(true)",
         "9 /opt/dreamfactory/vendor/dreamfactory/df-core/src/Services/BaseRestService.php(65): DreamFactory\\Core\\Components\\RestHandler->handleRequest(Object(DreamFactory\\Core\\Utility\\ServiceRequest), 'environment')",
         "10 /opt/dreamfactory/vendor/dreamfactory/df-core/src/Utility/ServiceHandler.php(57): DreamFactory\\Core\\Services\\BaseRestService->handleRequest(Object(DreamFactory\\Core\\Utility\\ServiceRequest), 'environment')",
         "11 /opt/dreamfactory/bootstrap/cache/compiled.php(17588): DreamFactory\\Core\\Utility\\ServiceHandler::processRequest('v2', 'system', 'environment')",
         "12 /opt/dreamfactory/bootstrap/cache/compiled.php(17553): DreamFactory\\Http\\Controllers\\RestController->handleService('v2', 'system', 'environment')",
         "13 [internal function]: DreamFactory\\Http\\Controllers\\RestController->handleGET('v2', 'system', 'environment')",
         "14 /opt/dreamfactory/bootstrap/cache/compiled.php(8842): call_user_func_array(Array, Array)",
         "15 /opt/dreamfactory/bootstrap/cache/compiled.php(8911): Illuminate\\Routing\\Controller->callAction('handleGET', Array)",
         "16 /opt/dreamfactory/bootstrap/cache/compiled.php(8891): Illuminate\\Routing\\ControllerDispatcher->call(Object(DreamFactory\\Http\\Controllers\\RestController), Object(Illuminate\\Routing\\Route), 'handleGET')",
         "17 [internal function]: Illuminate\\Routing\\ControllerDispatcher->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))",
         "18 /opt/dreamfactory/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
         "19 /opt/dreamfactory/bootstrap/cache/compiled.php(17843): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "20 [internal function]: DreamFactory\\Http\\Middleware\\AccessCheck->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "21 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "22 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "23 /opt/dreamfactory/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
         "24 /opt/dreamfactory/bootstrap/cache/compiled.php(8892): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
         "25 /opt/dreamfactory/bootstrap/cache/compiled.php(8877): Illuminate\\Routing\\ControllerDispatcher->callWithinStack(Object(DreamFactory\\Http\\Controllers\\RestController), Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request), 'handleGET')",
         "26 /opt/dreamfactory/bootstrap/cache/compiled.php(7831): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request), 'DreamFactory\\Ht...', 'handleGET')",
         "27 /opt/dreamfactory/bootstrap/cache/compiled.php(7802): Illuminate\\Routing\\Route->runWithCustomDispatcher(Object(Illuminate\\Http\\Request))",
         "28 /opt/dreamfactory/bootstrap/cache/compiled.php(7455): Illuminate\\Routing\\Route->run(Object(Illuminate\\Http\\Request))",
         "29 [internal function]: Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))",
         "30 /opt/dreamfactory/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
         "31 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "32 /opt/dreamfactory/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
         "33 /opt/dreamfactory/bootstrap/cache/compiled.php(7456): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
         "34 /opt/dreamfactory/bootstrap/cache/compiled.php(7444): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))",
         "35 /opt/dreamfactory/bootstrap/cache/compiled.php(7429): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))",
         "36 /opt/dreamfactory/bootstrap/cache/compiled.php(2304): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))",
         "37 [internal function]: Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))",
         "38 /opt/dreamfactory/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
         "39 /opt/dreamfactory/vendor/barryvdh/laravel-cors/src/HandleCors.php(43): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "40 [internal function]: Barryvdh\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "41 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "42 /opt/dreamfactory/bootstrap/cache/compiled.php(17932): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "43 [internal function]: DreamFactory\\Http\\Middleware\\FirstUserCheck->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "44 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "45 /opt/dreamfactory/bootstrap/cache/compiled.php(12881): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "46 [internal function]: Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "47 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "48 /opt/dreamfactory/bootstrap/cache/compiled.php(11504): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "49 [internal function]: Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "50 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "51 /opt/dreamfactory/bootstrap/cache/compiled.php(12622): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "52 [internal function]: Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "53 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "54 /opt/dreamfactory/bootstrap/cache/compiled.php(12561): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "55 [internal function]: Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "56 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "57 /opt/dreamfactory/bootstrap/cache/compiled.php(2978): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "58 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
         "59 /opt/dreamfactory/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)",
         "60 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
         "61 /opt/dreamfactory/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
         "62 /opt/dreamfactory/bootstrap/cache/compiled.php(2251): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
         "63 /opt/dreamfactory/bootstrap/cache/compiled.php(2234): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))",
         "64 /opt/dreamfactory/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))",
         "65 {main}"
      ],
      "context" : null,
      "code" : 500
   }
}

Since it doesn’t appear to be a permissions issue in my case, I’m stuck as to what to try next.

Any suggestions?

Thanks!

I am having the same issue. Did you find a solution to this? Thanks. Rajiv

chmod -R 2777 storage/ bootstrap/cache/

ok - I changed the permission to the above and it seems to work (for now).

I know this a old but I ran into this error when using Nginx

Make sure you edit your nginx.conf snginx.conf files according to
https://wiki.dreamfactory.com/DreamFactory/Installation/Linux/Apt

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /path/to/dreamfactory/public;
    index index.php index.html index.htm;

    server_name server_domain_name_or_IP;
   
    gzip on;
    gzip_disable "msie6";
   
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; 

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

For php 7.0
replace with
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;