Meteor loggingIn stuck on true even though user is logged in

Its now been 72 hours since I last saw the issue. It seems to have stopped after upgrading my Atlas cluster. Could be a coincidence, or could be the following:

  • Caused by an issue with the Cluster that upgrading fixed by recreating the Cluster
  • Caused by an issue due to limited RAM or CPU
  • Caused by an issue due to throttled/limited network

Again, this is all speculation, but after previously seeing the issue on a daily basis I haven’t seen it once after upgrading my Atlas cluster

@peterfkruger, when I was having the issue, I looked inside the websocket message logs. All the methods and subscriptions that were called by the client received a result/ready response. Maybe something is going wrong on the client side?

I’m using this code to detect the issue on the client side then sending a push via RESt to a monitoring server:

  Accounts.onLogin(() => {
    if(Meteor.loggingIn()) {
      window.setTimeout(() => {
        if(Meteor.loggingIn()) {
          // Report
        }
      }, 2000);
    }
  });

Thanks to this, I have confirmed that the issue seems to still be present.

I have opened an issue on the Meteor GitHub repo: Meteor logged in but Meteor.loggingIn() stuck on true / initial login method works but subsequent methods never complete · Issue #11323 · meteor/meteor · GitHub

Then we’re possibly having different issues, after all.

In @andregoldstein’s app we’ve built in a wrapper around every Meteor.call similar to your code monitoring unsuccessful logins, also using window.setTimeout.

By that we were able to confirm that callbacks of Meteor.call aren’t called anymore on the client once the phenomenon starts appearing. My understanding is that the same is happening in @waldgeist’s app, though I myself did not take part in formally confirming it.

1 Like

Massive thanks again to @peterfkruger for all his help. Incredibly generous with his time

1 Like

Hi All,

I have found the issue to the problem for me.

I was connecting to a second Meteor server simultaneously. The connection was crucial to the app, so it was established at startup.

I found that when you use DDP.connect, if the timing works out just right DDP.onReconnect can be fired as the login method is resolving. This kills the login method in its tracks, because the DDP.onReconnect connection is not the same as the connection the login method was called on. This in turn prevents anything else from executing.

If you are not using DDP.connect in your app, then your issue may be unrelated to mine.

2 Likes