After Update from 5.3.10 to 5.3.15 I get 500:Server error on login

I just had the same issue pop up from .10 to .16 and ran the “sudo -u www-data php artisan migrate --force”

This fixed the 500 error.

Switching to SnapPDF fixed the issues for me, but getting that to work was not trivial. I had to manually run some things in /vendor.

where do i get the API from?

@hillel do you have any idea what I could try after my last post? Seems to be a db issue. At this point I have re-uploaded all new/fresh files, and we’ve done the commands listed above, but the install is dead in the water. Pretty glad I haven’t migrated to using this yet. Shocked an update would kill it like this.

i guess i have to START OVER FROM SCRATCH AGAIN…

If you’re still seeing “Base table or view not found” it strongly implies a migration hasn’t been run.
You can compare the contents of the database/migrations folder to the contents of the migration table to check if any are missing.

@david do you have any other ideas?

I was having problems with a server 500 error on 5.3.10 when I tried to edit client details showing on invoices but otherwise it was working - I checked and found that there was n update to 5.3.16 but I had to force the update to get it to download. Now I can’t login and I get a server 500 error

I’ve tried the

php artisan optimize
php artisan migrate --force

but all I get on the CLI is

In 2021_09_08_115919_update_designs.php line 5:

Cannot declare class UpdateDesigns, because the name is already in use

Laravel.log has the following

[2021-09-21 19:25:57] production.ERROR: Cannot declare class UpdateDesigns, because the name is already in use {“exception”:"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Cannot declare class UpdateDesigns, because the name is already in use at /invoice/database/migrations/2021_09_08_115919_update_designs.php:5)
[stacktrace]
#0 {main}
"}

So my install is broken :slight_smile: ideas welcome

@BBComputing

I would suggest downloading this package

https://github.com/invoiceninja/invoiceninja/releases/download/v5.3.16/invoiceninja.zip

Then backup your .env file and overwrite your existing files with the one in this package.

Then attempt

php artisan migrate

if that is successful, then run /update?secret=

1 Like

Thanks @david that worked for me in an upgrade from 5.3.10 to 5.3.16.

  1. downloading package
    https://github.com/invoiceninja/invoiceninja/releases/download/v5.3.16/invoiceninja.zip

  2. Move old install to new location

  3. extract above file

  4. copy put my existing .env file into a new extract of the above ZIP package

  5. run following commands

php artisan migrate
php artisan optimize

  1. open the site URL with /update?secret=

One KEY additional STEP

  1. copy the contents of /public/storage from your old install to the new install
    otherwise you get a pile of not particularly obvious errors on trying to generate PDFs

The clue I got to fixing this was looking at laravel.log where it said …

[2021-09-21 22:40:27] production.ERROR: file_get_contents(https://invoice//storage/76alNMIDOPei96wipCBWVzCB5KC8XRXX/WY8X1e0UFB5zVu6GxFdFaN1Jcfcp9LAe42UVjx9w.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
{“exception”:"[object] (ErrorException(code: 0): file_get_contents(https://invoice//storage/76alNMIDOPei96wipCBWVzCB5KC8XRXX/WY8X1e0UFB5zVu6GxFdFaN1Jcfcp9LAe42UVjx9w.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
at /invoice/app/Models/Presenters/CompanyPresenter.php:69)

[Above edited to remove details specific to my site]

@n03lm

Thanks for letting us know, we’ll mark this as the solution.

@david have edited above to make marginally more explicit the steps if not reading whole thread and add important additional step about public/storage

Seems to work now! Thank you @david

Tried all of that and nothing works.
Reupload all the files expect the .env file still 500 error at my login page.

laravel.log says:

[2021-09-24 06:14:47] production.ERROR: Class 'Illuminate\Routing\RouteGroup' not found {"exception":"[object] (Error(code: 0): Class 'Illuminate\\Routing\\RouteGroup' not found at /www/htdocs/XXXXXXX/invoice/v5/vendor/laravel/framework/src/Illuminate/Routing/Router.php:411)

[stacktrace]

@david as many people seem to have problems with updates recently (I didn’t update yet, I’m still on v5.3.8-C58): Would it make sense to implement an auto backup to IN? An automated daily database backup for example?

So anyone know how to get the 500 error fixed?

You can use external services for that, if that helps. Personally I use UpdraftPlus on a WP install on the same server to backup my IN database once an hour and then sends it to the cloud, so if anything goes terribly wrong all of my data can be reverted back, on the same install or on a different server, and I will have lost at most one hour of entries.

That being said, the IN installation is completely independent from the database, so you can mess all you want with updates and installs - heck you can delete everything and start over with a clean install (make sure to backup the public/storage directory first, that’s where the uploads and generated invoices are), as long as you just relink the new installation to the database, you’ll get back to where you left. So don’t worry about breaking anything with updates - you can always revert back to a previous version, do a clean install, and just point IN to your database and voilà. Source: I did it several times :wink:

2 Likes

What error are you seeing in storage/logs