-
Notifications
You must be signed in to change notification settings - Fork 0
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
403 Client Error: Forbidden for url: https://readthedocs.org/api/v3/projects/?limit=100 #7
Comments
Hrmm. I added the Will revisit this later next week |
I am getting this as well. Probably related to readthedocs/readthedocs.org#11763 (which you did find in the PR) |
How to add the user agent to the read the docs CLI? |
The restriction on |
Cannot reproduce it locally so I wonder what the error is. Is there a way to add more logging? |
I'm testing just using It returns 403 unless I specifically installed |
Pinned urllib3>=2.0.0 in a8771b1 and test dry run was successful (Although includes a requests dependency warning, so we might need to pin |
RTD support staff pointed me to this readthedocs/readthedocs.org#11753 as a potential issue |
Support staff also shared this
|
Thanks for that info, @dmundra. Pretty disappointed that they'd implement checks they don't understand. I guess we get to throw stuff at the wall and see what sticks. |
I wonder if the urllib3 upgrade @joverlee521 found to work is because Cloudflare's "browser integrity checks" include things like TLS cipher suites advertised by the client (us) and/or OpenSSL version and/or some other fingerprinting. |
It's not entirely clear _why_ this works, but using urllib3>=2.0.0 avoids the 403 Client error.¹ Adding minimum version for `requests` the first version that officially supports urllib3 v2.² ¹ <#7 (comment)> ² <https://github.com/psf/requests/releases/tag/v2.30.0>
We're getting an old version of I can reproduce the 403 locally by using that same I captured a failing request and successful request as generated by I also decrypted the HTTP response for the failing request and sure enough, it's a Cloudflare "browser challenge" page that requires JS to execute. |
Using urllib3>=2.0.0 to avoid the 403 Client error.¹ Adding minimum version for `requests` the first version that officially supports urllib3 v2.² See @tsibley's comment on _why_ upgrading `urllib3` resolved the 403 Client error.³ ¹ <#7 (comment)> ² <https://github.com/psf/requests/releases/tag/v2.30.0> ³ <#7 (comment)>
Thank you @tsibley and @joverlee521. Will there be a new release for the cli for this? |
@dmundra Should be! @joverlee521 I'm happy to cut a new release if you're not, or happy to let you do it if you'd like. |
@tsibley I just pushed up the v5 tag, but I don't have twine/PyPi set up. Could you build and push? |
@joverlee521 Done! @dmundra This is released in version 5, available on PyPI as of now. |
Awesome. Thank you! |
Context
First seen in https://github.com/nextstrain/docs.nextstrain.org/actions/runs/12056254066/job/33618372098?pr=238
However, I cannot reproduce locally, so it must be specific to the GH Action environment.
Possible solution
I was able to resolve a 403 Client Error in the docs build by adding the a
User-Agent
to the request session (nextstrain/docs.nextstrain.org@c561b61), but unclear to me if this is the same issue.The text was updated successfully, but these errors were encountered: