As of yesterday, getting Error 302 with Error 54113 in body
As of yesterday, I'm getting the following response for my requests to r/subreddit/new
HTTP/1.1 302 Found
Connection: close
Content-Length: 405
Retry-After: 0
Set-Cookie: rdt=67bd19b33b3fxxxxx76c62a9a1de6e
location: [r/subreddit](/r/subreddit)/new?rdt=50895
Content-Type: text/html; charset=utf-8
Accept-Ranges: bytes
Date: Fri, 11 Aug 2023 15:01:47 GMT
Via: 1.1 varnish
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Set-Cookie: edgebucket=ovItaxxxxxcvzQHO; Domain=reddit.com; Max-Age=63071999; Path=/; secure
Cache-Control: private, max-age=3600
Server: snooserv
Report-To: {"group": "w3-reporting-nel", "max_age": 14400, "include_subdomains": true, "endpoints": [{ "url": "https://w3-reporting-nel.reddit.com/reports" }]}, {"group": "w3-reporting", "max_age": 14400, "include_subdomains": true, "endpoints": [{ "url": "https://w3-reporting.reddit.com/reports" }]}, {"group": "w3-reporting-csp", "max_age": 14400, "include_subdomains": true, "endpoints": [{ "url": "https://w3-reporting-csp.reddit.com/reports" }]}
NEL: {"report_to": "w3-reporting-nel", "max_age": 14400, "include_subdomains": false, "success_fraction": 1.0, "failure_fraction": 1.0}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>302 Found</title>
</head>
<body>
<h1>Error 302 Found</h1>
<p>Found</p>
<h3>Error 54113</h3>
<p>Details: cache-bma1661-BMA 1691766108 1890091604</p>
<hr>
<p>Varnish cache server</p>
</body>
</html>
No OAuth used and this is for a single request, which should not hit any rate limit. User-Agent is custom, according to guidelines.
Any clue what is going on?
Posted Aug 11, 2023, 3:11 PM UTC
12
302 is a redirect, not really an error. It looks like it's trying to redirect you from https://api.reddit.com/r/subreddit/new to https://api.reddit.com/r/subreddit/new?rdt=50895 , and your code isn't following the redirect, so you're getting stuck at the 302.
I'm not sure which language you're using, but there is often a parameter you can use to follow redirects automatically. Just Google "[your language] follow URL redirects".
I did follow it and it just leads me to a HTML page, not actual json which is to be expected.
You basically get the web version of whatever sub you requested.
Try yourself, on a subreddit of your choice, without being logged in.
Up until two days ago, it still gave json, as you would expect from the API.
If you post your code (with things like client secret redacted), I'd be happy to play with it and see what I can figure out.
I'd love to.
This used to work, up until a few days ago.
How are you authorizing? I assume you're sending your client credentials somehow, since when I use your exact command from above I get a 403 (forbidden) not a 302 (moved). I know you said you're not using OAuth, but what are you using?
Also, if you're not using OAuth anyway, you could try getting the JSON directly, like you can in browser: https://reddit.com/r/redditdev/new.json