Open jakirkham opened 5 years ago
Hi, this is expected behavior for NBViewer, not a bug. The GitHub API is such that one can only make so many requests every hour. My understanding is that Project Jupyter has a special setup with GitHub to have a higher rate limit than the default.
See also: https://github.com/jupyter/nbviewer/issues/673 https://github.com/jupyter/nbviewer/issues/855
I wonder if it would be possible for other GitHub users to "share a token" with nbviewer to avoid this issue. This would help bypass this kind of issue. Normally I think this is done by creating an app that requires some permissions to install itself on the GitHub user's account.
That may be possible. I personally don't know that much about the options/possibilities with the GitHub API.
The code implementing the backend for this is here: https://github.com/jupyter/nbviewer/blob/master/nbviewer/providers/github/client.py
NBViewer already looks for a GITHUB_API_TOKEN
via an environment variable, so perhaps it could be useful to somehow add a GUI for doing this.
Based on other issues getting NBViewer to work as expected with user-provided tokens seems like it might not be straightforward: https://github.com/jupyter/nbviewer/issues/402 https://github.com/jupyter/nbviewer/issues/478
Many users however might not have tokens which would make this useful -- I think the default rate limit for an authenticated API user is 5000 per hour, but that Project Jupyter has a special arrangement with GitHub to have a much larger rate limit than that for the NBViewer service.
Another thing to note is that right now NBViewer handles all requests for "raw" notebook files from GitHub via the GitHub provider, which uses the GitHub API and thus is affected by the rate limit: https://github.com/jupyter/nbviewer/blob/master/nbviewer/providers/github/handlers.py#L373 https://github.com/jupyter/nbviewer/blob/master/nbviewer/providers/github/handlers.py#L69
But, conceivably, if such requests were handled by the URL provider instead, it would be possible to load and render the notebook without using the GitHub API and thus without having to worry about getting throttled by the rate limit. I think the downside of this though is that it then makes it impossible to display helpful contextual information -- e.g. what repo this notebook is in, posted by which GitHub user, and then the NBViewer user can't browse around the repo or the user's profiles for similar useful notebooks. In any case that comes down more to a policy solution/decision rather than a technical one, since it is clearly technically feasible, but it nevertheless may not be desirable.
FWIW GitHub has an API around generating a token for an App and using it. Would recommend using that as opposed to dropping the token in some form somewhere.
You don't mean this then, right? https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
Since that's a GUI, not an API? (Admittedly that was all I had been familiar with previously.)
Right. Not that.
Probably you would want this : https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app
I am not sure this is related to the current issue, but links to notebooks at http://qutip.org/tutorials do not work right now.
Also https://nbviewer.jupyter.org itself gives a 503 error.
@nathanshammah I'll be honest, I've never seen that error before, and don't know what it's due to. (At least at the moment.) Definitely not good though. We should probably make it a separate issue though, just in case.
This makes a beautiful product unreliable, faced the same today. Maybe we can ask user for an Outh login and use the token for the session?
Githack is back to doing what raw git used to:
Slightly more inconvenient, but pretty much works every time.
On Thu, Nov 14, 2019, 13:02 Siddharth Gupta notifications@github.com wrote:
This makes a beautiful product unreliable, faced the same today. Maybe we can ask user for an Outh login and use the token for the session?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jupyter/nbviewer/issues/856?email_source=notifications&email_token=AAALCRAPWK6DZN3EOHJYVPLQTWHDZA5CNFSM4I6GPJNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEECXSOQ#issuecomment-554006842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALCRBGYE7SX4AJK4BNUKDQTWHDZANCNFSM4I6GPJNA .
Describe the bug
Appear to be running into a GitHub Rate Limit when using nbviewer. Not sure if it is specific to me or whether this also affects others.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Ideally this would load render the notebook.
Screenshots
Desktop (please complete the following information):