firefly-iii / firefly-iii

Firefly III: a personal finances manager
https://firefly-iii.org/
GNU Affero General Public License v3.0
16.28k stars 1.47k forks source link

Data importer auth dance fails with remote guard enabled #6977

Closed OGKevin closed 1 year ago

OGKevin commented 1 year ago

Support guidelines

I've found a bug and checked that ...

Description

I have not done an import in a while, after upgrading everything to their latest versions:

I'm getting an exception saying:

Laravel\Passport\Http\Controllers\AuthorizationController::__construct(): Argument #3 ($guard) must be of type Illuminate\Contracts\Auth\StatefulGuard, FireflyIII\Support\Authentication\RemoteUserGuard given

I tried my best to go over the change logs and docs, but could not find any doc that mentions a breaking change with my setup.

I use remote user as explained here: https://docs.firefly-iii.org/firefly-iii/advanced-installation/authentication/#remote-user as authing mechanism. This used to work fine until recently.

Expected behaviour

Auth to succeed and therefore being able to do a CSV import.

Debug information

Debug information generated at 2023-02-04 18:18:00 Europe/Amsterdam for Firefly III version 5.7.18.

Scope Version
Firefly III 5.7.18
Firefly III API 1.5.6
Build 346, 02-01-2023 16:12:50 CET
DB version 18 (exp. 18)
PHP 8.1.13
Host Linux
System info Value
System TZ Europe/Amsterdam
Browser TZ Europe/Amsterdam
App environment local
App debug mode false
App cache driver file
App logging info, stack
Display errors Off
Error reporting ALL errors
Interface apache2handler
Default language en_US
Default locale equal
BCscale 24
DB drivers mysql, pgsql, sqlite
Current driver pgsql
Trusted proxies (.env) **
User info Value
Login provider eloquent
User guard remote_user_guard
Headers HTTP_X_AUTHENTIK_NAME, HTTP_X_AUTHENTIK_EMAIL
Stateful domains localhost
Session start 2023-02-01 00:00:00
Session end 2023-02-28 23:59:59
Session first 2019-08-21 00:00:00
User ID 1
User language en_US
User locale en_US
Attempt at "en_US.utf8" 'en_US.utf8'
Attempt at "en_US.UTF-8" 'en_US.UTF-8'
User agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Truncated from this point <----|de: 0): Laravel\\Passport\\Http\\Controllers\\AuthorizationController::__construct(): Argument #3 ($guard) must be of type Illuminate\\Contracts\\Auth\\StatefulGuard, FireflyIII\\Support\\Authentication\\RemoteUserGuard given at /var/www/html/vendor/laravel/passport/src/Http/Controllers/AuthorizationController.php:52)
[stacktrace]
#0 [internal function]: Laravel\\Passport\\Http\\Controllers\\AuthorizationController->__construct()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(915): ReflectionClass->newInstanceArgs()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(756): Illuminate\\Container\\Container->build()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(860): Illuminate\\Container\\Container->resolve()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(692): Illuminate\\Foundation\\Application->resolve()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(845): Illuminate\\Container\\Container->make()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(274): Illuminate\\Foundation\\Application->make()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\Route->getController()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#11 /var/www/html/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Laravel\\Passport\\Http\\Middleware\\CreateFreshApiToken->handle()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(40): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\AuthenticateSession->handle()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Pipeline\\Pipeline->then()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#33 /var/www/html/app/Http/Middleware/InstallationId.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): FireflyIII\\Http\\Middleware\\InstallationId->handle()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#39 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#43 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#47 /var/www/html/app/Http/Middleware/SecureHeaders.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#48 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): FireflyIII\\Http\\Middleware\\SecureHeaders->handle()
#49 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#51 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#52 /var/www/html/public/index.php(75): Illuminate\\Foundation\\Http\\Kernel->handle()
#53 {main}
"} 

Steps to reproduce

  1. Setup remote user login
  2. Setup data-importer
  3. Generate OAuth credentials
  4. Input client ID and installation url.
  5. Hit submit 💣

Additional info

My system performs application upgrades automatically, so it could be that there is something hidden in the change logs that I might have missed. However, if I did, would be nice XP to throw an error that a human can do something with 🙏🏾.

My last successful import was in July 2022, unfortunately I do not have automated imports 😔, so I import once I notice that money disappeared in a questionable manner 🙈.

JC5 commented 1 year ago

Yea, this has been discussed in several tickets you can find using the search. I hope to get a human error in the app soon, in the mean time this is mentioned in the documentation.

github-actions[bot] commented 1 year ago

Hi there! This is an automatic reply. Share and enjoy

This issue is now closed. Please be aware that closed issues are not actively monitored. If you reply, you may get no response.

Thank you for your consideration.

OGKevin commented 1 year ago

Ah my bad, I searched manually, and did not do a copy and paste of the exception line 🤦🏾.

I searched "remote guard" on the docs and GH but did not find https://github.com/firefly-iii/docs/pull/134/files nor the other issues. So the different terms used kinda screwed my searching efforts, hehe.

Thx for the info tho 👍🏾

OGKevin commented 1 year ago

duplciate of: