Rocket.chat: [Bug] user is marked as "online" after logout

Created on 24 Apr 2019  路  11Comments  路  Source: RocketChat/Rocket.Chat

Description:

There is one user in our Rocket.Chat which is shown online all the time, even after the user has been logged out at all devices. An Error is being thrown everytime the user logs in/out.

I tried to manually set the status to "offline" in the Collection, but that didn't help.

A restart of the Rocket-Chat-Container fixes the error.

Expected behavior:

User should be displayed offline and no error should be thrown, the Rocket.Chat-Service should not need a restart.

Actual behavior:

user is displayed as online until services is restarted

Server Setup Information:

  • Version of Rocket.Chat Server: 0.74.3
  • Deployment Method: Docker
  • Number of Running Instances: 1 Rocket.Chat Server, 3 Mongo-DBs in the ReplicaSet
  • MongoDB Version: 4.0.5

Relevant logs:

error in console after user logout
TypeError: Cannot read property '_id' of null at Accounts.onLogout.info (packages/rocketchat:statistics/server/lib/SAUMonitor.js:125:29) at packages/callback-hook/hook.js:130:22 at _onLogoutHook.each.callback (packages/accounts-base/accounts_server.js:193:7) at Hook.each (packages/callback-hook/hook.js:108:15) at AccountsServer._successfulLogout (packages/accounts-base/accounts_server.js:192:24) at MethodInvocation.methods.logout (packages/accounts-base/accounts_server.js:529:16) at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30) at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12) at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12) at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12) at Promise (packages/ddp-server/livedata_server.js:715:46) at new Promise (<anonymous>) at Session.method (packages/ddp-server/livedata_server.js:689:23) at packages/ddp-server/livedata_server.js:559:43

error in console after user login
TypeError: Cannot redefine property: loginAt at Function.defineProperty (<anonymous>) at Object.keys.forEach.p (packages/rocketchat:statistics/server/lib/SAUMonitor.js:279:12) at Array.forEach (<anonymous>) at SAUMonitorClass._updateConnectionInfo (packages/rocketchat:statistics/server/lib/SAUMonitor.js:278:22) at Accounts.onLogin.info (packages/rocketchat:statistics/server/lib/SAUMonitor.js:120:9) at packages/callback-hook/hook.js:130:22 at _onLoginHook.each.callback (packages/accounts-base/accounts_server.js:178:7) at Hook.each (packages/callback-hook/hook.js:108:15) at AccountsServer._successfulLogin (packages/accounts-base/accounts_server.js:177:23) at AccountsServer._attemptLogin (packages/accounts-base/accounts_server.js:350:12) at MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:520:23) at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30) at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12) at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12) at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46) at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12) at Promise (packages/ddp-server/livedata_server.js:715:46) at new Promise (<anonymous>) at Session.method (packages/ddp-server/livedata_server.js:689:23) at packages/ddp-server/livedata_server.js:559:43

Most helpful comment

This still seems to be an issue in Rocket.Chat Server version 1.0.3.

All 11 comments

After user disconnection from web interface in MongoDB :

  • users collections still shows 'status' and 'statusConnection' as online
  • usersSessions still contains an entry for this user with status online

Then, restart Rocket.chat instance :

  • users collections shows 'status' and 'statusConnection' as offline
  • usersSessions for this user is empty

This still seems to be an issue in Rocket.Chat Server version 1.0.3.

up!
Now this problem is present in version 1.0.3.
p.s. snap install

up!!
my version is 1.0.3 too.

Same problem with 1.1.0 release

Help me Fix bug user is marked as "online" after logout , my version is 1.0.3 too.

Same as #14702

Same problem in version 1.1.1

Hi simillar problem after login. Another users do not see status change to active. When user manually change stauts, works correct. Another useres see change immediately.
I have tested on old 0.74.3 version and issue not exists.

In "/admin/users" status is presented in proper way, but on user details not. Exmaple on picture below.

image

Same problem in 1.1.2

I can reproduce the problem if I log out one account and do not close the browser window, but login again with another account on the same tab. The status of the first (now logged out) account remains "online".
Interestingly, when logging out of an account, the status of the account always stays "online" until I finally close the browser window.
Closing the browser window / tab after logging out is therefore the only way to avoid this error.

Btw: The setting "Accounts_ForgetUserSessionOnWindowClose" seems to have no effect on my installation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karlprieb picture karlprieb  路  3Comments

marceloschmidt picture marceloschmidt  路  3Comments

tanc picture tanc  路  3Comments

sta-szek picture sta-szek  路  3Comments

mattlin picture mattlin  路  3Comments