-
Notifications
You must be signed in to change notification settings - Fork 953
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
401 Unauthorized errors every hour #637
Comments
Having read a bit more through Application construction, the simplest fix for me would be to have the installationToken cache ttl customiseable: Line 200 in 80fc41a
I would reduce this to ~ 5 min before expiry and it would fix my issues. |
I'm definitely not opposed to adding an env option here, but I'm wondering what is happening in your app that takes 2 minutes?
We have some pretty complex apps and we've yet to run into this issue. 🤔 I'll jump into the PR now. |
@hiimbex if you're interested in the actual scenario: one of the things my app does is check whether commit status is At work we use Concourse CI, which takes significantly longer to start. Unless I delay API actions, there's a window where the commit status has some CI passed, and some CI not started, and would cause incorrect app behaviour.
|
@tommilligan iam getting this error for every event in Google cloud functions , do you have any solution ? |
If it's for every event, it sounds like you have bad credentials, or all of your events take longer than an hour to process. If you have a minimal reproducible example I can take a look |
@tommilligan can you check with latest Probot ( |
@gr2m could you clarify what your request is here? The issue is closed (I merged a PR a while ago), and I haven't experienced this issue since |
All good then, sorry for the noise :) I keep having the "Bad credentials" errors from time to time with the WIP app, and upgrading to Probot 8 beta helped reduce these drastically. So I thought I’d let you know. But if you don’t see them at all anymore then don’t worry about it |
🎉 This issue has been resolved in version 7.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@tommilligan the custom Let me know if you see a problem with removing the environment variable
|
Thanks for the update! I don't see any issue with removing the environment variable. I no longer maintain the app I built (although I hear it's still kicking at my old workplace). Happy to see probot is still actively developed 🙂 |
Bug Report
https://github.com/tommilligan/prowl-github-app/
Current Behavior
I have a probot app running full time on AWS. The app
Occasionally, I get
401 Unauthorized
errors back from the API when performing actions:These errors always happen at the same point in the hour - e.g. for a single instance, at 10:05, 11:05, 14:05 and 21:05.
I suspect this is because in the ~2 min check time, the OAuth token attached to the event
context
expires. This then results in unauthorized requests when callingcontext.github
. New events are received with valid tokens, which do not error.Expected behavior/code
Not to get
Unauthorized
errors sproradicallyEnvironment
Possible Solution
Requests to either:
Unauthorized
, refresh access token and retryAdditional context/Screenshots
The text was updated successfully, but these errors were encountered: