Facebook-accounts is dead!

@abernix thank for your reply. Unfortunately METEOR_LOG=debug does not add anything new to the error message.

Since the error message is OAuth related, I checked in .meteor/versions of my project. Does this look copacetic? Google login works, btw.

Ā± grep oauth .meteor/versions 
accounts-oauth@1.1.15
facebook-oauth@1.3.0
google-oauth@1.2.0
oauth@1.1.13
oauth2@1.1.11

OK, I have another project on my dev server that uses the exact same packages and can FB OAuth just fine. This must be something else.

Case solved. I was still using ā€˜user_friendsā€™ permission, which has been deprecated.

Accounts.ui.config({
  requestPermissions: {
    facebook: [
      'email','user_location', 'user_friends', 'read_friendlists'
    ]
});
1 Like

Awesome! Glad you got it to work.

Hi I encounter this problem today and i already tried what @abernix said and still the facebook login is not working is there any thing i missed ?

Itā€™s more likely that someone will be able to help you if you provide some information for us to work with (e.g. versions of Meteor, accounts-* packages, environments, client, etc.).

Hi Im sorry for lack of info

My meteor version is 1.4.3.2
and this is my pacakges version
accounts-facebook@1.0.12
facebook-oauth@1.3.0

last time I check its working then i stumble with this thread

If youā€™re on Meteor 1.4.3.2, you should not be using accounts-facebook@1.0.12 (which is for Meteor 1.4.2.x).

Try updating to accounts-facebook@1.1.1 and facebook-oauth@1.3.0 and if you still have problems, please provide the error messages youā€™re receiving.

Hi I followed what you said and Iā€™m still having this error

Error: Login Failed [500]

that is the only error message i got on the callback from my code

    Meteor.loginWithFacebook({
      loginStyle: "popup" ,
      requestPermissions: ['email']
    }, function (err) {
      if (err) {
        console.log("error when login with facebook " + err);
      } else {
        let user = Meteor.user();
        if(user.profile.newReg){
          Store.dispatch({
            type: "MODAL_TOGGLE",
            mode: {
              open: false,
              component: "newReg"
            }
          });
        }else{
          browserHistory.push("/menu");
        }
      }
    });

I already did a meteor reset before updating the package

Hi @abernix its ok now i have manage to work it out thanks

Ahhh I think this worked. Thank you @crsssl and fede-rodes!

I am also having this issue but only when is deployed to galaxy. I have updated my project to 1.4.3.2 and ensure packages are up to date. That resolved the issue of facebook auth locally but when I deploy to galaxy it still throws the same error, as anyone seen this before?

What is the ā€œsame errorā€? Can you provide it to us so we can help you diagnose the problem?

I wish the title of this thread was ā€œā€˜accounts-facebookā€™ is not working for me!ā€ :slight_smile:

Sorry! i thought i pasted the stacktraceā€¦ here is the error:

2017-04-07 16:19:45+08:00{"line":"398","file":"oauth_server.js","message":"Error in OAuth Server: Failed to complete OAuth handshake with Facebook. {\"access_token\":\"HkbHKnbJ9BB8IZAgVgDlXHwtD0jSTouhjHUWMMLQqOhiZClU5mneX6QZDZD\",\"token_type\":\"bearer\"}","time":{"$date":1491553185756},"level":"warn"}
13jd
2017-04-07 16:19:49+08:00
13jd
2017-04-07 16:19:49+08:00/app/bundle/programs/server/node_modules/fibers/future.js:313
13jd
2017-04-07 16:19:49+08:00	throw(ex);
13jd
2017-04-07 16:19:49+08:00	^
13jd
2017-04-07 16:19:49+08:00MongoError: no primary found in replicaset
13jd
2017-04-07 16:19:49+08:00 at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15)
13jd
2017-04-07 16:19:49+08:00 at new MongoConnection (packages/mongo/mongo_driver.js:211:27)
13jd
2017-04-07 16:19:49+08:00 at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
13jd
2017-04-07 16:19:49+08:00 at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
13jd
2017-04-07 16:19:49+08:00 at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
13jd
2017-04-07 16:19:49+08:00 at new Mongo.Collection (packages/mongo/collection.js:99:40)
13jd
2017-04-07 16:19:49+08:00 at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
13jd
2017-04-07 16:19:49+08:00 at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
13jd
2017-04-07 16:19:49+08:00 at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
13jd
2017-04-07 16:19:49+08:00 at fileEvaluate (packages/modules-runtime.js:197:9)
13jd
2017-04-07 16:19:49+08:00 - - - - -
13jd
2017-04-07 16:19:49+08:00 at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/replset.js:524:28
13jd
2017-04-07 16:19:49+08:00 at [object Object].<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/replset.js:303:24)
13jd
2017-04-07 16:19:49+08:00 at [object Object].g (events.js:260:16)
13jd
2017-04-07 16:19:49+08:00 at emitOne (events.js:77:13)
13jd
2017-04-07 16:19:49+08:00 at [object Object].emit (events.js:169:7)
13jd
2017-04-07 16:19:49+08:00 at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:297:14
13jd
2017-04-07 16:19:49+08:00 at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:455:18
13jd
2017-04-07 16:19:49+08:00 at nextTickCallbackWith0Args (node.js:489:9)
13jd
2017-04-07 16:19:49+08:00 at process._tickCallback (node.js:418:13)
13jd
2017-04-07 16:19:50+08:00Application exited with code: 1
13jd
2017-04-07 16:20:00+08:00The container has crashed. A new container will be started to replace it.

@juniobranco The service configuration for your Facebook login is stored in the meteor_accounts_loginServiceConfiguration collection in your Mongo database. The following error indicates that your Meteor application cannot talk to your Mongo database server:

Therefore, authentication with Facebook is failing because it has no access to your appId and secret (key) which are stored in the database. You should check your MONGO_URL and make sure that itā€™s matching up properly with what your database provider (for example, Compose.io or mLab) has given you. Assuming you restore your database connection, I would expect your Facebook authentication to begin working again.

Thanks @abernix, I also thought mght be related to the connection to MongoDB but i tested other parts of my website where it inserts documents to mongodb and it works fine.

No errors in the logs neither when retrieved those documents.

I will double check the url once I am back home

I got the URL from compose although there isnā€™t any error from MongoDB I am still having the following error:

2017-04-07 23:15:41+08:00{"line":"398","file":"oauth_server.js","message":"Error in OAuth Server: Failed to complete OAuth handshake with Facebook. {\"access_token\":\"EAAVZASLySPAgBALUciGInDLiPHHBf60DgcoxEyz2jZBvSsVlJXjy7ZCyUsYoa0fJMRPelV1YVBIUCm1OJZCN372VTBi6APvN1hpweW4L85FyOb8Us735qfp9pNjb7LOrhnQGm4Tv2i567ofCwKHXtHf0kVwZAnqkZD\",\"token_type\":\"bearer\"}","time":{"$date":1491578141315},"level":"warn"}
2yt9
2017-04-07 23:15:43+08:00Split Start {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00Split Done {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00Shuffling Start {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00Shuffling Done {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00text
2yt9
2017-04-07 23:15:43+08:00Logic Start {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00Tag Start {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00Tag Stop {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:43+08:00Logic Stop {} Fri Apr 07 2017 15:15:43 GMT+0000 (UTC)
2yt9
2017-04-07 23:15:44+08:00Exception while invoking method 'login' Error: Failed to complete OAuth handshake with Facebook. {"access_token":"EAAVZASLySPAgBALUciGInDLiPHHBf60DgcoxEyz2jZBvSsVlJXjy7ZCyUsYoa0fJMRPelV1YVBIUCm1OJZCN372VTBi6APvN1hpweW4L85FyOb8Us735qfp9pNjb7LOrhnQGm4Tv2i567ofCwKHXtHf0kVwZAnqkZD","token_type":"bearer"}
2yt9
2017-04-07 23:15:44+08:00 at getTokenResponse (packages/facebook/facebook_server.js:71:1)
2yt9
2017-04-07 23:15:44+08:00 at Object.isJSON [as handleOauthRequest] (packages/facebook/facebook_server.js:8:1)
2yt9
2017-04-07 23:15:44+08:00 at OAuth._requestHandlers.(anonymous function) (packages/oauth2/oauth2_server.js:8:1)
2yt9
2017-04-07 23:15:44+08:00 at middleware (packages/oauth/oauth_server.js:173:1)
2yt9
2017-04-07 23:15:44+08:00 at packages/oauth/oauth_server.js:146:1

Not really sure why this is an issueā€¦

Thank for your help!
I solved my problem by forking accounts-facebook and facebook-oauth packages to upgrade facebook api version 2.8.