Unable to install v5

I would like to migrate my existing 4.5 installation since phantomJS suddenly quit working on me, but I can’t even get to that point where I would start that migration. I was able to put the latest 4.5 build over the existing installation, so that side of things is ready.

I don’t know what I am doing wrong here. I have tried and tried to get past this. I first installed on an existing Ubuntu 20.04 with MariaDB/Apache2/php7.4 which is presently hosting other sites (but not my current invoice ninja,) so I figured my problem was possibly some sort of conflict with my server configuration for the other sites, so I reverted that back to the snapshot I made before making changes, then spun up a clean VM, installed Ubuntu 20.04 server, followed the instructions at Install Invoice Ninja v5 on Ubuntu 20.04 - #5 by invoicemastersteam - Self-Hosted | v5 - Discourse this time using nginx, and I am stuck in the exact same spot!

No errors in the nginx access or error logs for the site, laravel.log in the storage/logs lists this when the page is first loaded:
[2021-10-19 23:43:05] production.INFO: db fails
(I would expect that, because I haven’t yet specified the database.)

I am spinning up VMs on my own hardware, so I am certain that I have enough resources, etc.

Edit: I should add that I am attempting to install the 5.3.25 release from zip downloaded from github.

I am having the exact same issue. Clean install and can’t get past Test PDF

Update

I installed 5.3.17 over my current install (5.3.25). I only copied over the binaries. I was able to complete setup and get logged into Invoice Ninja. I then upgraded to 5.3.25 without issue.

You may get a 500 error after that. If so, just run https://yourURL/update?secret=

Then it should log you in

Good work! I will have to give it a shot. I gave up on it for the night.

I gave this a shot, but I am getting a 500 error. I can’t seem to see any extended error information. I tried to do the update secret thing, but I don’t know if I am supposed to specify something after “/update?secret=”

Are there any details about the error in storage/logs

This time there are events which I believe relate to the cron jobs. This time around with 5.3.17 I am repeatedly seeing
[2021-10-21 17:47:42] production.INFO: account table not found

@david @ben any ideas?

I saw that same issue about the tables. Did you just copy over the binaries? Not the full zip right?

I would check the contents of your .env file, you may have overwritten it.

Do I need to specify anything in the .env for a clean install? I am just trying to get a clean v5 started in order to migrate from 4.5 which is on a different server.

Edit: from what I understand, I need to get the V5 basic setup done and a user account with the same credentials as the admin in my v4.5 instance. This is where I am getting stuck.

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?