🐛 Bug Report: Romm (truenas) Internal Server Error #136

Closed
opened 2025-10-07 23:54:29 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @jsapede on GitHub.

Reproduction steps

Installed Romm Truenas APP, and setup according to documentation :

https://docs.romm.app/latest/OIDC-Guides/OIDC-Setup-With-PocketID

Romm Server is behind cloudflared zero trust tunnel

Expected behavior

login using pocketid

Actual Behavior

got persistent error :

2025-07-09 06:10:58.431218+00:00INFO:	  [RomM][h11_impl][2025-07-09 08:10:58] 176.181.61.6:0 - "GET /api/login/openid HTTP/1.0" 500
2025-07-09 06:10:58.431719+00:00INFO:     [RomM][nginx][2025-07-09 08:10:58] 192.168.0.135 | 176.181.61.6 | GET /api/login/openid 500 | 21 | Chrome Windows | 0.215
2025-07-09 06:10:58.675588+00:00ERROR:	  [RomM][h11_impl][2025-07-09 08:10:58] Exception in ASGI application
2025-07-09 06:10:58.675624+00:00Traceback (most recent call last):
2025-07-09 06:10:58.675637+00:00File "/src/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
2025-07-09 06:10:58.675654+00:00result = await app(  # type: ignore[func-returns-value]
2025-07-09 06:10:58.675660+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675666+00:00File "/src/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
2025-07-09 06:10:58.675675+00:00return await self.app(scope, receive, send)
2025-07-09 06:10:58.675680+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675685+00:00File "/src/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
2025-07-09 06:10:58.675691+00:00await super().__call__(scope, receive, send)
2025-07-09 06:10:58.675698+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 409, in _sentry_patched_asgi_app
2025-07-09 06:10:58.675704+00:00return await middleware(scope, receive, send)
2025-07-09 06:10:58.675710+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675715+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/asgi.py", line 161, in _run_asgi3
2025-07-09 06:10:58.675723+00:00return await self._run_app(scope, receive, send, asgi_version=3)
2025-07-09 06:10:58.675729+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675735+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/asgi.py", line 262, in _run_app
2025-07-09 06:10:58.675742+00:00raise exc from None
2025-07-09 06:10:58.675748+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/asgi.py", line 257, in _run_app
2025-07-09 06:10:58.675753+00:00return await self.app(
2025-07-09 06:10:58.675758+00:00^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675766+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
2025-07-09 06:10:58.675771+00:00await self.middleware_stack(scope, receive, send)
2025-07-09 06:10:58.675777+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.675784+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.675790+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675795+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
2025-07-09 06:10:58.675800+00:00raise exc
2025-07-09 06:10:58.675810+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
2025-07-09 06:10:58.675816+00:00await self.app(scope, receive, _send)
2025-07-09 06:10:58.675821+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.675830+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.675835+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675840+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
2025-07-09 06:10:58.675846+00:00with collapse_excgroups():
2025-07-09 06:10:58.675853+00:00^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675859+00:00File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__
2025-07-09 06:10:58.675864+00:00self.gen.throw(value)
2025-07-09 06:10:58.675869+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-07-09 06:10:58.675877+00:00raise exc
2025-07-09 06:10:58.675882+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
2025-07-09 06:10:58.675887+00:00response = await self.dispatch_func(request, call_next)
2025-07-09 06:10:58.675893+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675900+00:00File "/backend/utils/context.py", line 50, in set_context_middleware
2025-07-09 06:10:58.675906+00:00return await call_next(request)
2025-07-09 06:10:58.675911+00:00^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675916+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next
2025-07-09 06:10:58.675924+00:00raise app_exc
2025-07-09 06:10:58.675929+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro
2025-07-09 06:10:58.675934+00:00await self.app(scope, receive_or_disconnect, send_no_error)
2025-07-09 06:10:58.675940+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.675947+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.675953+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.675958+00:00File "/backend/handler/auth/middleware.py", line 156, in __call__
2025-07-09 06:10:58.675966+00:00await self.app(scope, receive, send_wrapper)
2025-07-09 06:10:58.675971+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 348, in _sentry_authenticationmiddleware_call
2025-07-09 06:10:58.675977+00:00await old_call(self, scope, receive, send)
2025-07-09 06:10:58.675983+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.675996+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.676002+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676007+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/authentication.py", line 48, in __call__
2025-07-09 06:10:58.676017+00:00await self.app(scope, receive, send)
2025-07-09 06:10:58.676023+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.676028+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.676036+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676042+00:00File "/backend/handler/auth/middleware.py", line 28, in __call__
2025-07-09 06:10:58.676048+00:00await super().__call__(scope, receive, send)
2025-07-09 06:10:58.676053+00:00File "/src/.venv/lib/python3.12/site-packages/starlette_csrf/middleware.py", line 72, in __call__
2025-07-09 06:10:58.676061+00:00await self.app(scope, receive, send)
2025-07-09 06:10:58.676066+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.676072+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.676080+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676085+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
2025-07-09 06:10:58.676091+00:00await self.app(scope, receive, send)
2025-07-09 06:10:58.676096+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 298, in _sentry_exceptionmiddleware_call
2025-07-09 06:10:58.676104+00:00await old_call(self, scope, receive, send)
2025-07-09 06:10:58.676110+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call
2025-07-09 06:10:58.676115+00:00return await old_call(app, scope, new_receive, new_send, **kwargs)
2025-07-09 06:10:58.676123+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676129+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-07-09 06:10:58.676134+00:00await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-07-09 06:10:58.676144+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-07-09 06:10:58.676149+00:00raise exc
2025-07-09 06:10:58.676155+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-07-09 06:10:58.676161+00:00await app(scope, receive, sender)
2025-07-09 06:10:58.676169+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
2025-07-09 06:10:58.676175+00:00await self.middleware_stack(scope, receive, send)
2025-07-09 06:10:58.676180+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
2025-07-09 06:10:58.676188+00:00await route.handle(scope, receive, send)
2025-07-09 06:10:58.676194+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
2025-07-09 06:10:58.676199+00:00await self.app(scope, receive, send)
2025-07-09 06:10:58.676204+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
2025-07-09 06:10:58.676212+00:00await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-07-09 06:10:58.676218+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-07-09 06:10:58.676224+00:00raise exc
2025-07-09 06:10:58.676229+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-07-09 06:10:58.676237+00:00await app(scope, receive, sender)
2025-07-09 06:10:58.676243+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
2025-07-09 06:10:58.676248+00:00response = await f(request)
2025-07-09 06:10:58.676254+00:00^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676262+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/fastapi.py", line 143, in _sentry_app
2025-07-09 06:10:58.676268+00:00return await old_app(*args, **kwargs)
2025-07-09 06:10:58.676274+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676279+00:00File "/src/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
2025-07-09 06:10:58.676288+00:00raw_response = await run_endpoint_function(
2025-07-09 06:10:58.676294+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676299+00:00File "/src/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
2025-07-09 06:10:58.676308+00:00return await dependant.call(**values)
2025-07-09 06:10:58.676313+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676319+00:00File "/backend/endpoints/auth.py", line 228, in login_via_openid
2025-07-09 06:10:58.676325+00:00return await oauth.openid.authorize_redirect(request, OIDC_REDIRECT_URI)
2025-07-09 06:10:58.676333+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676339+00:00File "/src/.venv/lib/python3.12/site-packages/authlib/integrations/starlette_client/apps.py", line 34, in authorize_redirect
2025-07-09 06:10:58.676344+00:00rv = await self.create_authorization_url(redirect_uri, **kwargs)
2025-07-09 06:10:58.676351+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676364+00:00File "/src/.venv/lib/python3.12/site-packages/authlib/integrations/base_client/async_app.py", line 95, in create_authorization_url
2025-07-09 06:10:58.676370+00:00metadata = await self.load_server_metadata()
2025-07-09 06:10:58.676375+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676385+00:00File "/src/.venv/lib/python3.12/site-packages/authlib/integrations/base_client/async_app.py", line 78, in load_server_metadata
2025-07-09 06:10:58.676392+00:00metadata = resp.json()
2025-07-09 06:10:58.676398+00:00^^^^^^^^^^^
2025-07-09 06:10:58.676403+00:00File "/src/.venv/lib/python3.12/site-packages/httpx/_models.py", line 832, in json
2025-07-09 06:10:58.676413+00:00return jsonlib.loads(self.content, **kwargs)
2025-07-09 06:10:58.676419+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676425+00:00File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
2025-07-09 06:10:58.676431+00:00return _default_decoder.decode(s)
2025-07-09 06:10:58.676463+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676470+00:00File "/usr/lib/python3.12/json/decoder.py", line 338, in decode
2025-07-09 06:10:58.676477+00:00obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2025-07-09 06:10:58.676484+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-09 06:10:58.676494+00:00File "/usr/lib/python3.12/json/decoder.py", line 356, in raw_decode
2025-07-09 06:10:58.676500+00:00raise JSONDecodeError("Expecting value", s, err.value) from None

analyzing error using AI, gives me a hint to curl authorize :

curl -i https://*******.ovh/authorize/.well-known/openid-configuration

resulting in html response instead of json :

HTTP/2 200 
date: Wed, 09 Jul 2025 06:13:15 GMT
content-type: text/html; charset=utf-8
cf-ray: 95c5aca52d0ae1bc-MRS
accept-ranges: bytes
cache-control: public, max-age=86400
last-modified: Tue, 08 Jul 2025 09:32:59 GMT
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=GgR3aMT6tTHS1fPE5xemx2QfJgC7vpLevHBCnQsiXr7pvPAoiSwKUuUySXkvmApCJ4ZVxdK3mg7mwvVeGhQ4IRoc6TSOFlswKcfE3IOOi0cMbNrHYWrbY%2BLcUN1SDUlcNxN34g2vfNo3icWe7KGVHWw%2BH1catTUe"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=6553&min_rtt=6445&rtt_var=1183&sent=6&recv=10&lost=0&retrans=0&sent_bytes=3381&recv_bytes=815&delivery_rate=608577&cwnd=254&unsent_bytes=0&cid=05cfc7e3d48cbf90&ts=65&x=0"

<!doctype html>
<html lang="%lang%">
        <head>
                <meta charset="utf-8" />
                <link rel="icon" href="/api/application-configuration/favicon" />
                <meta name="viewport" content="width=device-width, initial-scale=1" />
                <meta name="robots" content="noindex" />

                <link rel="modulepreload" href="/_app/immutable/entry/start.CKsC_Xyh.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/BLgIw2NK.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/DDTdOybm.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/CYgJF_JY.js">
                <link rel="modulepreload" href="/_app/immutable/entry/app.Dh8Ummas.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/Dp1pzeXC.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/BQi9nghC.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/DMMSOYmh.js">
                <link rel="modulepreload" href="/_app/immutable/chunks/D0qC_92o.js">
        </head>
        <body data-sveltekit-preload-data="hover">
                <div style="display: contents">
                        <script>
                                {
                                        __sveltekit_1wng2b = {
                                                base: ""
                                        };

                                        const element = document.currentScript.parentElement;

                                        Promise.all([
                                                import("/_app/immutable/entry/start.CKsC_Xyh.js"),
                                                import("/_app/immutable/entry/app.Dh8Ummas.js")
                                        ]).then(([kit, app]) => {
                                                kit.start(app, element);
                                        });
                                }
                        </script>
                </div>
        </body>
</html>

looks like also in the logs that redirect isnt reachable :

2025-07-09 06:10:58.676325+00:00return await oauth.openid.authorize_redirect(request, OIDC_REDIRECT_URI)

Strangely i have no specific problems with other apps i use pocketid (proxmox, jellyfin) even if they're behind the same cloudflared tunnel

Version and Environment

Trunas scale 25.04.1
Romm : 3.10.2
pocketid : 1.6.1

Log Output

No response

Originally created by @jsapede on GitHub. ### Reproduction steps Installed Romm Truenas APP, and setup according to documentation : https://docs.romm.app/latest/OIDC-Guides/OIDC-Setup-With-PocketID Romm Server is behind cloudflared zero trust tunnel ### Expected behavior login using pocketid ### Actual Behavior got persistent error : ``` 2025-07-09 06:10:58.431218+00:00INFO: [RomM][h11_impl][2025-07-09 08:10:58] 176.181.61.6:0 - "GET /api/login/openid HTTP/1.0" 500 2025-07-09 06:10:58.431719+00:00INFO: [RomM][nginx][2025-07-09 08:10:58] 192.168.0.135 | 176.181.61.6 | GET /api/login/openid 500 | 21 | Chrome Windows | 0.215 2025-07-09 06:10:58.675588+00:00ERROR: [RomM][h11_impl][2025-07-09 08:10:58] Exception in ASGI application 2025-07-09 06:10:58.675624+00:00Traceback (most recent call last): 2025-07-09 06:10:58.675637+00:00File "/src/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi 2025-07-09 06:10:58.675654+00:00result = await app( # type: ignore[func-returns-value] 2025-07-09 06:10:58.675660+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675666+00:00File "/src/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__ 2025-07-09 06:10:58.675675+00:00return await self.app(scope, receive, send) 2025-07-09 06:10:58.675680+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675685+00:00File "/src/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__ 2025-07-09 06:10:58.675691+00:00await super().__call__(scope, receive, send) 2025-07-09 06:10:58.675698+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 409, in _sentry_patched_asgi_app 2025-07-09 06:10:58.675704+00:00return await middleware(scope, receive, send) 2025-07-09 06:10:58.675710+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675715+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/asgi.py", line 161, in _run_asgi3 2025-07-09 06:10:58.675723+00:00return await self._run_app(scope, receive, send, asgi_version=3) 2025-07-09 06:10:58.675729+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675735+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/asgi.py", line 262, in _run_app 2025-07-09 06:10:58.675742+00:00raise exc from None 2025-07-09 06:10:58.675748+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/asgi.py", line 257, in _run_app 2025-07-09 06:10:58.675753+00:00return await self.app( 2025-07-09 06:10:58.675758+00:00^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675766+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__ 2025-07-09 06:10:58.675771+00:00await self.middleware_stack(scope, receive, send) 2025-07-09 06:10:58.675777+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.675784+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.675790+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675795+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__ 2025-07-09 06:10:58.675800+00:00raise exc 2025-07-09 06:10:58.675810+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__ 2025-07-09 06:10:58.675816+00:00await self.app(scope, receive, _send) 2025-07-09 06:10:58.675821+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.675830+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.675835+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675840+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__ 2025-07-09 06:10:58.675846+00:00with collapse_excgroups(): 2025-07-09 06:10:58.675853+00:00^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675859+00:00File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__ 2025-07-09 06:10:58.675864+00:00self.gen.throw(value) 2025-07-09 06:10:58.675869+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups 2025-07-09 06:10:58.675877+00:00raise exc 2025-07-09 06:10:58.675882+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__ 2025-07-09 06:10:58.675887+00:00response = await self.dispatch_func(request, call_next) 2025-07-09 06:10:58.675893+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675900+00:00File "/backend/utils/context.py", line 50, in set_context_middleware 2025-07-09 06:10:58.675906+00:00return await call_next(request) 2025-07-09 06:10:58.675911+00:00^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675916+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next 2025-07-09 06:10:58.675924+00:00raise app_exc 2025-07-09 06:10:58.675929+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro 2025-07-09 06:10:58.675934+00:00await self.app(scope, receive_or_disconnect, send_no_error) 2025-07-09 06:10:58.675940+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.675947+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.675953+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.675958+00:00File "/backend/handler/auth/middleware.py", line 156, in __call__ 2025-07-09 06:10:58.675966+00:00await self.app(scope, receive, send_wrapper) 2025-07-09 06:10:58.675971+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 348, in _sentry_authenticationmiddleware_call 2025-07-09 06:10:58.675977+00:00await old_call(self, scope, receive, send) 2025-07-09 06:10:58.675983+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.675996+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.676002+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676007+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/authentication.py", line 48, in __call__ 2025-07-09 06:10:58.676017+00:00await self.app(scope, receive, send) 2025-07-09 06:10:58.676023+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.676028+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.676036+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676042+00:00File "/backend/handler/auth/middleware.py", line 28, in __call__ 2025-07-09 06:10:58.676048+00:00await super().__call__(scope, receive, send) 2025-07-09 06:10:58.676053+00:00File "/src/.venv/lib/python3.12/site-packages/starlette_csrf/middleware.py", line 72, in __call__ 2025-07-09 06:10:58.676061+00:00await self.app(scope, receive, send) 2025-07-09 06:10:58.676066+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.676072+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.676080+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676085+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__ 2025-07-09 06:10:58.676091+00:00await self.app(scope, receive, send) 2025-07-09 06:10:58.676096+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 298, in _sentry_exceptionmiddleware_call 2025-07-09 06:10:58.676104+00:00await old_call(self, scope, receive, send) 2025-07-09 06:10:58.676110+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/starlette.py", line 200, in _create_span_call 2025-07-09 06:10:58.676115+00:00return await old_call(app, scope, new_receive, new_send, **kwargs) 2025-07-09 06:10:58.676123+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676129+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ 2025-07-09 06:10:58.676134+00:00await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2025-07-09 06:10:58.676144+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2025-07-09 06:10:58.676149+00:00raise exc 2025-07-09 06:10:58.676155+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app 2025-07-09 06:10:58.676161+00:00await app(scope, receive, sender) 2025-07-09 06:10:58.676169+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__ 2025-07-09 06:10:58.676175+00:00await self.middleware_stack(scope, receive, send) 2025-07-09 06:10:58.676180+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app 2025-07-09 06:10:58.676188+00:00await route.handle(scope, receive, send) 2025-07-09 06:10:58.676194+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle 2025-07-09 06:10:58.676199+00:00await self.app(scope, receive, send) 2025-07-09 06:10:58.676204+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app 2025-07-09 06:10:58.676212+00:00await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2025-07-09 06:10:58.676218+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app 2025-07-09 06:10:58.676224+00:00raise exc 2025-07-09 06:10:58.676229+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app 2025-07-09 06:10:58.676237+00:00await app(scope, receive, sender) 2025-07-09 06:10:58.676243+00:00File "/src/.venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app 2025-07-09 06:10:58.676248+00:00response = await f(request) 2025-07-09 06:10:58.676254+00:00^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676262+00:00File "/src/.venv/lib/python3.12/site-packages/sentry_sdk/integrations/fastapi.py", line 143, in _sentry_app 2025-07-09 06:10:58.676268+00:00return await old_app(*args, **kwargs) 2025-07-09 06:10:58.676274+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676279+00:00File "/src/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app 2025-07-09 06:10:58.676288+00:00raw_response = await run_endpoint_function( 2025-07-09 06:10:58.676294+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676299+00:00File "/src/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function 2025-07-09 06:10:58.676308+00:00return await dependant.call(**values) 2025-07-09 06:10:58.676313+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676319+00:00File "/backend/endpoints/auth.py", line 228, in login_via_openid 2025-07-09 06:10:58.676325+00:00return await oauth.openid.authorize_redirect(request, OIDC_REDIRECT_URI) 2025-07-09 06:10:58.676333+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676339+00:00File "/src/.venv/lib/python3.12/site-packages/authlib/integrations/starlette_client/apps.py", line 34, in authorize_redirect 2025-07-09 06:10:58.676344+00:00rv = await self.create_authorization_url(redirect_uri, **kwargs) 2025-07-09 06:10:58.676351+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676364+00:00File "/src/.venv/lib/python3.12/site-packages/authlib/integrations/base_client/async_app.py", line 95, in create_authorization_url 2025-07-09 06:10:58.676370+00:00metadata = await self.load_server_metadata() 2025-07-09 06:10:58.676375+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676385+00:00File "/src/.venv/lib/python3.12/site-packages/authlib/integrations/base_client/async_app.py", line 78, in load_server_metadata 2025-07-09 06:10:58.676392+00:00metadata = resp.json() 2025-07-09 06:10:58.676398+00:00^^^^^^^^^^^ 2025-07-09 06:10:58.676403+00:00File "/src/.venv/lib/python3.12/site-packages/httpx/_models.py", line 832, in json 2025-07-09 06:10:58.676413+00:00return jsonlib.loads(self.content, **kwargs) 2025-07-09 06:10:58.676419+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676425+00:00File "/usr/lib/python3.12/json/__init__.py", line 346, in loads 2025-07-09 06:10:58.676431+00:00return _default_decoder.decode(s) 2025-07-09 06:10:58.676463+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676470+00:00File "/usr/lib/python3.12/json/decoder.py", line 338, in decode 2025-07-09 06:10:58.676477+00:00obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 2025-07-09 06:10:58.676484+00:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-07-09 06:10:58.676494+00:00File "/usr/lib/python3.12/json/decoder.py", line 356, in raw_decode 2025-07-09 06:10:58.676500+00:00raise JSONDecodeError("Expecting value", s, err.value) from None ``` analyzing error using AI, gives me a hint to curl authorize : ``` curl -i https://*******.ovh/authorize/.well-known/openid-configuration ``` resulting in html response instead of json : ``` HTTP/2 200 date: Wed, 09 Jul 2025 06:13:15 GMT content-type: text/html; charset=utf-8 cf-ray: 95c5aca52d0ae1bc-MRS accept-ranges: bytes cache-control: public, max-age=86400 last-modified: Tue, 08 Jul 2025 09:32:59 GMT cf-cache-status: DYNAMIC report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=GgR3aMT6tTHS1fPE5xemx2QfJgC7vpLevHBCnQsiXr7pvPAoiSwKUuUySXkvmApCJ4ZVxdK3mg7mwvVeGhQ4IRoc6TSOFlswKcfE3IOOi0cMbNrHYWrbY%2BLcUN1SDUlcNxN34g2vfNo3icWe7KGVHWw%2BH1catTUe"}],"group":"cf-nel","max_age":604800} nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800} server: cloudflare alt-svc: h3=":443"; ma=86400 server-timing: cfL4;desc="?proto=TCP&rtt=6553&min_rtt=6445&rtt_var=1183&sent=6&recv=10&lost=0&retrans=0&sent_bytes=3381&recv_bytes=815&delivery_rate=608577&cwnd=254&unsent_bytes=0&cid=05cfc7e3d48cbf90&ts=65&x=0" <!doctype html> <html lang="%lang%"> <head> <meta charset="utf-8" /> <link rel="icon" href="/api/application-configuration/favicon" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="robots" content="noindex" /> <link rel="modulepreload" href="/_app/immutable/entry/start.CKsC_Xyh.js"> <link rel="modulepreload" href="/_app/immutable/chunks/BLgIw2NK.js"> <link rel="modulepreload" href="/_app/immutable/chunks/DDTdOybm.js"> <link rel="modulepreload" href="/_app/immutable/chunks/CYgJF_JY.js"> <link rel="modulepreload" href="/_app/immutable/entry/app.Dh8Ummas.js"> <link rel="modulepreload" href="/_app/immutable/chunks/Dp1pzeXC.js"> <link rel="modulepreload" href="/_app/immutable/chunks/BQi9nghC.js"> <link rel="modulepreload" href="/_app/immutable/chunks/DMMSOYmh.js"> <link rel="modulepreload" href="/_app/immutable/chunks/D0qC_92o.js"> </head> <body data-sveltekit-preload-data="hover"> <div style="display: contents"> <script> { __sveltekit_1wng2b = { base: "" }; const element = document.currentScript.parentElement; Promise.all([ import("/_app/immutable/entry/start.CKsC_Xyh.js"), import("/_app/immutable/entry/app.Dh8Ummas.js") ]).then(([kit, app]) => { kit.start(app, element); }); } </script> </div> </body> </html> ``` looks like also in the logs that redirect isnt reachable : 2025-07-09 06:10:58.676325+00:00return await oauth.openid.authorize_redirect(request, OIDC_REDIRECT_URI) Strangely i have no specific problems with other apps i use pocketid (proxmox, jellyfin) even if they're behind the same cloudflared tunnel ### Version and Environment Trunas scale 25.04.1 Romm : 3.10.2 pocketid : 1.6.1 ### Log Output _No response_
OVERLORD added the bug label 2025-10-07 23:54:29 +03:00
Author
Owner

@jsapede commented on GitHub:

hmm i've set the config according to the doc ;

OIDC_SERVER_APPLICATION_URL: The authorization URL for you Pocket ID instance, e.g. https://id.host.local/authorize

@jsapede commented on GitHub: hmm i've set the config according to the doc ; OIDC_SERVER_APPLICATION_URL: The authorization URL for you Pocket ID instance, e.g. https://id.host.local/authorize
Author
Owner

@ItalyPaleAle commented on GitHub:

Can you try removing /authorize?

It may be a bug in their docs

@ItalyPaleAle commented on GitHub: Can you try removing `/authorize`? It may be a bug in their docs
Author
Owner

@ItalyPaleAle commented on GitHub:

It appears that it’s trying to fetch the OIDC discovery URL at https://*******.ovh/authorize/.well-known/openid-configuration while it should be https://*******.ooh/.well-known/openid-configuration (in most cases)

@ItalyPaleAle commented on GitHub: It appears that it’s trying to fetch the OIDC discovery URL at `https://*******.ovh/authorize/.well-known/openid-configuration` while it should be `https://*******.ooh/.well-known/openid-configuration` (in most cases)
Author
Owner

@jsapede commented on GitHub:

good point, it works, it's an error in the docs !

@jsapede commented on GitHub: good point, it works, it's an error in the docs !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#136