Cannot stay logged in after update to 5.5.38

after updating to 5.5.38, from 5.5.37. the web interface will not stay logged in.

403 70 error on last line of access.log
no other entries in error.log or laravel.log

ubuntu 20.04 nginx 1.18.0 php8.1

“POST /api/v1/login?first_load=true&include_static=true HTTP/1.1” 200 85400 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:45:13 -0500] “GET /api/v1/clients?per_page=5000&page=1&t=1697129112772 HTTP/1.1” 200 206441 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:45:14 -0500] “GET /api/v1/products?per_page=5000&page=1&t=1697129113618 HTTP/1.1” 200 3764 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:45:23 -0500] “GET /api/v1/invoices?per_page=5000&page=1&created_at=1665593114&filter_deleted_clients=true&t=1697129113882 HTTP/1.1” 200 1174277 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:45:32 -0500] “GET /api/v1/invoices?per_page=5000&page=2&created_at=1665593124&filter_deleted_clients=true&t=1697129123693 HTTP/1.1” 200 1138782 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:45:42 -0500] “GET /api/v1/invoices?per_page=5000&page=3&created_at=1665593133&filter_deleted_clients=true&t=1697129133311 HTTP/1.1” 200 1131920 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:45:51 -0500] “GET /api/v1/invoices?per_page=5000&page=4&created_at=1665593143&filter_deleted_clients=true&t=1697129142659 HTTP/1.1” 200 1107930 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:46:01 -0500] “GET /api/v1/invoices?per_page=5000&page=5&created_at=1665593152&filter_deleted_clients=true&t=1697129152375 HTTP/1.1” 200 1104406 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”
[12/Oct/2023:11:46:02 -0500] “GET /api/v1/invoices?per_page=5000&page=6&created_at=0&t=1697129161828 HTTP/1.1” 403 70 “https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0”

Hi,

I believe this was a bug in that specific version, I suggest updating to the latest available version.

ok. i have been updating each step. i have tried jumping over some versions, but that caused me to miss warnings about turning up memory.

which is the next step in versions i should move up to.

I suggest using the latest version, currently v5.7.29.

If you see errors upgrading I suggest manually copying over the latest release zip.

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

ok, where i got hung up before was where i missed turning up php fpm memory. somewhere between 5.5.24 and 5.5.28 the health check told me to turn memory up to 512. --maybe add something in the release notes about upping the php memory to 512 at 5.5.0 might cut down on posts like this one.

i had tried skipping from 5.5.0 to 5.5.124. at that point all was getting was 500 error, even after loading zips of newer and newest versions.

i have updated my test host to 5.7.29 and it all seems to be working fine. I will follow the same procedures i have done on the test host, on the live host.

Thank You.

Glad to hear it, thanks for the update!

i did everything the same on the live host, and now i am getting

500: Server Error

www.xxx.yyy.zzz - - [12/Oct/2023:14:50:50 -0500] “POST /api/v1/login?first_load=true&include_static=true HTTP/1.1” 500 44 “https://https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Linux; Android 12; Pixel 4 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36”
www.xxx.yyy.zzz - - [12/Oct/2023:14:50:51 -0500] “GET /assets/NOTICES HTTP/1.1” 200 1042598 “https://https://www.xxx.yyy.zzz/” “Mozilla/5.0 (Linux; Android 12; Pixel 4 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36”
www.xxx.yyy.zzz - - [12/Oct/2023:14:51:11 -0500] “POST /api/v1/refresh?&first_load=true&include_static=true HTTP/1.1” 500 44 “-” “Dart/2.19 (dart:io)”
www.xxx.yyy.zzz - - [12/Oct/2023:14:52:03 -0500] “POST /api/v1/refresh?&first_load=true&include_static=true HTTP/1.1” 500 44 “-” “Dart/2.19 (dart:io)”

Are there any details about the 500 error in storage/logs?

[2023-10-12 20:04:31] production.ERROR: App\Transformers\CompanyTokenTransformer::transform(): Argument #1 ($company_token) must be of type App\Models\CompanyToken, null given, called in /pathto/invoiceninja/vendor/league/fractal/src/Scope.php on line 357 {“userId”:1,“exception”:"[object] (TypeError(code: 0): App\Transformers\CompanyTokenTransformer::transform(): Argument #1 ($company_token) must be of type App\Models\CompanyToken, null given, called in /pathto/invoiceninja/vendor/league/fractal/src/Scope.php on line 357 at /pathto/invoiceninja/app/Transformers/CompanyTokenTransformer.php:41)
[stacktrace]
#0 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(357): App\Transformers\CompanyTokenTransformer->transform()
#1 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(292): League\Fractal\Scope->fireTransformer()
#2 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(173): League\Fractal\Scope->executeResourceTransformers()
#3 /pathto/invoiceninja/vendor/league/fractal/src/TransformerAbstract.php(134): League\Fractal\Scope->toArray()
#4 /pathto/invoiceninja/vendor/league/fractal/src/TransformerAbstract.php(107): League\Fractal\TransformerAbstract->includeResourceIfAvailable()
#5 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(383): League\Fractal\TransformerAbstract->processIncludedResources()
#6 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(361): League\Fractal\Scope->fireIncludedTransformers()
#7 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(295): League\Fractal\Scope->fireTransformer()
#8 /pathto/invoiceninja/vendor/league/fractal/src/Scope.php(173): League\Fractal\Scope->executeResourceTransformers()
#9 /pathto/invoiceninja/app/Http/Controllers/BaseController.php(647): League\Fractal\Scope->toArray()
#10 /pathto/invoiceninja/app/Http/Controllers/BaseController.php(664): App\Http\Controllers\BaseController->miniLoadResponse()
#11 /pathto/invoiceninja/app/Http/Controllers/Auth/LoginController.php(156): App\Http\Controllers\BaseController->timeConstrainedResponse()
#12 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Auth\LoginController->apiLogin()
#13 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction()
#14 /pathto/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(21): Illuminate\Routing\ControllerDispatcher->dispatch()
#15 /pathto/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingRoutingDispatcher.php(19): Sentry\Laravel\Tracing\Routing\TracingControllerDispatcherTracing->Sentry\Laravel\Tracing\Routing\{closure}()
#16 /pathto/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(20): Sentry\Laravel\Tracing\Routing\TracingRoutingDispatcher->wrapRouteDispatch()
#17 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Sentry\Laravel\Tracing\Routing\TracingControllerDispatcherTracing->dispatch()
#18 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#19 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\Routing\Route->run()
#20 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#21 /pathto/invoiceninja/app/Http/Middleware/ApiSecretCheck.php(31): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#22 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\ApiSecretCheck->handle()
#23 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(122): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#24 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(87): Illuminate\Routing\Middleware\ThrottleRequests->handleRequestUsingNamedLimiter()
#25 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\ThrottleRequests->handle()
#26 /pathto/invoiceninja/app/Http/Middleware/QueryLogging.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#27 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\QueryLogging->handle()
#28 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#29 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#30 /pathto/invoiceninja/app/Http/Middleware/SetEmailDb.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#31 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\SetEmailDb->handle()
#32 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#33 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(800): Illuminate\Pipeline\Pipeline->then()
#34 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(777): Illuminate\Routing\Router->runRouteWithinStack()
#35 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(741): Illuminate\Routing\Router->runRoute()
#36 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(730): Illuminate\Routing\Router->dispatchToRoute()
#37 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\Routing\Router->dispatch()
#38 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#39 /pathto/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#40 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Http\SetRequestIpMiddleware->handle()
#41 /pathto/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(31): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#42 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Http\SetRequestMiddleware->handle()
#43 /pathto/invoiceninja/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#44 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Livewire\DisableBrowserCache->handle()
#45 /pathto/invoiceninja/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#46 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle()
#47 /pathto/invoiceninja/app/Http/Middleware/Cors.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#48 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\Cors->handle()
#49 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#50 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies->handle()
#51 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#52 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#53 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#54 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#55 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#56 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#57 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#58 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#59 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#60 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#61 /pathto/invoiceninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(87): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#62 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Tracing\Middleware->handle()
#63 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#64 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()
#65 /pathto/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#66 /pathto/invoiceninja/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle()
#67 {main}

Try loading /update?secret=secret and/or running php artisan optimize.

still getting 500 error

@david do you have any suggestions?

no change, still getting 500 error on login page

the test server was an exact copy of the live server. except for domain / ip address’s in nginx configs and .env

Have you migrated your server? It appears that your api tokens are no longer available?

no migration. it’s always been self hosted on the same virtual machine on the same hardware.

i have been testing updates on another virtual machine, the updates worked on both servers upto 5.5.37,

on both servers i updated in the same order of versions. with the last being 5.7.29,

the test server works fine. the live production server is the one i am getting the 500 error on the login.

there are two entries in the database under company_tokens that are on the test server that are not on the live server.

i copied the to entries from test DB to live DB and now i can log in to the LIVE server running 5.7.29