Users with stuck "active" icon in clients


We observe some offline users permanently shown as active (green tick mark against their avatar) which causes confusion. Other users have correctly-working activity indicators.

Steps to reproduce

Mattermost server 3.7.1, but I observed this on earlier versions too. Various browser clients.
Steps to reproduce not clear.

Expected behavior

Obviously we expect the activity indicators to show inactive/offline at appropriate times.

Observed behavior

It seems that:

  • after a server restart, one or more users may be stuck shown as active all the time, regardless of whether they are offline for days, active in channels, etc
  • on next restart, those users revert to normal but others may be in the stuck state, apparently randomly

I have a user in this state at the moment. I checked some database fields for their user ID:

| Status  | Manual | LastActive               |
| offline |      0 | 2017-03-31 04:01:12.5930 |
| LastActive               | Props                                                                                  |
| 2017-02-20 23:29:41.1190 | {"browser":"Chrome/50.0.2661.102","os":"Linux x86_64","platform":"X11"}                |
| 2017-01-25 00:39:05.7960 | {"browser":"Chrome/55.0.2883.95","os":"Intel Mac OS X 10_10_3","platform":"Macintosh"} |
| 2017-03-09 01:41:17.4320 | {"browser":"Chrome/55.0.2883.95","os":"Intel Mac OS X 10_10_3","platform":"Macintosh"} |
| 2017-03-23 08:44:28.9990 | {"browser":"Chrome/50.0.2661.102","os":"Linux x86_64","platform":"X11"}                |
| 2017-03-20 05:29:02.6840 | {"browser":"Chrome/56.0.2924.87","os":"Intel Mac OS X 10_10_3","platform":"Macintosh"} |

All of this information seems to say that they have not interacted with mattermost for days, yet they are shown with a green tick in channels and in the side bar. All users see them as active whether using the desktop client or the browser, and it’s still seen on restarting the client or opening a new session in a browser. The user did post some messages and then went offline again, and the stuck activity indication persisted throughout.

1 Like

I forgot to add that users in this state get no email notifications either.

Nobody? :frowning:

This is really putting some of our users off the system, sadly - particularly the missing email alerts.

I have the same issue if that makes you feel better :stuck_out_tongue: but haven’t had time to look at it and not sure if anyone else is as they are busy with the big release @ 16th I think.

OK. It’s actually getting worse - after a restart the state was fixed, but then got stuck again for those users, plus some new ones. I am wondering whether to try forcing a logout for them.

Not sure if it’s related but we’ve also noticed some users are missing from the @-autocomplete box, both in the Post area and in the search. Can’t figure out a pattern for who’s missing. After server restart, the same users are missing.

Will wait to see if 3.8.0 fixes things I guess…

Same issue here after upgrading to 3.7.3. This is causing troubles, especially because of the missing e-mail notifications.

For the time being you can just go to the “System Console > Configuration > Purge All Cache” and it should clear the status without requiring you to restart or anything.

I am still trying to track what causes a user to get stuck, it might be slower for me to find the issue than it would for a core dev, but once I find it I will post a PR to fix it.

it might be better if u report this as a separated issue to be looked at.

Thanks @prixone for the workaround - will try it out.

I’ve found what is causing the issue or what I believe that is causing it, which seems to be the caching code, but unhappily couldn’t further look into it as I needed some answers, which I wasn’t getting.

Regardless I’ve post what I’ve found here for whoever takes over it.

There is also a fix(or rather workaround) for those compiling the server them self.

Hi @prixone / @jwilander,

I’m afraid my issue originally reported in this thread is not fixed by PLT-6333. I have upgraded to 3.10.0 and still see some users permanently stuck. It’s not a case of ten minutes, it’s permanent (still shown online days after leaving the office). This is bad, because they don’t get any notifications, ever.

Looking in the database, the LastActivityAt time on the session does appear to be increasing, so I wonder if it’s a client issue - constantly pinging somehow when idle…? Is there any logging I can enable to help? A quick look at the mattermost and nginx logs didn’t shed any light.

This is my worst issue with mattermost at present - any help would be very much appreciated!

Hello @gubbins,

I’d like to look at this from a sysadmin point of view. I do not appear to have this issue. Can you fill out the following fields for me?

Installation Type: (Local, Docker, Gitlab)
If Local: Operating System and Version:
Database (PSQL/MySQL) and Version:
Clients that the affected users have (IE, Chrome, Firefox, Mattermost Desktop):



Local installation on CentOS 7.2
MySQL database: MariaDB 5.6.10 (in Amazon RDS)
Affected users are using a variety of clients I think; would have to do some more digging.

While looking around to try to answer your question I encountered a user who is a good example:

  • they are based in Europe where it’s currently the middle of the night, but are shown as online
  • entries for them in the Sessions table, sorted by ActiveAt, shows the most recent activity time is about 19 hours ago
  • the Status table shows them with Status “offline”, Manual “0”, and the same activity time 19 hours ago

Just to confirm I’m interpreting the timestamps correctly, I checked my own last activity time which shows the current time, as expected.

So, I retract what I said previously about the last activity time. Everything in the database says that this user has done nothing for 19 hours but they are shown in everyone’s client as being online. A full refresh of the desktop client (Shift-Cmd-R) has no effect.

One thing that might be common to the affected users would be running the Linux version of the desktop client; I will try to find out.

@gubbins for the time being I haven’t had the opportunity to update to 3.10, but will soon. So instead I am using the workaround I posted which seems to bypass the issue.

But while using I’ve noticed that users are now being properly logged out and once I have the chance to test it myself I will report back and let u know.

Thanks @prixone but I suspect this is a separate issue. I am seeing no difference with 3.10 anyway.

We are seeing the exact same issue on 1 account on 5.4.0 and are struggling to figure out what is causing this.

We have 1 team member who tends to just shut the “Chrome tab” when he is done with chat and rely on email messages.

Consistently, if he ever does this, he is stuck “online”. He is an admin in the system.

I can get him to look offline if

  • I restart mattermost on the server

  • I clear caches in settings

I have been struggling to read through the source to find what code is responsible for “marking” users offline when they were not seen for 20 seconds, can anyone point me at it? Any ideas on what would be causing this?

1 Like

I am having exactly the same problem on 5.22.1.

It is dockerized Mattermost with MySQL inside docker itself.

| UserId | Status | Manual | LastActivityAt |
| tsy63w8sr7r4uetmytr9ksfiay | online | 0 | 1589091025230 |

Last active at 05/10/2020 @ 6:10am (UTC)

Now is 05/10/2020 @ 8:13pm (UTC)

Pretty sure this is broken.

Is this happening with 1 user or multiple users?

Multiple different users.