Meteor.loginWithFacebook Suddenly Producing Intermittent Timeouts when authenticating - facebook

Currently running Meteor 1.5 Release using a bundle that is deployed on our linode server. All has been ok in the past, but now in production environment when attempting to authenticate using Meteor.loginWithFacebook we are getting intermittent connection timeouts when the oauth attempts to establish the connection with Facebook server. The FB App settings appear fine. As mentioned, the logins will work most of the time but its not consistent.
We are using the popup style auth login flow.
For example: You sign in/sign out with no problem. Then repeat the same process again and its fine, and then for example you try again and it can suddenly just get hung up with a popup window trying to establish the facebook authentication.
On the server console log you will get these type of messages:
{"line":"431","file":"oauth.js","message":"Error in OAuth Server: Failed to fetch identity from Facebook. connect ETIMEDOUT 31.13.77.6:443","time":{"$date":1505065274956},"level":"warn"}
{"line":"431","file":"oauth.js","message":"Error in OAuth Server: Failed to complete OAuth handshake with Facebook. connect ETIMEDOUT 31.13.77.6:443","time":{"$date":1505065292025},"level":"warn"}
Exception in onLogin callback: Error: connect ETIMEDOUT 31.13.77.6:443
at Object.Future.wait (/var/bd/site/bd/09_09_2017_22_32_30/bundle/programs/server/node_modules/fibers/future.js:449:15)
at Object.call (packages/meteor.js:213:24)
at Object.HTTP.get (packages/http/httpcall_common.js:50:20)
at server/auth.js:48:34
at runAndHandleExceptions (packages/callback-hook.js:152:24)
at packages/callback-hook.js:159:12
at packages/accounts-base/accounts_server.js:167:5
at [object Object]._.extend.each (packages/callback-hook.js:128:15)
at AccountsServer.Ap._successfulLogin (packages/accounts-base/accounts_server.js:166:21)
at AccountsServer.Ap._attemptLogin (packages/accounts-base/accounts_server.js:356:10)
at [object Object].methods.login (packages/accounts-base/accounts_server.js:533:21)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1737:12)
at packages/ddp-server/livedata_server.js:719:19
at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
at packages/ddp-server/livedata_server.js:717:40
at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
- - - - -
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1081:14)
Please any help would be greatly appreciated. I cannot figure out why the timeout is occurring. It happens only sometimes.
Thank you!

Related

Failed to create push channel: 13006 Extended code: 0x800705b4

I'm having an issue with Flutter FCM web push notifications. Everything works perfectly fine in Chrome, but in Edge I get the following error:
Uncaught (in promise) Error: AbortError: Registration failed - push service error
at Object.createErrorWithStack (errors.dart:284:10)
at Function._throw (core_patch.dart:288:28)
at Function.throwWithStackTrace (errors.dart:108:5)
at async._AsyncCallbackEntry.new.callback (zone.dart:1413:11)
at Object._microtaskLoop (schedule_microtask.dart:40:11)
at _startMicrotaskLoop (schedule_microtask.dart:49:5)
at async_patch.dart:166:15
The issue appears to be intermittent. Sometimes it works and sometimes it doesn't. Killing Edge tasks/rebooting doesn't seem to help, but resetting network adapter - does help. The edge://push-internals shows following error:
Subscribe failed
Occurred: 3/29/2022, 12:50:38 PM PDT
Status: Failed to create push channel: 13006 Extended code: 0x800705b4
Server key: BDOU99+h67HcA6J...2xGpWwzjfAnG4=
Type: Service worker
origin: http://localhost:50000/
service-worker-registration-id: 2
The application is setup as described in
Flutter Fire Web setup and Usage.
Google search on Failed to create push channel: 13006 Extended code: 0x800705b4 returns no results, but is the key here. Anybody knows what that means?
Non-debug Edge browser log:
Connection status
Type: WinRT WNS client
Server: https://client.wns.windows.com/
State: Disconnected
Disconnected: 3/29/2022, 12:56:34 PM PDT
Disconnect reason: Connection error: 13018
Connection attempts: 0

IBM Cloud App ID' s custom identity flow:InternalOAuthError occurs

