Matrix-appservice-irc: Unlinking a provisioned room still causes the bot to rejoin after leaving to set permissions

Created on 19 May 2021  ·  18Comments  ·  Source: matrix-org/matrix-appservice-irc

image

bug

Most helpful comment

This made it really hard (well, impossible) to unbridge several Freenode rooms and bridge them to OFTC instead. Would be great to have this fixed quickly, now people are leaving Freenode en-mass.

All 18 comments

This made it really hard (well, impossible) to unbridge several Freenode rooms and bridge them to OFTC instead. Would be great to have this fixed quickly, now people are leaving Freenode en-mass.

I suppose this is the reason for the following error when trying to setup the bridging after removing Freenode:

Bridge returned HTTP 500 Internal Server Error: Room failed validation. You may be attempting to "double bridge" this room. Error: 2

Is there some workaround for this in the meantime?

Yes, and nope, just got to wait...

Looking into this one today.

Someone somewhere mentioned that bridging to another room and unbridging may fix this issue. I've just tried it and it did work indeed! The steps I did:

  1. join an empty IRC channel without ChanServ so that you're the only op there
  2. bridge the Matrix room to this channel (this will require an op on IRC side to confirm)
  3. leave that channel on IRC side so that when it's unbridged, there is nobody left in there (as you do it, appservice-irc will change the power level of your IRC puppet to Default)
  4. remove the bridge on Matrix side (now appservice-irc has no reason to join again and change the power levels as there is nobody left to change)

Thanks for the suggestion! That didn't work for me.

The above workaround didnt work for me, but another did: Perhaps it might help anyone who is looking for a solution:

  1. Make sure that no freenode users are on the matrix channel
  2. Use the integration manager > Select IRC > Select Network Name "Freenode" > Select your old IRC channel name and complete the authorization
  3. Once you are done, close the integration manager (this step is important)
  4. Now open the integration manager again. You will see "IRC" in the "Existing integration" section
  5. Click "IRC" and hit "Unlink" button. Automatically @appservice:matrix.org will leave the matrix channel.
  6. Select new IRC network, eg: Libera, OFTC in the same integration manager, and complete the authorization
  7. React with 👍 or :-1: if it worked for you or not :stuck_out_tongue:

Ok I was able to figure this out and bridge succeeded.

Firstly follow https://github.com/matrix-org/matrix-appservice-irc/issues/1323#issuecomment-848666019 to get appservice-irc out of channel.

then

  1. Go to 'Room settings' > Advanced > Open Devtools
  2. Click 'Send custom event' then switch to 'state event' by clicking red 'event' button at bottom right corner and fill the following:
  3. Event type = uk.half-shot.bridge
  4. State key = org.matrix.appservice-irc:/irc.libera.chat/<#CHANNEL>
    (Don't forget to fill channel name. Eg. org.matrix.appservice-irc:/irc.libera.chat/#wikidata)
  5. Event content =
    "bridgebot": "@appservice:libera.chat",
    "channel": {
      "id": "<#CHANNEL>"
    },
    "network": {
      "displayname": "liberachat",
      "id": "irc.libera.chat"
    },
    "protocol": {
      "displayname": "IRC",
      "id": "irc"
    } 

Again don't forget to fill the channel name.

  1. Send the event and then try to bridge as we do normally by clicking "Add widgets, bridges and bots".

Ok I was able to figure this out and bridge succeeded.

Firstly follow #1323 (comment) to get appservice-irc out of channel.

then

1. Go to 'Room settings' > Advanced > Open Devtools

2. Click 'Send custom event' then switch to 'state event' by clicking red 'event' button at bottom right corner and fill the following:


* Event type = `uk.half-shot.bridge`

* State key = `org.matrix.appservice-irc:/irc.libera.chat/<#CHANNEL>`
  (**Don't forget to fill channel name**. Eg. `org.matrix.appservice-irc:/irc.libera.chat/#wikidata`)

* Event content =
    "bridgebot": "@appservice:libera.chat",
    "channel": {
      "id": "<#CHANNEL>"
    },
    "network": {
      "displayname": "liberachat",
      "id": "irc.libera.chat"
    },
    "protocol": {
      "displayname": "IRC",
      "id": "irc"
    } 

Again don't forget to fill the channel name.

  1. Send the event and then try to bridge as we do normally by clicking "Add widgets, bridges and bots".

This seems to assume that you've already somehow gotten the old Freenode bot to leave. Unfortunately, the issue here is actually getting the old bot to leave (and not rejoin). The workaround you link didn't work for me, nor for many others here. It sounds like you may be trying to solve a different problem than the issue here.

I have gotten the freenode bot to leave, but the uk.half-shot.bridge work-around still didn't work.

So as it stands, I'm unable to set up a liberachat bridge.

Update: I managed to get it to work. This is what I did:

  1. Follow the above procedure (bridge new freenode room, then unlink it again) to get @appservice-irc:matrix.org to leave the room.
  2. Go to Room settings -> Advanced -> Open Devtools -> Explore Room State -> m.room.bridging
  3. For all of the existing freenode bridges, click on Edit and then put the new content as {} and send.
  4. Make sure you are -R on IRC, so you get the libera bridge's PMs
  5. Follow the normal IRC bridge integration procedure

Now my channel is successfully bridged to libera. It seems to me that the room of this issue stems from a combination of factors:

  1. The freenode appservice bridge not properly cleaning up after itself
  2. The libera appservice bridge being weirdly reluctant to join a room that already has a freenode bridge (why?)

I just successfully bridged LiberaChat to a matrix room. From scratch this is what I did:

  1. unlink freenode room, link to temp room, unlink again to make appservice-irc:matrix.org leave, as described in previous comments
  2. Send the uk.half-shot.bridge event as described by @kfiven
  3. Delete the content of the freenode bridges in the room state as described by @haasn
  4. Integrate your new LiberaChat IRC channel the regular way.

So basically it seems like before following what haasn described, you need to send the uk.half-shot.bridge event too.

It's worth pointing out that my "successfully set up" bridge only works in one direction, it seems. Messages from matrix land on IRC, but not vice versa.

I'm starting to think Matrix is still a few years away from being usable in practice.

… one direction, …

Please see pinned issues, https://github.com/matrix-org/matrix-appservice-irc/issues/1324#issuecomment-852297622 in particular. Thank you.

Ok I was able to figure this out and bridge succeeded.
Firstly follow #1323 (comment) to get appservice-irc out of channel.
then

1. Go to 'Room settings' > Advanced > Open Devtools

2. Click 'Send custom event' then switch to 'state event' by clicking red 'event' button at bottom right corner and fill the following:


* Event type = `uk.half-shot.bridge`

* State key = `org.matrix.appservice-irc:/irc.libera.chat/<#CHANNEL>`
  (**Don't forget to fill channel name**. Eg. `org.matrix.appservice-irc:/irc.libera.chat/#wikidata`)

* Event content =
    "bridgebot": "@appservice:libera.chat",
    "channel": {
      "id": "<#CHANNEL>"
    },
    "network": {
      "displayname": "liberachat",
      "id": "irc.libera.chat"
    },
    "protocol": {
      "displayname": "IRC",
      "id": "irc"
    } 

Again don't forget to fill the channel name.

  1. Send the event and then try to bridge as we do normally by clicking "Add widgets, bridges and bots".

This seems to assume that you've already somehow gotten the old Freenode bot to leave. Unfortunately, the issue here is actually getting the old bot to leave (and not rejoin). The workaround you link didn't work for me, nor for many others here. It sounds like you may be trying to solve a different problem than the issue here.

To remove irc bridge https://github.com/matrix-org/matrix-appservice-irc/issues/1323#issuecomment-848666019 is working for me.

It seems some have had luck emailing matrix support. For what it's worth, I emailed them and they wanted me to put my email address on a project home page in order to help get the channel unstuck. At some point, we may be better off abandoning the broken channel, creating a new one in Matrix to bridge to Libera, and setting the topic or something to direct users to the new Matrix channel. It seems at the moment that once you bridge a Matrix room to an IRC network, you'd better be committed to it, because you might be stuck with it.

Same here, written to matrix support, no luck so far.
Can´t use the workarounds mentioned above, because I already had left the freenode channel and tried to link the OFTC one, now I have both bridges as members of the room and they are deadlocked :/

@Half-Shot how can we get rid of rooms with 2 bridge bots now? It's good that this is fixed for the future, but there are existing rooms quite broken now.

Was this page helpful?
0 / 5 - 0 ratings