-
Notifications
You must be signed in to change notification settings - Fork 45
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
TeleIRC crashing #434
Comments
@BigErn77 does TeleIRC consistently fail when a message is being sent over? Normally the only time we see the Is this error reproducible for you, or does it seem to happen at random times? Try running TeleIRC with:
|
@Tjzabel Well I just ran teleirc with the debug switch and got the error immediately: biger@aceraspireone MINGW64 /c/dev/src/teleirc (main) goroutine 7 [running]: biger@aceraspireone MINGW64 /c/dev/src/teleirc (main) Usually what happens at this point, is I just run it again and it works without crashing. For an hour or so, then it crashes. |
@BigErn77 It looks like IRC is hooking up just fine with all the handlers being properly registered. For more information, are there messages being sent to kick off those messageHandlers? The photo handler was also triggered. I don't see a connectHandler, nor a joinHandler. This is possibly still pointing towards a potential misconfig. Have you tried connecting your bridge to a fresh (similarly configured) IRC channel, and TG group? The two stack traces you posted are not consistent, making this a little more difficult to debug. The first errors out trying to create a Telegram message, while the second one crashes on grabbing the imgur link from the photo handler, both Telegram related. Double check everything you need configured is set up properly: https://docs.teleirc.com/en/latest/user/config-file-glossary/ |
For example, here are the beginning logs from our TeleIRC bridge running on our Telegram group, and respective IRC channel:
|
Right after I got the error I posted, I immediately ran it again and got the exact same error. Then I immediately ran it again and it works, as is typical in my experience, and I see the connectHandler and joinHandler and messageHandler in the log: $ ./teleirc -debug=true Is there a way to catch the error and log it, rather than failing to the command line? |
I determined that the crash is happening when a message containing a picture is sent in the Telegram group. It crashes on the getImgurLink method. DEBUG: 2025/02/07 00:00:18 photoHandler triggered goroutine 20 [running]: |
I added this code snippet just before line 101 in imgur.go, and now it doesn't crash anymore. I do see that message that I'm logging in the logs, so evidently that response data was null, why would that be the case?:
|
I finally got it to work correctly by creating and using my own Imgur API Client ID. I can only guess that anonymous uploading starting throttling me after so many pic uploads? In any case, the program shouldn't crash when that happens. |
Great! Yes the anonymous imgur API will throttle, which is why we recommend generating your own client ID. I appreciate your patience in debugging! I will add more error handling around checking the response to ensure crashes don't happen in the future. |
I get these errors a lot. Usually I can just run teleirc again and it starts fine. But after an hour or so it crashes with the same error.
$ ./teleirc
INFO: 2025/02/05 00:31:18 Current TeleIRC version: v2.3.0-10-g0af3dfe
INFO: 2025/02/05 00:31:18 Creating new Telegram bot client...
INFO: 2025/02/05 00:31:18 Creating new IRC bot client...
INFO: 2025/02/05 00:31:18 Starting up Telegram bot...
INFO: 2025/02/05 00:31:18 Starting up IRC bot...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x10e839f]
goroutine 23 [running]:
github.com/go-telegram-bot-api/telegram-bot-api.(*BotAPI).MakeRequest(0x0, {0x11e77c1, 0xb}, 0xc0002c7a70)
C:/Users/biger/go/pkg/mod/github.com/go-telegram-bot-api/telegram-bot-api@v4.6.4+incompatible/bot.go:64 +0x7f
github.com/go-telegram-bot-api/telegram-bot-api.(*BotAPI).makeMessageRequest(, {, }, )
C:/Users/biger/go/pkg/mod/github.com/go-telegram-bot-api/telegram-bot-api@v4.6.4+incompatible/bot.go:119 +0x7b
github.com/go-telegram-bot-api/telegram-bot-api.(*BotAPI).sendChattable(, {, })
C:/Users/biger/go/pkg/mod/github.com/go-telegram-bot-api/telegram-bot-api@v4.6.4+incompatible/bot.go:343 +0xd0
github.com/go-telegram-bot-api/telegram-bot-api.(*BotAPI).Send(, {_, _})
C:/Users/biger/go/pkg/mod/github.com/go-telegram-bot-api/telegram-bot-api@v4.6.4+incompatible/bot.go:274 +0xb8
github.com/ritlug/teleirc/internal/handlers/telegram.(*Client).SendMessage(0xc0001cce80, {0xc0002410c0?, 0xc000305c50?})
C:/dev/src/teleirc/internal/handlers/telegram/telegram.go:37 +0xc8
github.com/ritlug/teleirc/internal/handlers/irc.Client.SendToTg(...)
C:/dev/src/teleirc/internal/handlers/irc/irc.go:123
github.com/ritlug/teleirc/internal/handlers/irc.disconnectHandler.func1(0xf232cf?, {0x0, 0x0, {0x0, 0x0, 0x0}, {0x11eae0f, 0x13}, {0xc000289260, 0x1, ...}, ...})
C:/dev/src/teleirc/internal/handlers/irc/handlers.go:105 +0x124
github.com/lrstanley/girc.HandlerFunc.Execute(0xe665e9?, 0xc000305e00?, {0x0, 0x0, {0x0, 0x0, 0x0}, {0x11eae0f, 0x13}, {0xc000289260, ...}, ...})
C:/Users/biger/go/pkg/mod/github.com/lrstanley/girc@v0.0.0-20190801035559-4fc93959e1a7/handler.go:67 +0x43
github.com/lrstanley/girc.(*Caller).exec.func1(0x0)
C:/Users/biger/go/pkg/mod/github.com/lrstanley/girc@v0.0.0-20190801035559-4fc93959e1a7/handler.go:231 +0x3d8
created by github.com/lrstanley/girc.(*Caller).exec in goroutine 8
C:/Users/biger/go/pkg/mod/github.com/lrstanley/girc@v0.0.0-20190801035559-4fc93959e1a7/handler.go:209 +0x61b
The text was updated successfully, but these errors were encountered: