42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.64k stars 617 forks source link

Reconnect after problem #1419

Open keesj opened 3 years ago

keesj commented 3 years ago

Hi,

I am trying to use mattermostbridge to bridge with rocketchat. The system works nicely but when my sysadmin decides to restart the server or otherwise interrupt the services mattermostbridge does not recover from this.

Can an option be added to recover from such error(like restarting)?

keesj commented 3 years ago

The log looks something like this: I think my admin restarts the chat server and somewhere during the startup the server starts to respond and matterbrige stops trying after the nosub.

time="2021-03-02T13:13:19+01:00" level=info msg="Gateway(s) started succesfully. Now relaying messages" prefix=main
2021/03/02 21:04:54 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:04:59 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:05 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:10 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:15 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:20 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:25 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:31 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:36 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:41 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:46 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:51 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:05:56 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:02 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:07 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:12 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:17 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:22 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:27 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:32 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:38 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:43 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:48 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:53 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:06:58 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:03 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:09 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:14 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:19 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:24 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:29 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:34 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:40 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:45 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:50 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: dial tcp 33.222.333.101:443: connect: connection refused
2021/03/02 21:07:55 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: bad status
2021/03/02 21:08:01 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: bad status
2021/03/02 21:08:06 Dial error websocket.Dial wss://chat.yo-lolz.nu:443/websocket: bad status
2021/03/02 21:08:11 Subscription returned a nosub error map[id:3 msg:nosub]
DarthGandalf commented 3 years ago

Same happens on IRC. Even though logs claim that it's reconnecting, it's not.

Since 2021-03-09T03:52:16Z the log is full of the following.

log ``` time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw (ID: #openmwirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-cs (ID: #openmw-csirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-funposting (ID: #openmw-funpostingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-offtopic (ID: #openmw-offtopicirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-troubleshooting (ID: #openmw-troubleshootingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-development (ID: #openmw-developmentirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-modding (ID: #openmw-moddingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-russian (ID: #openmw-russianirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-screenshots (ID: #openmw-screenshotsirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-development (ID: #openmw-developmentirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-modding (ID: #openmw-moddingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-russian (ID: #openmw-russianirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-screenshots (ID: #openmw-screenshotsirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-troubleshooting (ID: #openmw-troubleshootingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw (ID: #openmwirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-cs (ID: #openmw-csirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-funposting (ID: #openmw-funpostingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-offtopic (ID: #openmw-offtopicirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-shaders (ID: #openmw-shadersirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-development (ID: #openmw-developmentirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-modding (ID: #openmw-moddingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-russian (ID: #openmw-russianirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-screenshots (ID: #openmw-screenshotsirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-troubleshooting (ID: #openmw-troubleshootingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw (ID: #openmwirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-cs (ID: #openmw-csirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-funposting (ID: #openmw-funpostingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-offtopic (ID: #openmw-offtopicirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-shaders (ID: #openmw-shadersirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-funposting (ID: #openmw-funpostingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-offtopic (ID: #openmw-offtopicirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-shaders (ID: #openmw-shadersirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw (ID: #openmwirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-cs (ID: #openmw-csirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-russian (ID: #openmw-russianirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-screenshots (ID: #openmw-screenshotsirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-troubleshooting (ID: #openmw-troubleshootingirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-development (ID: #openmw-developmentirc.openmw)" prefix=irc time="2021-03-09T04:43:36Z" level=info msg="irc.openmw: joining #openmw-modding (ID: #openmw-moddingirc.openmw)" prefix=irc time="2021-03-09T04:43:41Z" level=error msg="disconnect: error: EOF" prefix=irc time="2021-03-09T04:43:41Z" level=info msg="reconnecting in 30 seconds..." prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw (ID: #openmwirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-cs (ID: #openmw-csirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-funposting (ID: #openmw-funpostingirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-offtopic (ID: #openmw-offtopicirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-shaders (ID: #openmw-shadersirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-development (ID: #openmw-developmentirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-modding (ID: #openmw-moddingirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-russian (ID: #openmw-russianirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-screenshots (ID: #openmw-screenshotsirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-troubleshooting (ID: #openmw-troubleshootingirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-modding (ID: #openmw-moddingirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-russian (ID: #openmw-russianirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-screenshots (ID: #openmw-screenshotsirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-troubleshooting (ID: #openmw-troubleshootingirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-development (ID: #openmw-developmentirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-cs (ID: #openmw-csirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-funposting (ID: #openmw-funpostingirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-offtopic (ID: #openmw-offtopicirc.openmw)" prefix=irc time="2021-03-09T04:44:19Z" level=info msg="irc.openmw: joining #openmw-shaders (ID: #openmw-shadersirc.openmw)" prefix=irc ```

The pair

time="2021-03-09T03:52:21Z" level=error msg="disconnect: error: EOF" prefix=irc
time="2021-03-09T03:52:21Z" level=info msg="reconnecting in 30 seconds..." prefix=irc

is happening every minutes or so, but I never see the bot on IRC after the server died.