#503 Service Unavailable

1 messages · Page 1 of 1 (latest)

stone basin
#

Keep getting this error after a few days of the bot running on my vps. Bot stops responding/performing tasks afterwards. Any ideas why this happens and how to fix it?

Unhandled exception in internal background task 'update_channels'.
Traceback (most recent call last):
  File "/root/Cozyfications/cozyfications-venv/lib/python3.12/site-packages/discord/ext/tasks/__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "/root/Cozyfications/Cozyfications/bot/cogs/tasks.py", line 29, in update_channels
    await notify_guilds(twitch_channel=twitch_channel, bot=self.bot)
  File "/root/Cozyfications/Cozyfications/bot/cogs/tasks.py", line 81, in notify_guilds
    await message.edit(embeds=embeds)
  File "/root/Cozyfications/cozyfications-venv/lib/python3.12/site-packages/discord/message.py", line 1520, in edit
    data = await self._state.http.edit_message(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/Cozyfications/cozyfications-venv/lib/python3.12/site-packages/discord/http.py", line 371, in request
    raise DiscordServerError(response, data)
discord.errors.DiscordServerError: 503 Service Unavailable (error code: 0): upstream connect error or disconnect/reset before headers. reset reason: connection termination
mossy venture
#

I'd guess your VPS terminates the connection

#

Don't count on me though. Its just a guess from the error

honest mica
#

500 range status indicates discord issue

#

not your problem

sacred linden
# honest mica not your problem

No, but is there some way of catching and attempting to reconnect? I get this occasionally as well, and noticing it hours after the fact because of some discord or cloudflare hiccup is frustrating. Would be cool to see it try to reconnect

honest mica
#

i don't think it'd be a great idea because 503 is supposed to indicate something just isn't working or is shut down (thus 'Service Unavailable')

#

but this has been happening quite a bit recently

#

maybe @gloomy solar would have a different opinion

#

if she wasn't playing vrchat

stone basin
#

Was the 4th time in the last 2 weeks. Having to realize the bot is down and then restart it manually sucks

gloomy solar
gloomy solar
#

shits exploding at discord p often rn

#

mostly the databases

sacred linden
sacred linden
stone basin
#

@opal berry pretty sure it’s this

opal berry
stone basin
#

If I have time I might create a pr later

#

Im not 100 % sure if I’d like this to be handled by the lib tho

#

Ig it could raise the exception and then try to restart the bot up to 3 times or whatever

#

@gloomy solar that fine for you?

opal berry
gloomy solar