Recommend best way to make InvoiceNinja upgrades sustainable self-hosted

Version 5.9.4 C160

Environment: Ubuntu Server - un-tared TAR file and set up directly on host OS

What is the recommended way to get InvoiceNinja running on a self-hosted system in such a way that future upgrades are not a complete disaster? Every time I try to upgrade everything goes horribly wrong. I saw there’s a new version but Force Update ends in an Error 500 followed by IN no longer working. I tried untar-ing the new tar file over all the old code files but that also failed spectacularly.

Is there some easy way to upgrade the software?

Hi,

The built-in updater works reliably however it can require a large amount of RAM (ie. 2GB). Manually copying the tar should work, are there details about the 500 error in /storage/logs?

This was developed by a community member, you may find it helpful.

Greetings! Thanks for the response. I was able to find the log file, pasted below. Also, when the site loads without having an existing user logged in, it presents a popup saying that I should refresh the application.




After this, the website becomes completely inaccessible.

Log file here:

Try running php artisan migrate

Instead of the ‘force upgrade’ button? Will php artisan migrate replace other upgrade methods?

This command should be auto-run as part of the upgrade, from the error it looks like it either failed to run or wasn’t run at all.

I just tried it from the CLI and got this:

It looks like a config issue with your server, here’s what ChatGPT suggest in case it’s helpful.

The Laravel error “could not find driver” typically means the required PHP database extension (like pdo_mysql or pdo_pgsql) is not installed or enabled on your server.

:wrench: Fix It Step-by-Step

1. Check your database connection in .env

Make sure your .env is configured correctly, e.g.:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_db
DB_USERNAME=your_user
DB_PASSWORD=your_pass

2. Install the required PHP PDO driver

Depending on your database:

  • For MySQL:

    sudo apt install php-mysql
    
  • For PostgreSQL:

    sudo apt install php-pgsql
    
  • For SQLite:

    sudo apt install php-sqlite3
    

On macOS (Homebrew):

brew install php

3. Restart your web server

sudo service apache2 restart
# or
sudo service php8.2-fpm restart
# or
sudo systemctl restart nginx

4. Check it’s enabled

Run this in the terminal:

php -m | grep pdo

You should see:

PDO
pdo_mysql   # or another depending on your DB

If you’re using Docker or Laravel Sail, let me know — the fix differs slightly.

Thanks for your help. I was able to fix Ubuntu Server. It had a package dependency problem. I did sudo apt remove php8.3-common, then did php apt install php8.3-common. That allowed `sudo apt get-update’ and ‘sudo apt upgrade’ to work again. Although, InvoiceNinja appears to be using PHP 8.2.x.

I then did /usr/share/nginx/invoiceninja and php artisan migrate. Its result is INFO Nothing to migrate.

Then I went into the InvoiceNinja GUI and performed the Force Update. It now shows Version 5.12.0-C174. It appears to be running the latest same version listed on GitHub.

There is a remaining oddity however:

  • Health Check → System health: PDF: Invoice Ninja Hosted PDF: shows the error [2025-06-07 21:02:27] production.ERROR: Call to undefined method Illuminate\Console\View\Components\Task::runTimeForHumans() {"userId":1,"exception":"[object] (Error(code: 0): Call to undefined method Illuminate\\Console\\View\\Components\\Task::runTimeForHumans() at /usr/share/nginx/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php:45).

I did have a problem in the past where PDF invoices could not be generated but that was resolved by some cosmic event that defies explanation.

Glad to hear it! I’m not sure about the last error, it may be a bug. I suggest asking in a discussion on GitHub.