Skip to content
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 failing when image uploads to imgur #423

Closed
21h opened this issue Jun 28, 2024 · 6 comments
Closed

teleirc failing when image uploads to imgur #423

21h opened this issue Jun 28, 2024 · 6 comments
Assignees
Labels
bug Something isn't working Telegram Issues relating to Telegram bridge

Comments

@21h
Copy link

21h commented Jun 28, 2024

when in telegram someone posts image or group of images teleirc failing. I already tried to use my own API key but no result.

may be imgur or telegram api updated?

INFO: 2024/06/28 16:00:03 Current TeleIRC version:
INFO: 2024/06/28 16:00:03 Creating new Telegram bot client...
INFO: 2024/06/28 16:00:03 Creating new IRC bot client...
INFO: 2024/06/28 16:00:03 Starting up Telegram bot...
INFO: 2024/06/28 16:00:03 Starting up IRC bot...
INFO: 2024/06/28 16:00:04 Authorized on account IRCTelegramRetranslatorBot
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x6e8f63]

goroutine 35 [running]:
github.com/ritlug/teleirc/internal/handlers/telegram.getImgurLink(0xc00023e000, 0xc00065e0e0, 0x64, 0x0, 0x0)
/opt/teleirc/internal/handlers/telegram/imgur.go:101 +0x5a3
github.com/ritlug/teleirc/internal/handlers/telegram.uploadImage(0xc00023e000, 0x3a44274a, 0xc000128b40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/opt/teleirc/internal/handlers/telegram/helpers.go:68 +0xe5
github.com/ritlug/teleirc/internal/handlers/telegram.photoHandler(0xc00023e000, 0x3a44274a, 0xc000128b40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/opt/teleirc/internal/handlers/telegram/handler.go:162 +0x65
github.com/ritlug/teleirc/internal/handlers/telegram.updateHandler(0xc00023e000, 0xc000274a20)
/opt/teleirc/internal/handlers/telegram/handler.go:45 +0x378
github.com/ritlug/teleirc/internal/handlers/telegram.(*Client).StartBot(0xc00023e000, 0xc0002a0000, 0xc00023e040)
/opt/teleirc/internal/handlers/telegram/telegram.go:78 +0x245
created by main.main
/opt/teleirc/cmd/teleirc.go:53 +0x58d
@21h 21h added bug Something isn't working needs triage Metadata needs to be triaged and updated labels Jun 28, 2024
@Tjzabel Tjzabel added Telegram Issues relating to Telegram bridge and removed needs triage Metadata needs to be triaged and updated labels Jun 28, 2024
@Tjzabel
Copy link
Member

Tjzabel commented Jun 28, 2024

Wow that's a big issue. Thank you for submitting.

@Tjzabel Tjzabel self-assigned this Jun 28, 2024
@Tjzabel
Copy link
Member

Tjzabel commented Jun 28, 2024

@21h this will have to require more testing. I was not able to reproduce this issue.

@21h
Copy link
Author

21h commented Jun 28, 2024

ok, I added some logging and got this

body request {"errors":[{"id":"legacy-api-847cd4ffc9-nv4h6/mIS2d3TwHp-1299764","code":"429","status":"Too Many Requests","detail":"Too Many Requests"}]}

strange, I'm using my own imgur credentials wih envs:

  IMGUR_CLIENT_ID: "..."
  IMGUR_CLIENT_SECRET: "....."

@21h
Copy link
Author

21h commented Jun 28, 2024

only after use of all 4 imgur envs teleirc uploads images normally.

may be add into docs what options is minimal required?
and more logging

@Tjzabel
Copy link
Member

Tjzabel commented Jun 29, 2024

@21h you only need the IMGUR_CLIENT_ID. The main culprit seems to be the "Too Many Requests". I'm assuming imgur is getting too many requests from that particular IP range your teleirc bridge is hosted on? Doesn't seem to be an issue on our end.

@Tjzabel
Copy link
Member

Tjzabel commented Jul 25, 2024

Does not seem to be an issue with TeleIRC and I cannot reproduce this issue. Please reopen if more information is found.

@Tjzabel Tjzabel closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Telegram Issues relating to Telegram bridge
Projects
None yet
Development

No branches or pull requests

2 participants