Skip to content
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

renew GitHub access token ahead of time to prevent "Bad credentials" crashes #238

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

trz42
Copy link
Contributor

@trz42 trz42 commented Jan 29, 2024

The job manager crashes too often. An expired GH access token could be the reason for a crash with the error

github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}

Such messages were reported in issue #142

This PR attempts to prevent such crashes by renewing the GH access token before it has actually expired. Normally, it's valid for an hour. With this PR it will be renewed if it is valid for less than 30 minutes. Hence, there should be more time from actually checking the validity of the token and using it.

@trz42 trz42 added the bug label Jan 29, 2024
@boegel boegel changed the title renew GH access token ahead of time to prevent Bad credentials crashes renew GitHub access token ahead of time to prevent Bad credentials crashes Jan 29, 2024
@boegel boegel changed the title renew GitHub access token ahead of time to prevent Bad credentials crashes renew GitHub access token ahead of time to prevent "Bad credentials" crashes Jan 29, 2024
Copy link
Contributor

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel boegel merged commit fd05f81 into EESSI:develop Jan 29, 2024
7 checks passed
This was referenced Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants