matterbridge icon indicating copy to clipboard operation
matterbridge copied to clipboard

IRC bridge fails to reconnect

Open geekosaur opened this issue 2 years ago • 3 comments

Describe the bug I had a brief network failure. After it recovered, the IRC bridge began looping:

[18510]  INFO irc:          irc.myirc: joining #hackage (ID: #hackageirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell (ID: #haskellirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #xmonad (ID: #xmonadirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #ghc (ID: #ghcirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell-language-server (ID: #haskell-language-serverirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #hackage (ID: #hackageirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell (ID: #haskellirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #xmonad (ID: #xmonadirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #ghc (ID: #ghcirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell-language-server (ID: #haskell-language-serverirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #ghc (ID: #ghcirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell-language-server (ID: #haskell-language-serverirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #hackage (ID: #hackageirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell (ID: #haskellirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #xmonad (ID: #xmonadirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #hackage (ID: #hackageirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell (ID: #haskellirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #xmonad (ID: #xmonadirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #ghc (ID: #ghcirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell-language-server (ID: #haskell-language-serverirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #xmonad (ID: #xmonadirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #ghc (ID: #ghcirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell-language-server (ID: #haskell-language-serverirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #hackage (ID: #hackageirc.myirc)
[18510]  INFO irc:          irc.myirc: joining #haskell (ID: #haskellirc.myirc)
[18515] ERROR irc:          disconnect: error: EOF
[18515]  INFO irc:          reconnecting in 30 seconds...

Stopping and restarting matterbridge connected immediately, perhaps suggesting that some state is hanging around when the bridge tries to reconnect.

To Reproduce Steps to reproduce the behavior:

Run matterbridge with an IRC gateway, then disconnect the network for several minutes.

Expected behavior matterbridge reconnects successfully.

Environment (please complete the following information):

  • OS: Linux (Ubuntu 22.04.2)
  • Matterbridge version: version: 1.26.1-dev
  • If self compiled: output of git rev-parse HEAD = 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696

Additional context Please add your configuration file (be sure to exclude or anonymize private data (tokens/passwords)

[irc.myirc]
Nick="haskellbridge" # <== change this
RealName="matterbridge operated by geekosaur"
NickServNick="haskellbridge" # <== change this if necessary (your nick registered with nickserv)
NickServPassword="<elided>" # <== change this (your pass with nickserv)
Server="irc.libera.chat:6697"
UseTLS=true
UseSASL=true
SkipTLSVerify=false
RemoteNickFormat="<{NOPINGNICK}> "
Charset="utf-8"
MessageSplit=true
EditDisable=true

[matrix.mymatrix]
# Server="https://matrix.org"
# Matterbridge does not support encrypted group chats.
# Therefore, use Pantalaimon to MiTM myself:
Server="http://localhost:20662"
# Dedicated user
# Messages sent from this user will not be relayed to avoid loops.
Login="hackager"
Password="<elided>"
RemoteNickFormat="<{NOPINGNICK}> "
#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org
#to other bridges, or only send "username".(true only sends username)
NoHomeServerSuffix=true
HTMLDisable=true
#EditDisable=true
EditSuffix=" (edited)"

[[gateway]]
name="hackage"
enable=true

[[gateway.inout]]
account="matrix.mymatrix"
channel="!YWYQDCuIpuQHzGrLzd:matrix.org"

[[gateway.inout]]
account="irc.myirc"
channel="#hackage"

[[gateway]]
name="haskell-irc"
enable=true

[[gateway.inout]]
account="matrix.mymatrix"
channel="#haskell-irc:matrix.org"

[[gateway.inout]]
account="irc.myirc"
channel="#haskell"

[[gateway]]
name="xmonad"
enable=true

[[gateway.inout]]
account="matrix.mymatrix"
channel="#xmonad:matrix.org"

[[gateway.inout]]
account="irc.myirc"
channel="#xmonad"

[[gateway]]
name="ghc"
enable=true

[[gateway.inout]]
account="matrix.mymatrix"
channel="!pAORzwKXYKXnnMpVxT:matrix.org"

[[gateway.inout]]
account="irc.myirc"
channel="#ghc"

[[gateway]]
name="hls"
enable=true

[[gateway.inout]]
account="matrix.mymatrix"
channel="#haskell-language-server:matrix.org"

[[gateway.inout]]
account="irc.myirc"
channel="#haskell-language-server"

geekosaur avatar Oct 05 '23 08:10 geekosaur

I don't have a debug log currently but will switch to debug mode next time I restart the bridge, and will try to provoke the failure at a time when the bridge isn't in use.

geekosaur avatar Oct 05 '23 08:10 geekosaur

I have a partial debug log now; it's showing the server disconnecting it for excess flood. The parts of the log I still have available suggest it's resending a lot of bridge traffic from several minutes before the disconnect.

geekosaur avatar Oct 11 '23 22:10 geekosaur

Matterbridge needs to updated to use its throttle for all IRC messages and not only when relaying chat messages. It's flooding itself off when it rejoins.

glguy avatar Aug 06 '24 15:08 glguy