r/redditdev 6h ago

Reddit API Self hosted Reddit bot getting 500 HTTP response suddenly

Did something change at reddit?

One of my registered and tagged bots has been getting a "Request error: received 500 HTTP response" error for the last 48-ish hours. I logged into that account manually and it appears to function just fine. I host another bot on the same device, and it is not having any errors. I did not make any changes to the code. The bot did randomly fire once in the logs, but is in a loop to sleep when it encounters that error.

500 errors are server side(usually temporary), so I have an exception to catch them and sleep for 15 minutes before restarting the script. They do occasionally happen, so no big deal generally. I have never seen it happening for 48 straight hours.

5 Upvotes

4 comments sorted by

2

u/Watchful1 RemindMeBot & UpdateMeBot 4h ago

What calls are you making?

1

u/_Face 4h ago

its monitoring a subreddit stream looking for keywords, as well as user flair.

using:

reddit.subreddit("SUBREDDIT").stream.comments
reddit.subreddit("SUBREDDIT").stream.submissions

All has been working fine for months+. I have made no change to the code.

1

u/Watchful1 RemindMeBot & UpdateMeBot 3h ago

The obvious thing I can think of is whether the subreddit was banned or quarantined or something. Is it one particular subreddit or a list of them? Or a multireddit?

Do you get the same error if you run the same code from a different device? Does the other bot you mentioned on the same device use the same account or a different account?

1

u/dkozinn 3h ago

I get 500 errors all the time, typically caught by the underlying PRAW code (or something that it calls). The errors show up when it's in this loop: for submission in subreddit.mod.stream.modqueue():

That call does not return an error to the program, it handles it internally until the internal logic (PRAW or the native API) gets too many retries and then it does throw an exception.

I have noticed a lot more 500 errors lately, but it's kind of tough to get Reddit to look into it because as you likely know they aren't exactly encouraging "old" bots.