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
Authentication fails with a 500 internal server error #5978
Comments
Hi, sorry to hear that you're unable to log in! I've never heard of this issue before. Are you saying that when you enable verbose logging, the last response from the server is definitely a HTTP 200 and looks like this?
|
That is correct, here's the relevant excerpt from the logs:
|
OK, thank you! I will investigate on the platform end. The workaround you can try is to use the GitHub web interface to generate a Personal Access Token with |
@nint8835 Does the |
Doing this doesn't work either, but in this case I actually see a 500 show up in the logs
Yes, it does. The error only shows up in the terminal after I've gone through the authorization flow and reach the screen saying my device is connected. |
Oh wow that is really strange. So both OAuth tokens and PATs (personal access tokens) are rejected for your account by the GitHub API. And this seems to be affecting someone else you've spoken with as well? Was there a JSON body as part of the |
Correct, at least one of my coworkers is running into the exact same issue with the same behaviour as me for both the PAT method and the OAuth method
Is the JSON body supposed to show up in the debug output? If so, doesn't seem there was any body in the response |
Often there is a JSON body response for HTTP errors, but sometimes not. If nothing was shown for you, then the body was empty, which can sometimes happen with HTTP 500 requests. Thank you for checking 🙇 |
@nint8835 If you could share some request IDs, that would help us a lot. When enabling |
Final 200 from browser flow: |
Thanks, we've been able to track down the bug. Do you have the TZ environment variable set by any chance? In any case, you might be able to temporarily work around your issue by setting |
Thanks, that did the trick! As for the TZ environment variable, I don't have it set. I took a quick look at the timezone code out of curiosity and my immediate guess is something with the timezone detection code in the The |
Thanks for debugging that. I wonder whether the -2.5h vs -3.5h discrepancy could be because of Daylight Saving Time? In any case, we will make a change to not send any |
I'm pretty sure that's the case. I took a look into it and I think the reason this hasn't been encountered previously / hasn't been encountered that often is that the vast majority of timezones will still resolve to a value even during DST. If my quick pass through the values are correct, there are 3 timezones where it'll correctly resolve to a value when DST is not in effect and will not resolve to a value when DST is in effect. These time zones are:
|
Describe the bug
When attempting to log in via
gh auth login
, logging in is failing with a 500 internal server error. I first ran into this today, but someone else I spoke to has reported he's been running into this for a week now.I've attempted debugging with
GH_DEBUG=api
, but I see no actual 500s being returned. The last request I see before the error message is a call tohttps://github.com/login/oauth/access_token
, which according to the logs returned a 200 OK.Apologies for the lack of details - if there's any way I can get any other details to help troubleshoot this I'd be more than happy to provide them.
Version:
Steps to reproduce the behavior
gh auth login
Expected vs actual behavior
Expected: Login would be successful
Actual: Login fails with an internal server error
Logs
The text was updated successfully, but these errors were encountered: