dreamfactory icon indicating copy to clipboard operation
dreamfactory copied to clipboard

Error 500 after fresh install by script on Ubuntu server 22.04LTS

Open Pammetje opened this issue 1 year ago • 11 comments

The script installed with no errors or warnings (I chose option '0' install) After install when I connected to port 80 I get error 500

NGinx error output ->

[error] 663#663: *3 FastCGI sent in stderr: "PHP message: PHP Warning: require(/opt/dreamfactory/public/../vendor/autoload.php): Failed to open stream: No such file or directory in /opt/dreamfactory/public/index.php on line 24PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/opt/dreamfactory/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/dreamfactory/public/index.php:24 Stack trace: #0 {main} thrown in /opt/dreamfactory/public/index.php on line 24" while reading response header from upstream, client: x.x.x.x, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "x.x.x.x" m: No such file or directory in /opt/dreamfactory/public/index.

Pammetje avatar Dec 13 '23 14:12 Pammetje

Thanks for sending over the nginx error. This looks like something went wrong specifically in the UI installation/deployment of the installation.

Quickest/easiest thing to try here is just rerunning the installer with the "Run df frontend install" (option 8)

If that doesn't resolve, can you post the contents of your /opt/dreamfactory/public/ directory?

Additionally, there was a brief period of time recently where the installer was bugged, make sure you have the latest version of the repo/installer.

nicdavidson avatar Dec 18 '23 16:12 nicdavidson

Composer issue. Hot Fix - run sudo composer update inside /opt/dreamfactory - it recreates composer modules. Then, you must setup user and group manually or simply do it running the dfsetup.run again with option 7 to enforce setting (debug mode never skip the setting of permissions of existing folders at the end of installation).

OldaHorak avatar Dec 25 '23 16:12 OldaHorak

@OldaHorak I followed your instuction. I did a sudo composer update in /opt/dreamfactory, followed by running dfsetup with option 7. After that I rebooted the OS. I still get a error 500

Pammetje avatar Jan 08 '24 09:01 Pammetje

Additional info: This is in the NGINX error log:

2024/01/08 13:04:41 [error] 6677#6677: *7 FastCGI sent in stderr: "PHP message: PHP Warning: require(/opt/dreamfactory/public/../vendor/autoload.php): Fail ed to open stream: No such file or directory in /opt/dreamfactory/public/index.php on line 24PHP message: PHP Fatal error: Uncaught Error: Failed opening r equired '/opt/dreamfactory/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/dreamfactory/public/index.php:24 Stack trace: #0 {main} thrown in /opt/dreamfactory/public/index.php on line 24" while reading response header from upstream, client: SOURCEIP, server: , request: "GET / HT TP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "SERVERIP" l

Pammetje avatar Jan 08 '24 12:01 Pammetje

Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1 - yajra/laravel-oci8[v9.0.0, ..., 9.x-dev] require ext-oci8 >=3.0.1 -> it is missing from your system. Install or enable PHP's oci8 extension. - dreamfactory/df-oracledb 0.17.0 requires yajra/laravel-oci8 ^9.0 -> satisfiable by yajra/laravel-oci8[v9.0.0, ..., 9.x-dev]. - Root composer.json requires dreamfactory/df-oracledb ~0.17.0 -> satisfiable by dreamfactory/df-oracledb[0.17.0].

Pammetje avatar Jan 08 '24 12:01 Pammetje

@OldaHorak I followed your instuction. I did a sudo composer update in /opt/dreamfactory, followed by running dfsetup with option 7. After that I rebooted the OS. I still get a error 500

Please, check the user, group and permissions of the file(s), that can not be open to read as the error message says. The user, group and permissions can be set manually, if the option 7 does not set it. Next, some dependecies could be changed in actual vendor tree, that leads to error - I tried to install DF two weeks ago.

OldaHorak avatar Jan 08 '24 16:01 OldaHorak

Additional info: This is in the NGINX error log:

2024/01/08 13:04:41 [error] 6677#6677: *7 FastCGI sent in stderr: "PHP message: PHP Warning: require(/opt/dreamfactory/public/../vendor/autoload.php): Fail ed to open stream: No such file or directory in /opt/dreamfactory/public/index.php on line 24PHP message: PHP Fatal error: Uncaught Error: Failed opening r equired '/opt/dreamfactory/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/dreamfactory/public/index.php:24 Stack trace: #0 {main} thrown in /opt/dreamfactory/public/index.php on line 24" while reading response header from upstream, client: SOURCEIP, server: , request: "GET / HT TP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "SERVERIP" l

In addition to the permissions checks mentioned above, would also suggest going into your /opt/dreamfactory/ dir and running:

composer install --no-dev --ignore-platform-reqs --verbose php artisan df:env (and then following the prompts for localhost, 3306, database name, database user... php artisan df:setup (And then setting up the first admin user, which is what you'll use to login to the UI)

Don't forget to fix permissions:

sudo chown -R dreamfactory:dreamfactory storage/ boostrap/cache/ sudo chmod -R 2775 storage/ bootstrap/cache/

If you're still seeing an issue, does it work when you use the php dev server? Run:

php artisan serve

Then try to access on 127.0.0.1:8000

nicdavidson avatar Jan 08 '24 17:01 nicdavidson

@nicdavidson

That helped a lot, i can see the webinterface and the login screen, but it is not working yet The issue I now have is that I cannot login with the provided credentials

This is in the nginx error log:

2024/01/09 09:25:01 [error] 688#688: *41 FastCGI sent in stderr: "PHP message: REST Exception #401 > Invalid token: Token Signature could not be verified" while reading response header from upstream, client: CLIENTIP, server: , request: "GET /api/v2/system/environment HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "SERVERIP", referrer: "http://SERVERIP/"

Pammetje avatar Jan 09 '24 08:01 Pammetje

That is a really odd issue. I am guessing you don't have an APP_KEY in /opt/dreamfactory/.env?

cd into /opt/dreamfactory/ and run:

php artisan key:generate

that should generate the key and allow you to proceed with the login. You might need to dump your browser cache.

nicdavidson avatar Jan 09 '24 21:01 nicdavidson

@nicdavidson

I had to add the line APP_KEY to /opt/dreamfactory/.env first (in .env was only the license entry) After that I had to run php artisan key:generate in /opt/dreamfactory/

I can now succesfully login.

Thank you very much

Pammetje avatar Jan 10 '24 16:01 Pammetje

I am having similar issues, trying to install and older version 2.12.0-2. There are no errors and then the dreamfactory user takes over /opt/dreamfactory and hides or deletes it cause I cant find it. And that is the end of my installation. Cant cant access anything.

anywheresa avatar Feb 06 '24 12:02 anywheresa