-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stopped relaying from irc->discord #328
Comments
Huh. This looks… almost(?) like a dupe of #326, except in that case the bot only works IRC → Discord and not vice versa. That issue isn't solved yet but I had an idea for how it might be done which I haven't got around to implementing yet. There is in fact a debug mode! It comes in two parts – you can add I've been using the bot for a while, and used to encounter the issue from #326 quite often, but it seems to occur much less often in recent updates. It seems to happen more on a poor network connection. |
It happened again! And I've started it in debug mode now. I've had the similar happen with a telegram-discord bot, but in the direction discord->telegram. Btw, info on the setup: |
There have been several updates since that version – we're now on v2.4.2 – so you might want to update. Are you sure it was failing to mirror from IRC to Discord, and not the other way around? If the telegram-discord bot failed Discord → Telegram, I'd expect this one to fail Discord → IRC, not IRC → Discord (and that would make your issue a duplicate of #326). |
Haha. I was sure I had checked out the latest release. Will update to latest when I get home. And yes, I am sure of the direction. I did not say there was any correlation to the other case, just gave it as a 'fun fact'. |
For the record, it just happened again, but I managed to screw up the output when I joined the session. So now I started it with logging to a file :) |
Went down twice, last time it was only up an hour or so :/ this is too unreliable for us to use atm :'( The debug logs seems to show nothing special for me. In this case the last message relayed from irc->discord was the I will see if I can add some more debug output after the "Sending message to Discord" part. For me it appears to not send much debug messages from the discord part? discord->irc works nicely I'm running it like this atm
My config is quite simple:
|
Do you have an example of it working? The IRC part of things should output when it receives a line from the server, as in the example below (lines starting
Edit: Maybe you need to re-run |
as I wrote, it did work in the first 9 lines of the log I pasted, it seemingly works as supposed to, Not a single line containing "Received:" in the entire output. all the output is pretty much the same, with a lot of heartbeat and pings and some messages on this form. I guess including the "startup" lines might tell you something extra:
Of course I forgot to install again after checking out the new version. I'll do it right away! |
I had some unmet peer dependencies on installation. could this possibly cause it?
|
No, they shouldn't cause it; |
well, edit: From the log, there seem to be absolutely nothing special happening at the time it breaks. On one line it works, the next not.
edit2: the npm install seems to have changed the log output slightly? |
Did you run it with It seems like the IRC library is receiving the messages from IRC (that's why it was useful to update, it shows the |
Well, after checking some bash manuals and googling some, I believe I didn't pass the environment variables properly. I now rather just export NODE_ENV to ensure its set, and it seems to produce more debug lines. Now I'll just wait to see what it says when it happens again. |
This happened to me too today, the discord servers got nuked for a second and the next moment the bridge wasn't relaying IRC -> discord. |
For the record. It hasn't happened since my last post in here, the bot was running nicely for 24 days straight, until it, a couple of days ago, stopped, but I haven't hat time to look at the logs yet. |
I do not know if this is the same bug, but our bot stopped relaying data from IRC to Discord with a different error:
I am running discord-irc installed from the NPM repositories. |
Any updates on this? Happens to my bot at least once a week, but even with debug enabled there is no indication in the messages when this happens, so I cannot help with more info. |
Could we maybe get some mechanism that would kill the bot when this happens, so when running with I ask because when I tested with |
I think that if we had a mechanism to kill the bot when this happens, we could instead reconnect at that time. It's not complicated to stop and start both sides of the bot, but I'm not sure how we notice when this is happening from the bot's side. The IRC side of things still seems to notice when a message is sent, but it's failing to then send it on to Discord. Iirc, when I checked this out, the Discord side of things was disconnecting somehow and failing to reconnect, but it also didn't emit any event to say (i.e. let us know when) it had disconnected. (I'm a bit busy right now, so won't be able to get to it myself for a few weeks, but might find something then? I'm not sure.) |
One way to verify this would be to read back what was sent to Discord/IRC side by the bot. If the line doesn't come back after sending it, it could be detected as an error. Enough errors and the bot would reconnect. And no hurries, the bot works great already, this is at worst a minor inconvenience. I think I got the chronjob working too so I'm personally covered (needed -t switch for starting the script). |
I think reading back the IRC side is not possible – as far as I know, the server doesn't send a confirmation when it receives a message you send. (I could well be wrong.) For the Discord side, that seems like it might work – Discord provides message history, so we should be able to poll that – but it's a bit of an ugly way to do it (when really the discord.js library should figure it out itself and reconnect us / tell us that we've been disconnected). If I don't find a better way to do it, I'll see if I can implement that and hopefully it'll be accepted as a temporary measure, while I (hopefully) open a bug report with discord.js itself. I'm not completely sure, but it seems like this might fix both this issue and #326, since (iirc) they're both about the Discord side of things disconnecting and failing to do anything about it. |
Here is a script I wrote to automatically restart discord-irc whenever it starts shitting itself. command="discord-irc -c config.json"
log="prog.log"
match="TypeError: Cannot read property 'options' of undefined"
$command > "$log" 2>&1 &
pid=$!
while sleep 60; do
if fgrep --quiet "$match" "$log"; then
kill $pid
./autorestart.sh &
exit 0
fi
done Basically, it spawns the program and listens to its output and looks for $match |
Your problem looks more like #351 (and #342) than this one, and we think those have both been fixed as of v2.5.1. Are you sure it's still a problem? The debug logs given in this issue don't, except for yours, complain about a
This seems, to put it nicely, less than maximally charitable as a description. I'm not intending to ignore you, and I'm sorry that you feel that way. If your issue is still a problem, I don't have a great way to fix it, as I cannot reproduce it locally and it doesn't seem to offer enough useful debug information. You may get something out of looking at https://www.bennadel.com/blog/3238-logging-and-debugging-unhandled-promise-rejections-in-node-js-v1-4-1-and-later.htm to set it up to debug more useful information. |
This depends on the IRC server. |
Huh! Okay, I might be able to implement that in the upstream IRC library to better detect if something's gone wrong. (It still seems like a thing that should be done upstream, like a ping timer, but I'm not sure if I'll be able to get anywhere with |
So is there a better solution or workaround to this issue than the following?
and
|
We still haven't found the root cause of this issue, and the proposed (partial) workarounds haven't been implemented yet. If someone could run this with both debug flags on ( |
I'll close this for now as potentially fixed, as I haven't heard anything back in a long while here (and I haven't got enough information to be able to debug it further =/). If you have any recent connectivity issues, please get back in touch! |
So, some time last night the relay suddenly stopped working in the direction from irc->discord.
I've only been running this bot since yesterday, so I don't know if this is going to happen again, but thought I should report it.
I'm running the bot with only one channelmapping. Neither channel is very active.
The bot gave no error or info messages. Is there perhaps a debug mode I can run it in to see what happens if it should happen again?
The text was updated successfully, but these errors were encountered: