crater-invoice/crater

SQL Error after Updated from 4.0.2 to 6.0.2

tobax99 opened this issue · 4 comments

Steps to Reproduce:
First Login after Update to Login-Screen is working fine, afterwards endless loading loop. Via the Browser Dev Tools I saw the following Error - dont know if the update has finished...

"message": "SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "modules" does not exist\nLINE 1: select "name" from "modules" where "enabled" = $1\n ^ (SQL: select "name" from "modules" where "enabled" = 1)",
"exception": "Illuminate\Database\QueryException",

And the laravel-logs first entry:

[2023-03-04 14:26:48] production.ERROR: copy(/..path../httpdocs/crater/public/assets/img/PDF/org.invoice3.png): failed to open stream: No such file or directory {"userId":1,"exception":"[object] (ErrorException(code: 0): copy(/..path../httpdocs/crater/public/assets/img/PDF/org.invoice3.png): failed to open stream: No such file or directory at /..path../httpdocs/crater/database/migrations/2021_12_02_074516_migrate_templates_from_version_4.php:20)
[stacktrace]
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /..path../httpdocs/crater/database/migrations/2021_12_02_074516_migrate_templates_from_version_4.php(20): copy()

afterwards the same errors as displayed via browser dev tools:

2023-03-04 14:27:50] production.ERROR: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "modules" does not exist
LINE 1: select "name" from "modules" where "enabled" = $1
^ (SQL: select "name" from "modules" where "enabled" = 1) {"userId":1,"exception":"[object] (Illuminate\Database\QueryException(code: 42P01): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "modules" does not exist
LINE 1: select "name" from "modules" where "enabled" = $1
^ (SQL: select "name" from "modules" where "enabled" = 1) at /..path../httpdocs/crater/vendor/laravel/framework/src/Illuminate/Database/Connection.php:705)

Can you try running php artisan migrate on the root folder and see what happens?

Hi @mohitpanjwani i try to run it, but the same error occured:

image

Hi @mohitpanjwani i try to run it, but the same error occured:

image

Can you try to remove this migration file and rerun the command again?

Hi @mohitpanjwani - thank you for helping me, that worked! :)