Summary
Users get logged out after a period of time
Steps to reproduce
Mattermost 4.4.1, deployed on CentOS behind a NGINX reverse proxy. Auth is done through LDAP/AD. We did not see this on 3.8.x.
Expected behavior
Users to stay logged in and not disappear from the team
Observed behavior
Users who are logged in eventually get kicked out and when you log back in, you cannot @ any team members or anything until said team member logs back in. In the logs we see this,
[2017/11/17 11:23:12 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:12 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:12 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:12 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:30 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:30 PST] [EROR] /api/v4/users/status/ids:ServeHTTP code=401 rid=5g4by3dy47nwt8o3n9kdw51k9c uid= ip=10.100.141.230 Invalid or expired session, please login again. [details: token=x4cj9q8ir3r13pp8p859kqxenh]
[2017/11/17 11:23:30 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:50 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:50 PST] [EROR] /api/v4/users/status/ids:ServeHTTP code=401 rid=wthjggihkfyjxedtiskx481q6h uid= ip=10.100.111.62 Invalid or expired session, please login again. [details: token=mhrenpxmmjyubc3zrekrsnix3a]
[2017/11/17 11:23:50 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:52 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:52 PST] [EROR] /api/v4/users/status/ids:ServeHTTP code=401 rid=5bhu3xg5epr73mqg6ese654cxw uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: token=u41i3ska5idsiywftxbkfem1jh]
[2017/11/17 11:23:53 PST] [EROR] /api/v4/users/me: code=401 rid=8ugkxjow6idzzrbncaqxqhfy3c uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: UserRequired]
[2017/11/17 11:23:53 PST] [EROR] /api/v4/users/me/preferences: code=401 rid=znwwmmjrfi8cmye56n76cs6nko uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: UserRequired]
[2017/11/17 11:23:53 PST] [EROR] /api/v4/users/me/teams: code=401 rid=o6sxdi5ad7ye9p8xord1nnyocr uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: UserRequired]
[2017/11/17 11:23:53 PST] [EROR] /api/v4/users/me/teams/unread: code=401 rid=7p85p9bcp7ne9pkdhnc58h98pr uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: UserRequired]
[2017/11/17 11:23:53 PST] [EROR] /api/v4/users/me/teams/members: code=401 rid=99cmkgjsijfwf8ucb4w6eikqer uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: UserRequired]
[2017/11/17 11:23:53 PST] [EROR] /api/v4/emoji: code=401 rid=wme67j8dn3rp9yycjcub8okq9w uid= ip=10.100.142.109 Invalid or expired session, please login again. [details: UserRequired]
[2017/11/17 11:23:55 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:23:55 PST] [EROR] /api/v4/users/status/ids:ServeHTTP code=401 rid=fmdfc6ko93b9xbzfy68fhu5cjc uid= ip=10.100.142.88 Invalid or expired session, please login again. [details: token=pj11i7co4ifxpncr9xz4wgjeme]
[2017/11/17 11:23:55 PST] [EROR] Invalid session err=GetSession: api.context.invalid_token.error, createSessionForUserAccessToken: app.user_access_token.invalid_or_missing, SqlUserAccessTokenStore.GetByToken: store.sql_user_access_token.get_by_token.app_error, sql: no rows in result set
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/5w4myyxrui8n3pn4xunn5rq93c/thumbnail:ReadFile code=404 rid=gr7u1mycxigj9py3ub3p6remoa uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/ie5wdwtqpjfmpc4fmnrshh48jc/t9s6e4xcsbgimjan6srhcbkqpo/Screenshot 2016-05-26 11.03.23_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/cjtme4i4jby7xj8c3wewjkxxfa/thumbnail:ReadFile code=404 rid=5dihms43kbyzb84zri7fy478xa uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/7jpogf7e5pn57mddj6g6sqrsde/p13ebfsihibxdgtbbtnnu7e7wh/Screen Shot 2016-06-23 at 3.24.43 PM_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/4emmcg8qzjdpud4mdaqtfiebae/thumbnail:ReadFile code=404 rid=pm3ibyzqjfy9i8zz8ta83ohgra uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/7jpogf7e5pn57mddj6g6sqrsde/cz791mhxxpg3pdiqqa8c5q7guw/real_programmers_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/u4aopnqfh7ncikd6kj8wkx4u6y/thumbnail:ReadFile code=404 rid=6cxqxfnmmfgn3yassuhg9us6uw uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/7jpogf7e5pn57mddj6g6sqrsde/71sq7pwoob8rucdaxigxrdr6ze/Screen Shot 2016-10-05 at 12.30.19 PM_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/4emmcg8qzjdpud4mdaqtfiebae/thumbnail:ReadFile code=404 rid=z6j6gtsx1tbf8kj9o13ert4d8a uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/7jpogf7e5pn57mddj6g6sqrsde/cz791mhxxpg3pdiqqa8c5q7guw/real_programmers_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/5w4myyxrui8n3pn4xunn5rq93c/thumbnail:ReadFile code=404 rid=eeo683u1fby8ierchwq8jaczbo uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/ie5wdwtqpjfmpc4fmnrshh48jc/t9s6e4xcsbgimjan6srhcbkqpo/Screenshot 2016-05-26 11.03.23_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/cjtme4i4jby7xj8c3wewjkxxfa/thumbnail:ReadFile code=404 rid=o5hw1zakubg68xdd3udzxt5wjr uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/7jpogf7e5pn57mddj6g6sqrsde/p13ebfsihibxdgtbbtnnu7e7wh/Screen Shot 2016-06-23 at 3.24.43 PM_thumb.jpg: no such file or directory]
[2017/11/17 11:24:11 PST] [EROR] /api/v4/files/u4aopnqfh7ncikd6kj8wkx4u6y/thumbnail:ReadFile code=404 rid=7cjeqkutw38kufuocrtf7icfsy uid=jsjohhd3m3bcmdrwna8t9g3our ip=10.100.141.230 Encountered an error reading from local server storage [details: open /home/mattermost/data/teams/6dkqxaychbbujphxjm3jyw6c3a/channels/x6mk39k61pdmxezkyenqniyp6c/users/7jpogf7e5pn57mddj6g6sqrsde/71sq7pwoob8rucdaxigxrdr6ze/Screen Shot 2016-10-05 at 12.30.19 PM_thumb.jpg: no such file or directory]