V5.4.4 SQLError Unknown column 'set_react_as_default_ap' in 'field list'

Hi,

I had a couple issues upgrading to v5.4.4.

When I upgraded, i was shown a 500 error:
Trait ‘Awobaz\Compoships\Compoships’ not found

I checked the vendor folder and it seemed it missing quite a few packages? I have a feeling composer updates are not happening when updates are triggered.

I am using BlueHost Shared Hosting and using softalicious to install Invoice Ninja. After the 500 error I went into softalisious and forced an update to V5.4.4 which fixed the 500 error. So that Is no longer an issue (I hope)

I now however noticed I can not switch to the React App and am presented with an SQL Error:
Unknown column ‘set_react_as_default_ap’ in ‘field list’. Is this a new column added to the ‘accounts’ table? Can I just add this table manually? Is there likely other tables that where not updated? Is there a reason why my updates are not making changes to my database tables not composer? I expect it could be something to do with my hosting, but ideas of things to look at would be great.

Many thanks

Hi,

It may help to run php artisan migrate

Hi @hillel,

Thanks for quick reply. Can you confirm what this does? is it something that should have been run automatically when updating to 5.4.4 from (i think) ~5.3?

Thanks

It adds any changes to the database with the new release.

It should run automatically however if you install using Softaculous you need to use their update process.

Hi @hillel ,

Thanks for clarification. Does this apply to ALL updates that become available? eg should I never update via the ‘update’ prompts from within Invoice Ninja and ONLY update when an update is available via Softaculous?

I ran the command but got the following errors:

Migrating: 2022_05_30_184320_add_job_related_fields_to_schedulers_table

In Connection.php line 712:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near ‘json null’ at line 1 (SQL: alter t
able schedulers add action_name varchar(191) not null, add action_clas s varchar(191) not null, add parameters json null)

In Connection.php line 495:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near ‘json null’ at line 1

Any help appreciated

That’s correct. The update option should be hidden, we’ll work to correct it.

@david any thoughts on the error?

Ah many thanks @hillel!

@david I assume me running the updates not through softaculous may have been the cause of the other issues I was having (Recurring Invoice - Client email not sent - #21 by david) if certain databases changes where not taking affect during updates.

@hillel @david Seems Recurring Invoices have no ‘next send dates’ and if preview the settings, it says the next send for the schedule is todays date, which is incorrect. If I check the clients portal however, the recurring invoice Next Send date is correct.

Don’t know if this helps narrow down what could be going on here or how to resolve?
Thanks

@carter-hosting

There is a small bug in the migration from v4 to v5 in regards to next send dates. I am tagging a new v5 release with a fix for this.

The solution to correct this would be to manually sent the next send date on the recurring invoices, or, wait for the next release and then remigrate.

Thanks @david

Is this bug to do with the SQL errors I got when migrating? (V5.4.4 SQLError Unknown column 'set_react_as_default_ap' in 'field list' - #5 by carter-hosting - Self-Hosted | v5 - Discourse)

And I am also getting an error 500 when trying to generate a PDF invoice, is this also related?

Many thanks

@carter-hosting

It looks like you have a lot of migrations which have not run on your system. Can you try running /update?secret=secret this will attempt to run the migrations missing on your system.

I would say this is the most likely culprit

Hi @david ,

I assumed you meant run that as a url query? I ran it but it doesn’t appear to have made a difference, still getting errors in quite a few places. Im pretty sure it is an issue with migrations not having run as I have been updating invoiveNina though the in-app prompts rather than through softaculous :grimacing: Which I didn’t realise is something I shouldn’t be doing.

Is there anything else I can do to force the migrations to run or any other recommendations?

EDIT
Not sure if it perhaps is something with the softaculuos version specifically? I just tried a new install on separate subdomain but softaculous fails to install v5 with an sql error. Hope this might help.

Many thanks

@carter-hosting

If you are able to get to the command line, try and run

php artisan migrate

Hi @david ,

I ran that command in a previous comment and got an error. I tried running it again and got the same error:

Migrating: 2022_05_30_184320_add_job_related_fields_to_schedulers_table

In Connection.php line 712:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near ‘json null’ at line 1 (SQL: alter t
able schedulers add action_name varchar(191) not null, add action_clas s varchar(191) not null, add parameters json null)

In Connection.php line 495:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near ‘json null’ at line 1

@carter-hosting

I understand the issue here. You’ll need to download the latest release file and overwrite your current installation. There was an issue with the migration in that particular version which we later corrected with json columns.

After you overwrite the files, the migration will complete correctly.

Hi @david,

This seems to have fixed all the errors after updating to the latest release through softaculous.

Still having the issue here though.

I will mark your last message as the solution to this ticket and tag you again in the other ticket regarding the client email issues.

Many thanks!