Skip to content

[Bug] user is marked as "online" after logout #14237

@niklasdahlheimer

Description

@niklasdahlheimer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions