Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'GenericWorkerStore' object has no attribute 'get_user_id_for_open_id_token' #17189

Closed
guimard opened this issue May 14, 2024 · 2 comments

Comments

@guimard
Copy link
Contributor

guimard commented May 14, 2024

Description

When trying to use /_matrix/federation/v1/openid/userinfo?access_token=xxx endpoint, I got the following error:

AttributeError: 'GenericWorkerStore' object has no attribute 'get_user_id_for_open_id_token'

See logs below

Steps to reproduce

  • list the steps
  • that reproduce the bug
  • using hyphens as bullet points

Homeserver

Local test server

Synapse Version

1.106.0

Installation Method

Docker (matrixdotorg/synapse)

Database

PostgreSQL

Workers

Multiple workers

Platform

Docker

Configuration

No response

Relevant log output

2024-05-14 07:09:42,300 - synapse.http.server - 146 - ERROR - GET-141 - Failed handle request via 'OpenIdUserInfo': <XForwardedForRequest at 0x7f4d292ec850 method='GET' uri='/_matrix/federation/v1/openid/userinfo?access_token=<redacted>' clientproto='HTTP/1.1' site='8082'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/synapse/http/server.py", line 332, in _async_render_wrapper
    callback_return = await self._async_render(request)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     
  File "/usr/local/lib/python3.11/site-packages/synapse/http/server.py", line 544, in _async_render
    callback_return = await raw_callback_return
                      ^^^^^^^^^^^^^^^^^^^^^^^^^             
  File "/usr/local/lib/python3.11/site-packages/synapse/federation/transport/server/_base.py", line 363, in new_func
    response = await func(
               ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/synapse/federation/transport/server/__init__.py", line 254, in on_GET
    user_id = await self.handler.on_openid_userinfo(token)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/synapse/federation/federation_server.py", line 1079, in on_openid_userinfo
    return await self.store.get_user_id_for_open_id_token(token, ts_now_ms)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GenericWorkerStore' object has no attribute 'get_user_id_for_open_id_token'

Anything else that would be useful to know?

Same error with an internal token or an access_token issued from /_matrix/client/v3/user/@user:domain.tld/openid/request_token

@guimard
Copy link
Contributor Author

guimard commented May 14, 2024

Fixed using another worker. I don't understand why federation worker isn't able to resolve that

@erikjohnston
Copy link
Member

Note that currently handling this endpoint on a worker is not supported: https://element-hq.github.io/synapse/latest/workers.html#available-worker-applications.

We'd accept PRs to allow this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants