[RESOLVED] After update to Meteor - "Error: Already registered the google OAuth service"


I’ve just updated my Meteor to the newest patch and now I get the following error when starting the server.

W20170217-12:03:07.047(0)? (STDERR) C:\Users\Nuno\AppData\Local\.meteor\packages\meteor-tool\1.4.2_7\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:280
W20170217-12:03:07.048(0)? (STDERR)                                             throw(ex);
W20170217-12:03:07.049(0)? (STDERR)                                             ^
W20170217-12:03:07.049(0)? (STDERR)
W20170217-12:03:07.050(0)? (STDERR) Error: Already registered the google OAuth service
W20170217-12:03:07.051(0)? (STDERR)     at Object.OAuth.registerService (packages\oauth.js:65:11)
W20170217-12:03:07.051(0)? (STDERR)     at packages\google.js:32:7
W20170217-12:03:07.082(0)? (STDERR)     at packages\google.js:127:4
W20170217-12:03:07.083(0)? (STDERR)     at packages\google.js:139:3
W20170217-12:03:07.084(0)? (STDERR)     at C:\Meteor_Apps\App_Server\.meteor\local\build\programs\server\boot.js:295:34
W20170217-12:03:07.085(0)? (STDERR)     at Array.forEach (native)
W20170217-12:03:07.086(0)? (STDERR)     at Function._.each._.forEach (C:\Users\Nuno\AppData\Local\.meteor\packages\meteor-tool\1.4.2_7\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
W20170217-12:03:07.086(0)? (STDERR)     at C:\Meteor_Apps\App_Server\.meteor\local\build\programs\server\boot.js:128:5
W20170217-12:03:07.087(0)? (STDERR)     at C:\Meteor_Apps\App_Server\.meteor\local\build\programs\server\boot.js:344:5
W20170217-12:03:07.088(0)? (STDERR)     at Function.run (C:\Meteor_Apps\App_Server\.meteor\local\build\programs\server\profile.js:480:12)

What must I do to fix this?

Thank you

So far I’ve tried the following without much success.

Step 1:
removed google accounts related packages
meteor remove accounts-google google-config-ui

dropped loginServiceConfiguration and oauth_pendingCredentials collections from my mongodb
db.meteor_accounts_loginServiceConfiguration.drop() db.meteor_oauth_pendingCredentials.drop()
The server now boots successfully, and login is possible with accounts-password package

Step 2:
Added again google accounts related packages
meteor add accounts-google google-config-ui

Now, when I launch meteor, I get the same error again

1 Like

Found the culprit!

meteor remove percolate:google-api

Meteor now launches successfully.

Ant ideas what could be the reason for percolate:google-api causing the error?

It appears that percolate:google-api was conflicting with accounts-google by trying to register the OAuth service twice. Why are you using both; don’t they basically do the same thing?

percolate:google-api is a wrapper package to handle HTTP POST/GET requests to Google APIs, not only authentication like accounts-google

From percolate:google-api GitHub’s page

Google API

A Meteor library to interact with Google’s API.

Works with accounts-google to automatically handle refresh/access token changes and give you a simple API to make calls.

From what I was able to understand the newest Meteor has ´renamed´ the google package to google-oauth. percolate:google-api was using google package and so with this newest version both google and google-oauth packages were installed, and registering the OAuth service.

I was able to get a local version of percolate:google-api package working by changing that dependency
If you’re interested here’s the issue in github

1 Like

That looks like an issue, alright. Good call.