-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Requests 403 Client Error #11763
Comments
It seems it's getting 403 when trying to download https://raw.githubusercontent.com/bjlittle/geovista-data/2024.10.2/assets/natural_earth/physical/ne_coastlines_10m.vtk.bz2. However, I'm able to download that file without issues. I'd say it was a temporary error on the GitHub side. This doesn't seems related to Read the Docs. |
Thanks @humitos for getting back so quickly 💯 I'm able to successfully How are you replicating this issue on your side? And what are you getting? 403 also? |
Just clicking on that link, it works and download the file. |
Okay, I think this is a rate limiting related issue on the GH server side when pulling assets from GH to RTD. I'm just going to close this issue, thanks again @humitos 🍻 |
This is a persisting issue and is affecting more packages which build docs on rtd an use pooch to retrieve assets. It's hard to debug if this only happens on rtd and not locally or in other setups. What I can tell, it already fails on the first fetch of an asset, so I doubt the rate limiting theory. Here are two more links to very recent issues:
@humitos How would we get to the bottom of this? Do you see a way to debug this from your side. I was assuming some other dependency issue but did not spot any recent changes so far. One problem for debugging from user side is the missing mamba environment listing (can we activate that somehow?). |
@kmuehlbauer I don't have a different way to debug this from my side. I would recommend you first to create a minimal reproducible example that generates the issue --outside the environment of your project.
What is "mamba environment list"? If I understand correctly you refer to the list of packages installed in the environment. If that's correct, you can run |
Thanks @humitos, that's helpful. Would you mind opening the issue again, until the root cause is found? |
@humitos I've distilled the issue to just use https://github.com/readthedocs/tutorial-template and Pull Requesthttps://github.com/kmuehlbauer/pooch_rtd_issue/pulls Build logshttps://app.readthedocs.org/projects/pooch-rtd-issue/builds/26278637/ Codeoutput_file = open("output_file.nc", "w+b")
url = "https://github.com/readthedocs/readthedocs.org/raw/refs/heads/main/docs/dev/code-of-conduct.rst"
print("downloading: ", url)
try:
response = requests.get(url, timeout=30, allow_redirects=True)
response.raise_for_status()
output_file.write(response.content)
finally:
output_file.close() Something is broken between RTD and GitHub and this is as far as I can get. I'd appreciate of you could sort this out with GitHub, as this seems to be a problem of RTD builds. Thanks! |
Hrm, I just tried to reproduce this on our build servers with a shell, and I got a 200:
So it isn't something that's totally broken 🤔 |
It looks like other folks have been having a similar issue: https://stackoverflow.com/questions/39907742/github-api-is-responding-with-a-403-when-using-requests-request-function Is it related to this perhaps? |
I'm wondering if this was a temporary networking issue or something, since I can't seem to reproduce it on our build servers at all. Curious if you rebuild your test repo if it still fails? |
Hrm, I was able to reproduce it in the build... https://app.readthedocs.org/projects/eric-pooch-rtd-issue/builds/26282150/ |
I updated it to print out the error: https://app.readthedocs.org/projects/eric-pooch-rtd-issue/builds/26282177/
I guess we need to contact GitHub support 🙃 |
👋 I ran into the same problem over in the Dask docs (xref dask/dask#11522). Stack overflow suggested setting a custom Though fixing things on the GitHub side would be much more convenient : ) |
Yea, looks like the issue is the lack of a user agent. When I updated the example to pass a user agent, it works: https://app.readthedocs.org/projects/eric-pooch-rtd-issue/builds/26282216/ Guessing this is GH getting hammered by AI bots, and restricting requests without agents, like the rest of us. |
Thanks @ericholscher for testing it and @jrbourbeau for the solution. It's a pity that RTD and GitHub have to take these countermeasures, but totally reasonable and understandable. Thanks a bunch ❤️ |
@ericholscher Would it make sense to come up with a solution to provide some auth token to the request? At least for those builds which have been triggered/authorized with GitHub this might be possible for requests which reach out to GitHub resources. Any thoughts? |
For pooch the you have to define a downloader = pooch.HTTPDownloader(headers={"User-Agent": "agent"})
return REMOTE_RESSOURCE.fetch(name, downloader=downloader) |
hub is requireing a custom user now to prevent getting spammed. see readthedocs/readthedocs.org#11763
Details
Expected Result
We've successfully been using pooch to download various external assets required to build the sphinx-gallery of our documentation.
However, we're now getting a
403 Client Error
. Has there been a very recent RTD server-side change that may be causing this?Actual Result
For further details see https://readthedocs.org/projects/geovista/builds/26264004/
The text was updated successfully, but these errors were encountered: