500 ISE after upgrade.

Version 5.13.19

Environment - Apache/MariaDB container with manual install

Checklist

  • Can you replicate the issue on our v5 demo site https://demo.invoiceninja.com or Invoice Ninja? NO
  • Have you searched existing issues? YES
  • Have you inspected the logs in storage/logs/laravel.log for any errors? YES

Describe the bug

Attempted to use the webui to do an upgrade. App froze and didn’t return, I gave it some time and eventually rebooted the container.
500 ISE when attempting to login.
When running php artisan migrate:
INFO Running migrations.
2024_08_04_225558_tax_model_migration_v2 … 8.72ms FAIL
In TaxModel.php line 343:
Attempt to modify property “subregions” on null

Steps To Reproduce

Try to login or try to run php artisan migrate from command line.

Expected Behavior

Working service with no errors.

Additional context

none

Screenshots

none

Logs

[2026-04-24 15:48:25] 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 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php:46)
[previous exception] [object] (Error(code: 0): Call to undefined function Illuminate\Support\array_first() at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Support/Fluent.php:306)
[2026-04-24 15:51:06] production.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘ninja.passkey_credentials’ doesn’t exist (Connection: mysql, Host: localhost, Port: 3306, Database: ninja, SQL: select * from passkey_credentials where passkey_credentials.user_id in (1)) {“exception”:”[object] (Illuminate\Database\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘ninja.passkey_credentials’ doesn’t exist (Connection: mysql, Host: localhost, Port: 3306, Database: ninja, SQL: select * from passkey_credentials where passkey_credentials.user_id in (1)) at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:838)
[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘ninja.passkey_credentials’ doesn’t exist at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:420)
[2026-04-24 16:00:03] production.ERROR: Call to undefined function App\Jobs\Util\nrlog() {“exception”:“[object] (Error(code: 0): Call to undefined function App\Jobs\Util\nrlog() at /var/www/invoiceninja/app/Jobs/Util/ReminderJob.php:58)
[2026-04-24 16:38:03] production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e_invoice_quota’ in ‘where clause’ (Connection: mysql, Host: localhost, Port: 3306, Database: ninja, SQL: select * from accounts where e_invoice_quota > 0 and exists (select * from companies where accounts.id = companies.account_id and legal_entity_id is not null)) {“exception”:”[object] (Illuminate\Database\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e_invoice_quota’ in ‘where clause’ (Connection: mysql, Host: localhost, Port: 3306, Database: ninja, SQL: select * from accounts where e_invoice_quota > 0 and exists (select * from companies where accounts.id = companies.account_id and legal_entity_id is not null)) at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:838)

Those are some of the errors that are present in the log after the upgrade was attempted. They have stacktrace info under them that I can provide if needed.

Hi,

I believe this error is being discussed here:

1 Like

That is correct @hillel ….. although the responses are a bit delayed and I’m wondering if there is some other place to go for faster support.

I suggest commenting there so the backend devs are aware that other people are seeing this problem.

1 Like

Thank you, I have done so.

I fixed the issue using Codex:
Steps taken to restore the Invoice Ninja installation

  • Found that the configured ninja database had empty core tables. The supplied ninja.sql dump contained the customer data, so it was imported into a separate database named ninja_restore.

  • Pointed Invoice Ninja’s .env configuration to ninja_restore and granted the MySQL user ninja access to that database.

  • Ran the pending migrations against ninja_restore. Some tables already existed but their migration records were missing, so those migrations initially failed with “table already exists.” The existing schemas were checked and the migration records were added so migration could continue.

  • Fixed a migration failure caused by the restored company’s older tax data. In app/DataMapper/Tax/TaxModel.php, the Singapore VAT-number assignment was guarded so it runs only when that subregion exists.

  • Fixed write access for the www-data user on Laravel’s storage/cache directories and cleared Laravel’s cached configuration and optimized files.

  • Restarted PHP-FPM and verified that the app runtime connected to ninja_restore and could see one user, one company, and one account.

  • Identified that the browser was reaching a different IP because local DNS pointed invoices.internal to the wrong address. Correcting DNS allowed you to log in.

The original ninja database was left separate; the working app now uses ninja_restore.

1 Like