-
Notifications
You must be signed in to change notification settings - Fork 105
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
Unable to get past environment creation with newEnv - "Failure refreshing token from accounts.google.com/o/oauth2/v2/auth" #54
Comments
Thanks for raising, will investigate this m the morning! |
thanks for lightning-fast response @brendanhay ! |
The only thing I can recommend immediately is to try out develop, a couple of fixes for tolen refresh were merged recently that haven't made it onto Hackage. |
tried digging deeper, this seems to be likely culprit: https://github.com/brendanhay/gogol/blob/develop/gogol/src/Network/Google/Auth/ServiceAccount.hs#L70-L77 Tried adding "response_type" and "redirect_uri", but then the endpoint complained about lack of "scope" attribute, but those do not seem to be available at that place in code. The relevant doc for this endpoint seems to require these attributes to be populated: https://developers.google.com/identity/protocols/OAuth2UserAgent |
also, this is the minimal example I am trying to get working: https://github.com/ababkin/gogol-test |
so apparently this fixes it: #55 |
Thanks for working through this and providing a fix! Much appreciated. |
Looks like this one is not over: This fixed the issue on my OSX Sierra, but rears its head on CircleCI environment.
This is clearly due to environment differences. Does anyone have ideas what specifically could those differences be? Or point me in the right direction? |
thanks @CthulhuDen - looks like this fixed it for me! |
Can confirm this is fixed in develop for me too. |
@brendanhay, @CthulhuDen: I just ran into the problem #57 addresses. Do you suppose you could cut a bugfix release for this? |
This happens when I run the provided example: https://github.com/brendanhay/gogol/tree/develop/examples/src/Example
I have credentials setup by
gcloud
in my~/.config/gcloud/application_default_credentials.json
as per default.getting this runtime error (when executing the newEnv line):
TokenRefreshError (Status {statusCode = 400, statusMessage = "Bad Request"}) "Failure refreshing token from accounts.google.com/o/oauth2/v2/auth" Nothing
Observation: logger does not log anything, even though I used Debug/Trace mods and looking at the code (https://github.com/brendanhay/gogol/blob/develop/gogol/src/Network/Google/Internal/Auth.hs#L288-L289) it should be logging things.
I've tried printing the offending request and response and here is what i found:
Response:
viewing this response in a browser tells the following story:
The text was updated successfully, but these errors were encountered: