Unable to install v5

I wiped out the entire directory of the latest version and I recreated the directory with the 5.3.17 zip file. After I dumped in the 5.3.17 zip, I changed ownership of the directory to www-data:www:data, ran php7.4 artisan generate:key and optimize. I am no longer getting the 500 error, but now when I am running the setup again, it still gives me the original issue in the screenshot of the original post. I wonder if there is a dependency which has been updated in Ubuntu and is breaking something.

Laravel.log again says
[2021-10-21 19:56:44] production.INFO: db fails

I don’t see anything in the nginx error logs either. here is the access log during the request, does not look like anything useful here:

10.1.254.254 - - [21/Oct/2021:19:56:44 +0000] “GET / HTTP/1.1” 302 410 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0”
10.1.254.254 - - [21/Oct/2021:19:56:44 +0000] “GET /setup HTTP/1.1” 200 3858 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0”
10.1.254.254 - - [21/Oct/2021:19:56:45 +0000] “GET /js/app.js HTTP/1.1” 200 9877 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0”
10.1.254.254 - - [21/Oct/2021:19:56:45 +0000] “GET /css/app.css HTTP/1.1” 200 34582 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0”
10.1.254.254 - - [21/Oct/2021:19:56:45 +0000] “GET /js/setup/setup.js HTTP/1.1” 200 7635 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0”

from the command line run

php artisan migrate --seed

I think the issue here is you are creating the .env before the setup. This would mean the defaults in the new .env are overriding what the app is expecting initially.

I believe there was a .env file was extracted from the zip. This is the result when I ran the above command (using php7.4:)

myusername@ninja:/usr/share/nginx/invoiceninja$ sudo php7.4 artisan migrate --seed
[sudo] password for myusername:


  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes

In Connection.php line 692:

SQLSTATE[HY000] [1045] Access denied for user ‘ninja’@‘localhost’ (using password: YES) (SQL: select * from information_schema.tables where table_schema =
ninja and table_name = accounts and table_type = ‘BASE TABLE’)

In Connector.php line 70:

SQLSTATE[HY000] [1045] Access denied for user ‘ninja’@‘localhost’ (using password: YES)

Do I need to specify the database information in the .env before trying to start setup?

I was able to seed the database after specifying the database and credentials. I don’t know if I missed it somewhere, but I don’t recall seeing that in the instructions I was using. I will see if I can move forward now.

After this, I got a 500 error, and when I checked the laravel log, it gave me a permission denied writing inside /storage. I believe I had it www-data:www-data 755. I set permissions to 777 to test, and now suddenly I am getting the login screen and I am no longer seeing the setup. I set to 775 and I get the error again. It seems if I don’t have world set for rwx, I am getting the 500 error. It looks like I am making progress, but this configuration seems to me like a possible security issue.

I now have an instance where I can at least log in to v5. I tried a migration, and I got a “Whoops, something went wrong” error. I will now work through the troubleshooting guide for migration. I’m still concerned with the storage needing to be world writable.

Just to keep this updated, I believe I am seeing the issue in this thread now:

My old system was installed from a Turnkey linux image, and it appears to not have php-zip extension. I have installed the extension:

apt-get install php-zip
this required restart of apache:
service apache2 restart

I am now getting a new error. "Oops, something went wrong. Migration can’t be processed at the moment. Please checks the logs. "

Logs look like the same error in the laravel logs. I then installed the php-zip package on the new server, then I restarted both servers, and the migration appears to have started after trying again.

I have successfully migrated. That was a few hoops to jump through, especially trying to get all the snappdf dependencies set, but I was very happy with 4.5 until phantompdf quit working.

for anyone else trying this, I had to check the laravel log file, and reference the missing library each time PDF generation failed and add libraries. I used this list:

I suppose you could just add all of the libraries in the list, but I did one at a time so as to not install any extra items which may be unnnecessary on my system.

Next up is to get email working. I will stop updating this topic unless I can help someone else troubleshoot.

OK. So just install that big list of dependancies using apt and good to go? Simple as that?

Where are the laravel logs?

Nothing noteworthy in the laravel logs for me.

Had some success though.

Installed all the dependencies in that list for snappdf and the PDF test worked!

sudo apt install ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils libgbm-dev libxshmfence-dev

The database test went fine. I’m now stuck on the email test. The settings I have input for my SMTP server are correct but the test is failing.

Great. I had issues with smtp, but it was because of a typo. I don’t know anything about your intended mail setup, but if you use TLS, it’s usually port 587.

Are you trying to install fresh, or migrate from version 4.5?

It’s Office365 direct send.

It’s always the same. domain-com.mail.protection.outlook.com, port 25, TLS optional. No user or password to login as it only allow requests from my public IP to send mail.

Using the same settings on a bunch of other services no problem.

It’s a fresh install.

Ok, if you’re using O365, I would at least try it with TLS, port 587, and log in with some credentials. In my experience it’s more likely to work, and you can change/troubleshoot it later. I used to do more google, so I don’t have a ton of experience lately with Microsoft’s SMTP though.

OK. Thanks. I will have a play with it.

These are the settings from the docs that I always use. I have some entries in my public DNS and also on the exchange server for it to work. I use these settings successfully with other stuff.

I was just going to post that webpage. Do the first option.

Sorry, I was being a div. It’s not the direct send option I use. It’s option 3, the connector option. The settings are the same though.

I tried the first option but had no luck. I think it’s because of 2FA on my login.

I think I need to double-check my connector settings on the exchange server.

Starting to think this may be a limitation of Invoice Ninja itself. Not sure.

It doesn’t seem to even try and send an email unless a username and password are entered. But with the connector setup I have always used, you don’t use a username or password.

OK. I’m in.

I couldn’t get the SMTP test to pass. I just selected “Log” and I’m on the dashboard. Hoping I can figure out how to reconifgure the email settings for my setup later.

Maybe this will help: