Unable to Register Application Service User @linebot:example.com #46

Open
opened 2024-02-19 23:08:18 -05:00 by crmado · 0 comments

Content:

Problem Description:

I encountered an issue while trying to bridge Matrix with LINE. After configuring config.yaml and successfully generating the application service registration file registration.yaml, I copied this file to the Synapse directory and registered it in homeserver.yaml. While most services bridged successfully, bridging LINE resulted in an error: mautrix.errors.request.MForbidden: Application service has not registered this user (@linebot:example.com).

Steps to Reproduce:

  1. Configure config.yaml according to the documentation for matrix-puppeteer-line.
  2. Run python -m matrix_puppeteer_line -g to generate registration.yaml.
  3. Move the generated registration.yaml file to the Synapse directory and rename it.
  4. Add the path to line-registration.yaml in homeserver.yaml.
  5. Restart the Synapse service.

Expected Behavior:

The application service should successfully register the user @linebot:example.com and start the bridging service without issues.

Actual Behavior:

The application service fails to start, reporting the error:

[2024-02-20 03:44:09,299] [INFO@mau.init] Initializing matrix-puppeteer-line 0.1.0+dev.unknown
[2024-02-20 03:44:09,300] [INFO@mau.init] Initialization complete in 0.08 seconds
[2024-02-20 03:44:09,300] [DEBUG@mau.init] Running startup actions...
[2024-02-20 03:44:09,301] [DEBUG@mau.db] Connecting to postgres://synapse_user:hello@postgres/matrix_line?sslmode=disable
[2024-02-20 03:44:09,700] [DEBUG@mau.init] Starting appservice...
[2024-02-20 03:44:09,700] [DEBUG@mau.as] Starting appservice web server on 0.0.0.0:29394
[2024-02-20 03:44:09,701] [INFO@mau.mx] Ensuring connectivity to homeserver
[2024-02-20 03:44:09,706] [DEBUG@mau.mx] Whoami endpoint returned M_FORBIDDEN, trying to register bridge bot before retrying...
[2024-02-20 03:44:09,709] [CRITICAL@mau.init] Unexpected error in main event loop
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/mautrix/util/program.py", line 190, in _run
    self.loop.run_until_complete(self.start())
  File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/lib/python3.9/site-packages/matrix_puppeteer_line/__main__.py", line 75, in start
    await super().start()
  File "/usr/lib/python3.9/site-packages/mautrix/bridge/bridge.py", line 156, in start
    await self.matrix.wait_for_connection()
  File "/usr/lib/python3.9/site-packages/mautrix/bridge/matrix.py", line 101, in wait_for_connection
    await self.az.intent.whoami()
  File "/usr/lib/python3.9/site-packages/mautrix/client/api/authentication.py", line 154, in whoami
    resp = await self.api.request(Method.GET, Path.account.whoami)
  File "/usr/lib/python3.9/site-packages/mautrix/api.py", line 259, in request
    return await self._send(method, full_url, content, query_params, headers or {})
  File "/usr/lib/python3.9/site-packages/mautrix/api.py", line 180, in _send
    raise make_request_error(http_status=response.status,
mautrix.errors.request.MForbidden: Application service has not registered this user (@linebot:example.com)

Environment:

  • Application Service Version: matrix-puppeteer-line 0.1.0+dev.unknown
  • Synapse Version: matrixdotorg/synapse:latest
  • Operating System: Ubuntu 20.04

Configuration:

Relevant part of homeserver.yaml:

app_service_config_files:
    - /data/qq-registration.yaml
    - /data/wechat-registration.yaml
    - /data/facebook-registration.yaml
    - /data/instagram-registration.yaml
    - /data/discord-registration.yaml
    - /data/whatsapp-registration.yaml
    - /data/line-registration.yaml

Contents of line-registration.yaml:

id: line
as_token: IVisIGSXVrNVhxtEemBiw4oQP6HcaW7XkL3q60-RP8u3yMIng7t5FV69aKk1mg1d
hs_token: 8Dr45A2tGaTCcqj_ZI9XBCHoyLoBXWfjGRnM7LlwIDMAVlm7EzLLyLyFUUuorEIi
namespaces:
    users:
    - exclusive: true
      regex: '@line_.*:example\.com'
    - exclusive: true
      regex: '@linebot:example\.com'
    aliases: []
url: http://matrix-puppeteer-line:29394
sender_localpart: 8xTrcSTh6GghcbQtTnsq60DT8iYjZj10_yGGMhHGIflm-UJpkh63VZmH2dAkHxmy
rate_limited: false
### Content: **Problem Description**: I encountered an issue while trying to bridge Matrix with LINE. After configuring `config.yaml` and successfully generating the application service registration file `registration.yaml`, I copied this file to the Synapse directory and registered it in `homeserver.yaml`. While most services bridged successfully, bridging LINE resulted in an error: `mautrix.errors.request.MForbidden: Application service has not registered this user (@linebot:example.com)`. **Steps to Reproduce**: 1. Configure `config.yaml` according to the documentation for `matrix-puppeteer-line`. 2. Run `python -m matrix_puppeteer_line -g` to generate `registration.yaml`. 3. Move the generated `registration.yaml` file to the Synapse directory and rename it. 4. Add the path to `line-registration.yaml` in `homeserver.yaml`. 5. Restart the Synapse service. **Expected Behavior**: The application service should successfully register the user `@linebot:example.com` and start the bridging service without issues. **Actual Behavior**: The application service fails to start, reporting the error: ``` [2024-02-20 03:44:09,299] [INFO@mau.init] Initializing matrix-puppeteer-line 0.1.0+dev.unknown [2024-02-20 03:44:09,300] [INFO@mau.init] Initialization complete in 0.08 seconds [2024-02-20 03:44:09,300] [DEBUG@mau.init] Running startup actions... [2024-02-20 03:44:09,301] [DEBUG@mau.db] Connecting to postgres://synapse_user:hello@postgres/matrix_line?sslmode=disable [2024-02-20 03:44:09,700] [DEBUG@mau.init] Starting appservice... [2024-02-20 03:44:09,700] [DEBUG@mau.as] Starting appservice web server on 0.0.0.0:29394 [2024-02-20 03:44:09,701] [INFO@mau.mx] Ensuring connectivity to homeserver [2024-02-20 03:44:09,706] [DEBUG@mau.mx] Whoami endpoint returned M_FORBIDDEN, trying to register bridge bot before retrying... [2024-02-20 03:44:09,709] [CRITICAL@mau.init] Unexpected error in main event loop Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/mautrix/util/program.py", line 190, in _run self.loop.run_until_complete(self.start()) File "/usr/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/lib/python3.9/site-packages/matrix_puppeteer_line/__main__.py", line 75, in start await super().start() File "/usr/lib/python3.9/site-packages/mautrix/bridge/bridge.py", line 156, in start await self.matrix.wait_for_connection() File "/usr/lib/python3.9/site-packages/mautrix/bridge/matrix.py", line 101, in wait_for_connection await self.az.intent.whoami() File "/usr/lib/python3.9/site-packages/mautrix/client/api/authentication.py", line 154, in whoami resp = await self.api.request(Method.GET, Path.account.whoami) File "/usr/lib/python3.9/site-packages/mautrix/api.py", line 259, in request return await self._send(method, full_url, content, query_params, headers or {}) File "/usr/lib/python3.9/site-packages/mautrix/api.py", line 180, in _send raise make_request_error(http_status=response.status, mautrix.errors.request.MForbidden: Application service has not registered this user (@linebot:example.com) ``` **Environment**: - Application Service Version: matrix-puppeteer-line 0.1.0+dev.unknown - Synapse Version: matrixdotorg/synapse:latest - Operating System: Ubuntu 20.04 **Configuration**: Relevant part of `homeserver.yaml`: ```yaml app_service_config_files: - /data/qq-registration.yaml - /data/wechat-registration.yaml - /data/facebook-registration.yaml - /data/instagram-registration.yaml - /data/discord-registration.yaml - /data/whatsapp-registration.yaml - /data/line-registration.yaml ``` Contents of `line-registration.yaml`: ```yaml id: line as_token: IVisIGSXVrNVhxtEemBiw4oQP6HcaW7XkL3q60-RP8u3yMIng7t5FV69aKk1mg1d hs_token: 8Dr45A2tGaTCcqj_ZI9XBCHoyLoBXWfjGRnM7LlwIDMAVlm7EzLLyLyFUUuorEIi namespaces: users: - exclusive: true regex: '@line_.*:example\.com' - exclusive: true regex: '@linebot:example\.com' aliases: [] url: http://matrix-puppeteer-line:29394 sender_localpart: 8xTrcSTh6GghcbQtTnsq60DT8iYjZj10_yGGMhHGIflm-UJpkh63VZmH2dAkHxmy rate_limited: false ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fair/matrix-puppeteer-line#46
No description provided.