Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Recurring MacaroonInitException: Must supply serialized macaroon. in sentry #12707

@DMRobertson

Description

@DMRobertson

Internal users: https://sentry.matrix.org/sentry/synapse-matrixorg/issues/219508/?query=is%3Aunresolved

First seen in 1.32.2, according to sentry.

Invalid session for OIDC callback

MacaroonInitException: Must supply serialized macaroon.
  File "synapse/handlers/oidc.py", line 220, in handle_oidc_callback
    session, state
  File "synapse/handlers/oidc.py", line 1186, in verify_oidc_session_token
    macaroon = pymacaroons.Macaroon.deserialize(session)
  File "pymacaroons/macaroon.py", line 50, in deserialize
    'Must supply serialized macaroon.'

Judging from the source code below, it looks like these are errors that we expect to encounter from time to time. Maybe logger.execption -> logger.warning?

# Deserialize the session token and verify it.
try:
session_data = self._token_generator.verify_oidc_session_token(
session, state
)
except (MacaroonInitException, MacaroonDeserializationException, KeyError) as e:
logger.exception("Invalid session for OIDC callback")
self._sso_handler.render_error(request, "invalid_session", str(e))
return
except MacaroonInvalidSignatureException as e:
logger.exception("Could not verify session for OIDC callback")
self._sso_handler.render_error(request, "mismatching_session", str(e))
return

Metadata

Metadata

Assignees

Labels

A-LoggingSynapse's logs (structured or otherwise). Not metrics.T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions