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

InternalOAuthError "message": "failed to fetch user profile" #111

Open
jjchando opened this issue Jan 27, 2016 · 2 comments
Open

InternalOAuthError "message": "failed to fetch user profile" #111

jjchando opened this issue Jan 27, 2016 · 2 comments

Comments

@jjchando
Copy link

We've been using this module for a couple years now with no issues. All of a sudden over the past 24-48 hours without any code changes we've seen a huge amount of errors like these repeatedly.

/api/v2/login/google/return{
   "name": "InternalOAuthError",
   "message": "failed to fetch user profile",
   "oauthError": {
       "statusCode": 500,
       "data": "{\n \"error\": {\n  \"errors\": [\n   {\n    \"domain\": \"global\",\n    \"reason\": \"backendError\",\n    \"message\": \"Backend Error\"\n   }\n  ],\n  \"code\": 500,\n  \"message\": \"Backend Error\"\n }\n}\n"
   }
}

Also

/api/v2/login/google/return{
   "name": "InternalOAuthError",
   "message": "failed to obtain access token",
   "oauthError": {
       "statusCode": 400,
       "data": "{\n  \"error\" : \"invalid_grant\",\n  \"error_description\" : \"Code was already redeemed.\"\n}"
   }
}

Anyone have any ideas? Thanks.

@danvk
Copy link

danvk commented Mar 7, 2016

I was getting a similar error:

InternalOAuthError: failed to fetch user profile
    at /Users/danvk/github/better-mobility/node_modules/passport-google-oauth2/lib/oauth2.js:92:28

I went to that file and console.log'd the err object. It spit this out:

{ statusCode: 403,
  data: '{\n "error": {\n  "errors": [\n   {\n    "domain": "usageLimits",\n    "reason": "accessNotConfigured",\n    "message": "Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",\n    "extendedHelp": "https://console.developers.google.com"\n   }\n  ],\n  "code": 403,\n  "message": "Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration."\n }\n}\n' }

That's a much more helpful error message! Maybe try something similar?

passport-google-oauth should do a better job of surfacing this error.

@TinyDobbins
Copy link

got same error:

InternalOAuthError: Failed to fetch user profile (status: 500 data: {
 "error": {
  "code": 500,
  "message": null
 }
}
)
    at /var/www/node_modules/passport-google-oauth20/lib/strategy.js:99:19
    at passBackControl (/var/www/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage.<anonymous> (/var/www/node_modules/oauth/lib/oauth2.js:157:7)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

package: passport-google-oauth@1.0.0

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

No branches or pull requests

3 participants