InvoiceNinja V5 setup loop and 500 | Server Error

Hi,
I’m trying to install V5.0.18 from scratch with XAMPP 7.4.11
I tried also with previous V5 versions and always the same problem.

I cannot go beyond the setup page.
After I click the submit button i face an 500 | Server Error and when I remove the /setup from the link
The setup process starts again…

I had some problems regarding php and node commands not be recognized but this is not the case anymore.
Now if I open the apache error log I see the below.
[Fri Oct 16 15:05:35.172161 2020] [mpm_winnt:notice] [pid 7696:tid 624] AH00354: Child: Starting 150 worker threads.
[Fri Oct 16 15:36:12.697941 2020] [ssl:warn] [pid 9140:tid 612] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 16 15:36:12.722927 2020] [core:warn] [pid 9140:tid 612] AH00098: pid file C:/xampp7411/apache/logs/httpd.pid overwritten – Unclean shutdown of previous Apache run?
[Fri Oct 16 15:36:12.723926 2020] [ssl:warn] [pid 9140:tid 612] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 16 15:36:12.795885 2020] [mpm_winnt:notice] [pid 9140:tid 612] AH00455: Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.4.11 configured – resuming normal operations
[Fri Oct 16 15:36:12.795885 2020] [mpm_winnt:notice] [pid 9140:tid 612] AH00456: Apache Lounge VC15 Server built: Aug 4 2020 11:50:23
[Fri Oct 16 15:36:12.795885 2020] [core:notice] [pid 9140:tid 612] AH00094: Command line: ‘c:\xampp7411\apache\bin\httpd.exe -d C:/xampp7411/apache’
[Fri Oct 16 15:36:12.798884 2020] [mpm_winnt:notice] [pid 9140:tid 612] AH00418: Parent: Created child process 5688
[Fri Oct 16 15:36:13.057736 2020] [ssl:warn] [pid 5688:tid 624] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 16 15:36:13.080723 2020] [ssl:warn] [pid 5688:tid 624] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 16 15:36:13.097725 2020] [mpm_winnt:notice] [pid 5688:tid 624] AH00354: Child: Starting 150 worker threads.

Thank you.

Did you change the logs to www.example.com or is that what’s there?

Hi, I had a /setup page redirect to /setup 302 problem which was caused by a bad database. My solution was to drop the ninja db in mysql and recreate it as per the docs, then I was able to get to the login screen.

You’re errors suggest an ssl certificate error:

www.example.com:443:0 server certificate does NOT include an ID which matches the server name

Have you configured an SSL certificate in Apache for your domain in use or are you running xampp on localhost?

P.S You could test by disabling SSL in Apache config by allowing traffic over port 80. In your virtual host file comment out the <VirtualHost _default_:443> section and leave a basic http config:

<VirtualHost *:80>
   ServerName example.com
   DocumentRoot /var/www/web
</VirtualHost>

Then try again/check logs

1 Like

No this is how it shows on the error.log

I will try your suggestions and reply back the soonest.
Thank you!

Nothing…
Checked the db was fine, also I did the trick with the ssl and still 500 | Server Error.
Yes I am running it as localhost.

I’m trying since 5.0.17 and every time the same error, I even tried it on my host as I would do normally and nothing…

Those Apache logs show ssl errors or warnings to be more accurate but nothing that would cause a 500. You could disable ssl in xampp to stop the warnings in the logs or just ignore them.

Try clearing caches if you haven’t already, sometimes a 500 can be caused by the smallest things hanging around. cd to your invoice ninja directory and run:

sudo php artisan optimize

Then visit your url in a browser with this appended

http://your.url.com?clear_cache=true

This may clear the same caches I’m not entirely sure but it can’t hurt. Also I’d use an incognito browser window while you have the problem to rule out an error being cached. That run a few times with browser refreshes cleared a 500 for me once.

Then, if the problem still occurs check the following for clues:

  • Always have the console open while submitting forms in Ninja so you can monitor the logs for the cause of the 500 in the network tab.
  • Set debug to true in your .env file (in /invoiceninja) to enable the in browser debug bar - it was hit and miss for me whether it actually appeared but when it does it might give more clues.
  • Check your laravel.log file in /invoiceninja/storage/logs/ - This has given me some very helpful information.

Then check your normal linux logfiles:

  • syslog
  • apache logs
  • firewall logs (disable firewall to rule it out)
  • etc

It’s also worth taking a few minutes to check the documentation for each platform you are running (Apache, PHP, Distro) and see if there are debug modes you can enable. This will give you much more information in the logs to hopefully find the culprit.

Also read the guides by @TechnicallyComputers for your distro version as these have invaluable advice to get it running. I used bits from both of them to install on Debian. He also installed on VMs so the information might crossover to your setup:

Ubuntu
CentOS

1 Like

Hi again,
The machine I’m trying to make it work is a windows pc through xampp, and I’m unable to run such commands, or I do not know the correct way, since if I open the shell on xampp and run php artisan I get the
“Could not open input file: artisan” error, which I believe has something to do with laravel…

But! you suggestion regarding enabling the debug, was indeed very helpful.
I found out that the .env actually was using the default credentials db name, username etc as ninja…
So I manually entered the correct credentials of my DB and bypassed the 500 error.
Unfortunately only to come with a new one… 404
If I leave the below bold db name as is, I get the 404 error,
If I switched it to my actual db name, I get that my db is not configured…

APP_URL=http://localhost/ninja/

DB_CONNECTION=db-ninja-01
MULTI_DB_ENABLED=false

DB_HOST1=localhost
DB_DATABASE1=my actual db name
DB_USERNAME1= my user name
DB_PASSWORD1=my password
DB_PORT1=3306

C:\xampp\htdocs\ninja\vendor\laravel\framework\src\Illuminate\Database\ DatabaseManager.php (line 152)

  1. // connection configurations and get the configurations for the given name.
  2. // If the configuration doesn't exist, we'll throw an exception and bail.
  3. $connections = $this->app['config']['database.connections'];
  4. ``
  5. if (is_null($config = Arr::get($connections, $name))) {
  6. throw new InvalidArgumentException("Database connection [{$name}] not configured.");
  7. }
  8. ``
  9. return (new ConfigurationUrlParser)
  10. ->parseConfiguration($config);
  11. }

Good afternoon guys,

I have hit exactly the same issue on a clean install. I performed a clean install last week which worked, however this time round it failed twice already. I have enabled debug mode as suggested and the following is displayed in the browser:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘.accounts’ doesn’t exist (SQL: select * from accounts limit 1)

*Note: I changed the DB name to

I suspect the DB script did not execute to build the structure post the setup stage, as it returned to the setup page way too quickly. I then ran the setup a second time with everything the same, and low and behold there was a long pause after the submit was pressed. It actually worked and completed as expected.

I hope this will help anyone else hitting this.

Hi again,

It looks like the post altered some bits. The error should have looked like this:
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘my-db-name.accounts’ doesn’t exist (SQL: select * from accounts limit 1)

This will also occur if the mysql client is not installed.
Had this happen on an install I have when client was missing.