I use IBM Cloud App ID' and I want to use LinkedIn as a provider.
However, "InternalOAuthError" occurs at the time of app approving.
There is a sample on the IBM Cloud blog.
Sign In Your App Users With Any Identity Provider Using App ID
I tried the sample app along this flow. Login to LinkedIn seems to have succeeded, but the following error occurred when app was approved.
InternalOAuthError: failed to fetch user profile
at _oauth2.get (C:\xxx\AppIdCustomIdentity\node_modules\passport-linkedin-oauth2\lib\oauth2.js:70:23)
at passBackControl (C:\xxx\AppIdCustomIdentity\node_modules\oauth\lib\oauth2.js:132:9)
at IncomingMessage.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\oauth\lib\oauth2.js:157:7)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Please help!!
When I tried this post,"InternalOAuthError" no longer occurs.
But another error has occurred.
Error: Failed to obtain tokens
at Request.request [as _callback] (C:\xxx\AppIdCustomIdentity\node_modules\ibmcloud-appid\lib\token-manager\token-manager.js:118:13)
at Request.self.callback (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:185:22)
at Request.emit (events.js:182:13)
at Request.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
As suggested in this post (https://stackoverflow.com/a/56329029/10422503), looks like the passport-linkedin-oauth2 library has not been updated for the LinkedIn 2.0 APIs. Try using the fork suggested there
Looking at the stack trace it looks like the exception is coming from passport-linkedin-oauth2 module.
at _oauth2.get (C:\xxx\AppIdCustomIdentity\node_modules\passport-linkedin-oauth2\lib\oauth2.js:70:23)
Googling for InternalOAuthError: failed to fetch user profile +linkedin gives a few options you might want to try.

Meteor app crash randomly throwing a 'MongoError: server instance pool was destroyed' error

I deployed a meteor app to an AWS server using mup which used docker to deploy the app. I also used mLab sandboxed db.
The issue is, the app crashes without warning after some time. Crashing means the app still works but data won't load from the database. I have two versions of the app (staging and production) running in two different servers. But both have this issue. In the docker logs I see this error repeated a lot of times :
Exception in setInterval callback: MongoError: server instance pool was destroyed
at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:446:16)
at MongoConnection.<anonymous> (packages/meteor/helpers.js:119:1)
at MongoConnection.(anonymous function) [as update] (packages/mongo/mongo_driver.js:771:49)
at [object Object].update (packages/mongo/collection.js:589:29)
at AccountsServer.Ap._expireTokens (packages/accounts-base/accounts_server.js:1100:14)
at packages/accounts-base/accounts_server.js:1173:14
at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
at packages/meteor/timers.js:6:1
at runWithEnvironment (packages/meteor/dynamics_nodejs.js:110:1)
- - - - -
at Function.MongoError.create (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:29:11)
at basicWriteValidations (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:433:51)
at [object Object].Server.update (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:543:16)
at [object Object].Server.update (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/server.js:386:17)
at updateDocuments (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1037:19)
at [object Object].Collection.update (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1075:44)
at MongoConnection._update (packages/mongo/mongo_driver.js:560:18)
at MongoConnection.<anonymous> (packages/meteor/helpers.js:118:1)
at MongoConnection.(anonymous function) [as update] (packages/mongo/mongo_driver.js:771:49)
at [object Object].update (packages/mongo/collection.js:589:29)
Any idea what's happening?
In the client browser console, I see this error:
WebSocket connection to 'wss://oursite.com/sockjs/373/2lrpal10/websocket' failed: WebSocket is closed before the connection is established.
Updating npm-mongo and mongo fixed this for me.
meteor update --all-packages

Nodebb web app has failed to start and just crashes

I managed to install the nodebb forum very well and i was able to use it... On the next day , it failed to start and just crashes. I think my problem was that connect mongo cannot easily connect to mongodb database. probably help me look at this error.
16/2 20:26 [4171] - info: Launching web installer on port 4567
events.js:72
throw er; // Unhandled 'error' event
Error: listen EADDRINUSE
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1043:14)
at listen (net.js:1065:10)
at Server.listen (net.js:1139:5)
at EventEmitter.listen (/home/goldsoft25/Desktop/NodeJS/NodeBB-master/node_modules/express/lib/application.js:617:24)
at launchExpress (/home/goldsoft25/Desktop/NodeJS/NodeBB-master/install/web.js:53:15)
This is a very common error for any of application running on top of node. Both applications are pointing to same port, 4567 in your case .
You will have to change the port of one application or kill application when swapping between each app.

MeteorJS email configuration SSL

I am trying to send emails from Meteor JS and took the simplest approach found in the documentation. However, sending fails and I get the following stack trace:
Exception while invoking method 'sendEmail' Error: connect ETIMEDOUT
at Object.Future.wait (/usr/lib64/meteor/lib/node_modules/fibers/future.js:322:15)
at smtpSend (app/packages/email/email.js:69:43)
at Object.Email.send (app/packages/email/email.js:111:7)
at Meteor.methods.sendEmail (app/server/email.js:7:11)
at _.extend.protocol_handlers.method.exception (app/packages/livedata/livedata_server.js:593:30)
at _.extend.withValue (app/packages/meteor/dynamics_nodejs.js:33:19)
at app/packages/livedata/livedata_server.js:592:46
at _.extend.withValue (app/packages/meteor/dynamics_nodejs.js:33:19)
at _.extend.protocol_handlers.method (app/packages/livedata/livedata_server.js:591:37)
at _.extend.processMessage.processNext (app/packages/livedata/livedata_server.js:484:43)
- - - - -
at errnoException (net.js:770:11)
at Object.afterConnect [as oncomplete] (net.js:761:19)
I provide my email settings in bootstrap.js in the server folder via this line:
process.env.MAIL_URL = "smtp://user#gmail.com:password#smtp.googlemail.com:465"
I am pretty sure I also have to switch on SSL somewhere, but I do not know how (I could probably use Node's email.js alone).
Found it myself - it was not the lack of setting the SSL option, but the first '#gmail.com' in MAIL_URL. The correct line is:
process.env.MAIL_URL = "smtp://user:password#smtp.googlemail.com:465"