Something went wrong (since v5.9.2)

Since version 5.9.2, I have been having a ‘Something went wrong’ error on most pages, with the exception of the Dashboard. However, everything seems to be working fine. I’ve checked all logs and the only issue seems to be in the laravel log below. The same error shows for each day that I use InvoiceNinja. I did not have this problem prior to updating to v5.9.2.

Additionally, when I run health check, I see ‘Permissions: .laravel.log.swp is not writable’. I have followed instructions here to make sure that I have correct permissions, yet nothing changes.

It would seem that something is not able to write to the laravel logs, yet below is directly from said logs. What am I missing here? Could my config be pointing to the incorrect log location? Where else should I be looking?

[2024-06-13 14:51:18] production.ERROR: DateTimeZone::__construct(): Unknown or bad timezone (US/Eastern) {"userId":1,"exception":"[obj>
[stacktrace]
#0 /var/www/invoiceninja/app/Models/Company.php(936): DateTimeZone->__construct()
#1 /var/www/invoiceninja/app/Http/Controllers/PaymentController.php(158): App\\Models\\Company->utc_offset()
#2 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\PaymentController->
#3 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->
#4 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(21): Il>
#5 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingRoutingDispatcher.php(19): Sentry\\Lara>
#6 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(20): Se>
#7 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Sentry\\Laravel\\Tracing\\Routing\\TracingCont>
#8 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#9 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()
#10 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\>
#11 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(122): Illuminate\\Pipeline\\P>
#12 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(87): Illuminate\\Routing\\Mid>
#13 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\Throttle>
#14 /var/www/invoiceninja/app/Http/Middleware/QueryLogging.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\QueryLogging->hand>
#16 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\>
#17 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\Substitu>
#18 /var/www/invoiceninja/app/Http/Middleware/Locale.php(87): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Locale->handle()
#20 /var/www/invoiceninja/app/Http/Middleware/TokenAuth.php(102): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\TokenAuth->handle()
#22 /var/www/invoiceninja/app/Http/Middleware/SetDb.php(40): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#23 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SetDb->handle()
#24 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminat>
#25 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\\Pipeline\\Pipeline->then()
#26 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\\Routing\\Router->runRouteWithinS>
#27 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\\Routing\\Router->runRoute()
#28 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\\Routing\\Router->dispatchToRoute>
#29 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatc>
#30 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Ill>
#31 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\\Pipeline\\Pi>
#32 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestIpMiddle>
#33 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(31): Illuminate\\Pipeline\\Pipe>
#34 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestMiddlewa>
#35 /var/www/invoiceninja/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19>
#36 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackB>
#37 /var/www/invoiceninja/vendor/beyondcode/laravel-query-detector/src/QueryDetectorMiddleware.php(27): Illuminate\\Pipeline\\Pipeline->
#38 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BeyondCode\\QueryDetector\\QueryDetectorM>
#39 /var/www/invoiceninja/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illum>
#40 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Barryvdh\\Debugbar\\Middleware\\InjectDeb>
#41 /var/www/invoiceninja/app/Http/Middleware/Cors.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Cors->handle()
#43 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->
#44 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxie>
#45 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pip>
#46 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illumin>
#47 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\>
#48 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pip>
#49 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundatio>
#50 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\>
#51 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipe>
#52 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\>
#53 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): >
#54 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\>
#55 /var/www/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(87): Illuminate\\Pipeline\\Pipeline->I>
#56 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Tracing\\Middleware->han>
#57 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminat>
#58 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then>
#59 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel>
#60 /var/www/invoiceninja/public/index.php(56): Illuminate\\Foundation\\Http\\Kernel->handle()
#61 {main}
"}

Hi,

@david do you have any suggestions?

If you upgrade to 5.9.5 we rerun the timezone migrations should this error should disappear.

1 Like

@david What about the permission of the .laravel.log.swp error? Is that related or something else completely?

That is a swap file, most likely left after leaving the editor early / not cleanly. Not related to the app.

1 Like

@david I am on current (5.10.4) and am still seeing the same timezone error. I’m happy to post my logs if you want them, but they look very similar to above, just today’s date.

Can you inspect your timezones table in your database.

We have 2 migrations that should have run an update on this table to remove some timezone names which are no longer compatible in php8.2

Your DB should look like this now:

Yes, that is what my timezones table looks like. I’m using php8.3, so that should not be a problem.

Edit: When I go into both the web UI and into the IN desktop app to verify the timezone settings, I see the contents of the old table and not the new one.

I’ve run migrate and optimize with every update, but it has not changed.

I decided to attempt to force the update via the desktop app (which, incidentally, broke my install the last time I attempted). Doing so updated the database info in the install.

So what did I miss or do incorrectly during the update via command line that the database changes didn’t take effect?

@northhill

I think the issue is that your cache still had the old timezones the forces update / clear cache would have reset this.

That’s odd, because I cleared the cache multiple times since updating and it didn’t seem to do anything until I forced the update.

I’m curious to see the update script. Would you mind pointing me to where it is on GitHub? Just to have a look and see what I could do differently.

Thanks for responding.