Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

GitHub responded with a status of 403 #2065

Closed
muhuk opened this issue Dec 7, 2015 · 10 comments
Closed

GitHub responded with a status of 403 #2065

muhuk opened this issue Dec 7, 2015 · 10 comments

Comments

@muhuk
Copy link

muhuk commented Dec 7, 2015

I see this error in my console:

Failed to load resource: the server responded with a status of 403 (Forbidden): https://api.github.com/repos/LightTable/LightTable/tags

There is also a javascript stacktrace and it is repeating itself.

Lighttable version 0.8.0-alpha, Binary version 0.31.1.

@kenny-evitt
Copy link
Contributor

@muhuk Would you do some digging and check whether you might have exceeded the GitHub API rate limits? You should be able to run curl -i https://api.github.com/repos/LightTable/LightTable/tags and see rate limit info in special headers.

@muhuk
Copy link
Author

muhuk commented Dec 8, 2015

@kenny-evitt that's what I've seen when I visited the URL yesterday. Now I can see a list of tags.

wget -S https://api.github.com/repos/LightTable/LightTable/tags
  ....
  X-RateLimit-Limit: 60
  X-RateLimit-Remaining: 57
  X-RateLimit-Reset: 1449561436

I only had LT open and wasn't using api.github.com. Does it check tags every minute?

@kenny-evitt
Copy link
Contributor

It looks like it's running every five minutes:

(behavior ::check-version
          :triggers #{:init}
          :type :user
          :desc "App: Automatically check for updates"
          :reaction (fn [this]
                      ;;                               (when-let [proxy (proxy?)]
                      ;;                                 (.defaults request (clj->js {:proxy proxy})))
                      (when (app/first-window?)
                        (set! js/localStorage.fetchedVersion nil))
                      (check-version)
                      (every version-timeout check-version)))

The every function accepts a timeout in milliseconds and:

(def version-timeout (* 5 60 1000))

Even tho that should only result in 12 requests an hour, the GitHub API restricts unauthenticated requests more strictly:

For unauthenticated requests, the rate limit allows you to make up to 60 requests per hour. Unauthenticated requests are associated with your IP address, and not the user making requests.

I'm guessing you – or you and others sharing your IP address – exceeded the rate limit before you opened LT.

@cldwalker @rundis Should we decrease the frequency for which new versions are checked? Or maybe we need to host an LT-version service external to GitHub. Or maybe publish the latest version on the site and check that from within LT.

@rundis
Copy link
Contributor

rundis commented Dec 13, 2015

@kenny-evitt Until we start releasing way more regularly, I think the frequency can be decreased significantly, maybe every hour... or even less frequent /configurable whether you want it at all.
You still have the "check for updates" button on the about page.

@cldwalker
Copy link
Member

@kenny-evitt @rundis Decreasing the check to every hour sounds reasonable. Disabling the update behavior should be achievable by subtracting :check-version

@muhuk
Copy link
Author

muhuk commented Dec 13, 2015

I'm guessing you – or you and others sharing your IP address – exceeded the rate limit before you opened LT.

I'm the only one on this IP. But if it checks every hour and I still have this sort of problem that would definitely mean something else is using the API too. (I am not running anything that would though.)

Should we close this now?

@kenny-evitt
Copy link
Contributor

@muhuk Yeah; close this for now. You can disable the new-version check for now. Or you can build from source now and it should only check once an hour. If anyone else has this problem, we can consider other workarounds or fixes.

@muhuk muhuk closed this as completed Dec 14, 2015
@muhuk
Copy link
Author

muhuk commented Dec 14, 2015

Thanks for the fix!

@gdad-s-river
Copy link

I'm facing the same problem. But I have no idea where to disable the new version check from minutes to hours?

@kenny-evitt
Copy link
Contributor

@gdad-s-river There's nowhere to change the version-check frequency but the latest version (0.8.1) only checks once an hour instead of every five minutes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants