Error Creating Vendor & Updating Transactions

V 5.11.31
Self hosted Ubuntu 24.04
Just updated to v5.11.31 which I downloaded from GitHub. I untarred the file into the current installation directory but when i went to run sudo -u www-data composer install, result came back “Command not found”.
This essentially broke IN where it will not run so I went on with the next steps: sudo -u www-data php artisan migrate, this produced two errors - Duplicate column expense_mailbox_active when it went to alter the table ‘company’. Log file capture near the end of this post.
Lastly since it is still broken, I ran the final step: sudo -u www-data php artisan optimize. This worked without any errors. I rebooted the server & logged in & found what appeared to be everything still in place
Creating a new vendor however resulted in “something went wrong” in a red box at the top of the screen. The laravel log shows these two items below:

[2025-01-27 05:24:41] production.ERROR: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘expense_mailbox_active’ (Connection: mysql, SQL: alter table companies add expense_mailbox_active tinyint(1) not null default ‘0’) {“exception”:"[object] (Illuminate\Database\QueryException(code: 42S21): SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘expense_mailbox_active’ (Connection: mysql, SQL: alter table companies add expense_mailbox_active tinyint(1) not null default ‘0’) at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)

[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘routing_id’ in ‘field list’ at /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php:47)
Is there a straightforward fix?

Hi,

If you use the tar from GitHub you don’t need to use composer.

To fix the error you’ll need to comment out the parts of the migration file which has been run and then run php artisan migrate.

[quote="hillel, post:2, topic:2119

I am totally unfamiliar with the migration file being referred to or when found what to comment out. Sorry for being such a noob but didn’t think it would have cuased these issues upgrading to a minor release.

Are you able to run php artisan migrate from the command line? It will show the name of the file which needs to be updated.

It will run but develops big red error boxes. I thought the reference to Connection.php is the file that needed to have the line commented out but there are at least 18 different occurences of this file. Error is shown below

The file is shown in the screenshot, it’s located in database/migrations.

You’ll need to comment out the parts that have run and then re-run the migration.

Is “2023_12_10_110951_inbound_mail_parsing” what I should be looking for? If so, it does not exist.

Are you checking the database/migrations folder?

sorry, my fault. i ran a find / iname “2023_12_10_110951_inbound_mail_parsing.*” before my last post & Ubuntu could not find it. I now have the above referenced file open for editing. Comment out everything that is within the public function up()?

<?php 2 3 use Illuminate\Database\Migrations\Migration; 4 use Illuminate\Database\Schema\Blueprint; 5 use Illuminate\Support\Facades\Schema; 6 7 return new class extends Migration { 8 /** 9 * Run the migrations. 10 */ 11 public function up(): void 12 { 13 Schema::table('companies', function (Blueprint $table) { 14 $table->boolean("expense_mailbox_active")->default(false); 15 $table->string("expense_mailbox")->nullable(); 16 $table->boolean("inbound_mailbox_allow_company_users")->default(false); 17 $table->boolean("inbound_mailbox_allow_vendors")->default(false); 18 $table->boolean("inbound_mailbox_allow_clients")->default(false); 19 $table->boolean("inbound_mailbox_allow_unknown")->default(false); 20 $table->text("inbound_mailbox_whitelist")->nullable(); 21 Read File $table->text("inbound_mailbox_blacklist")->nullable();y ^/ Go To Line M-E Redo M-6 Copy 22 }); 23 } 24 25 /** 26 * Reverse the migrations.

Start with the expense_mailbox_active line which is mentioned in the error

I got that done now. Had to comment out all the lines in the file before php artisan migrate would run. Should I now uncomment all those lines & run it again or…should I just go ahead & run “sudo -u www-data php artisan optimize”?

Once the migration has run changes to the file don’t have an effect

Thank you for your help. All is corrected & running as expected.

Glad to hear it, thanks for the update!