matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
460 stars 149 forks source link

Asymetrical communication #1791

Open altf4arnold opened 5 months ago

altf4arnold commented 5 months ago

Problem :

This is my status now when sending messages and listing users :

Matrix ---------> IRC Working OK. IRC -----------> Matrix No communication possible and no users show up in the matrix chan.

Logs :

this is the sanitised log for the bridge when I get a message from IRC to Matrix :

INFO:IrcBridge [gus8abbprk800] [I->M] IGNORE virtual user  (1ms)
INFO:req [fxypsaa76lc00] [[I->M]] onMessage: irc.libera.chat from=<NICKNAME> (null@irc.libera.chat) to=#<IRCCHAN>
DEBUG:req [fxypsaa76lc00] [[I->M]] action={"type":"message","text":"<MESSAGE>","ts":0}
DEBUG:req [fxypsaa76lc00] [[I->M]] <MATRIX-ROOM> does not require Matrix users to be joined
INFO:IrcBridge irc_<NICKNAME> does not exist in the store yet, setting a profile
DEBUG [Intent] Checking if user @irc_<NICKNAME>:localhost is registered
DEBUG [MatrixHttpClient] (REQ-42) POST https://<MATRIX-SERVER>/_matrix/client/v3/register
ERROR [MatrixHttpClient] (REQ-42) {
  errcode: 'M_EXCLUSIVE',
  error: 'Invalid user localpart for this application service.'
}
ERROR [Appservice] Encountered error registering user: 
ERROR [Appservice] {
  errcode: 'M_EXCLUSIVE',
  error: 'Invalid user localpart for this application service.'
}
INFO:IrcBridge [fxypsaa76lc00] [I->M] FAILED  (13ms)

This is the sanitised log from the Synapse homeserver :

- synapse.http.server - 129 - INFO - POST-73 - <XForwardedForRequest at 0x7f4a14408990 method='POST' uri='/_matrix/client/v3/register?user_id=%40irc_<NICKNAME>%3Alocalhost' clientproto='HTTP/1.1' site='8008'> SynapseError: 400 - Invalid user localpart for this application service.

- synapse.access.http.8008 - 471 - INFO - POST-73 - 2a01:4f9:c012:4921::1 - 8008 - {None} Processed request: 0.000sec/0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 88B 400 "POST /_matrix/client/v3/register?user_id=%40irc_<NICKNAME>%3Alocalhost HTTP/1.1" "-" [0 dbevts]

- synapse.handlers.message - 691 - INFO - POST-74 - Failed to get profile information for @<NAME-OF-BOT>:<MATRIX-SERVER>: 404: Profile was not found

Related issues :

I found #581 I also found Synapse register file

What I already have done:

related to #581 , I checked the regex. It looks ok to me.

appservice-registration-irc.yaml

  aliases:
    - exclusive: true
      regex: '#irc_.*:localhost'
  users:
    - exclusive: true
      regex: '@irc_\..*:localhost'

which I think is relevant with this :

config.yaml

      matrixClients:
        # The user ID template to use when creating virtual matrix users. This
        # MUST start with an @ and have $NICK somewhere in it.
        # Optional. Default: "@$SERVER_$NICK".
        # Example: "@irc.example.com_Alice:example.com"
        userTemplate: "@irc_$NICK"
        # The display name to use for created matrix clients. This should have
        # $NICK somewhere in it if it is specified. Can also use $SERVER to
        # insert the IRC domain.
        # Optional. Default: "$NICK". Example: "Alice"
        displayName: "$NICK"
        # Number of tries a client can attempt to join a room before the request
        # is discarded. You can also use -1 to never retry or 0 to never give up.
        # Optional. Default: -1
        joinAttempts: 0

I also tried disabling the groupId as mentioned in #581 without much more result