Rocket.chat: User Info loading to blank page

Created on 28 Jul 2020  Β·  36Comments  Β·  Source: RocketChat/Rocket.Chat

Description:

Can't change user settings. User preference not showing.

Steps to reproduce:

  1. Go to Administration - Users
  2. Click on user

Expected behavior:

Blank page.

Actual behavior:

Server Setup Information:

  • Version of Rocket.Chat Server: 3.5.0
  • Operating System: Ubuntu 20.04
  • Deployment Method: manual
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 12.14.0
  • MongoDB Version: 4.0.19

Client Setup Information

  • Desktop App or Browser Version: 2.17.9
  • Operating System: MacOS

Additional context

Relevant logs:

From browser console:
TypeError: undefined is not an object (evaluating 'g.user.roles.includes')

user settings waiting response uux

Most helpful comment

I see, Yeah we did some heavy refactoring on the user info screens, It could be an issue with previous set custom fields. I'll try to test out more to see what we find out. Probably will need a migration for this. I'll keep you all updated about it

All 36 comments

I'm unable to reproduce this issue, what roles do your user have? Any custom roles? Thanks!

Hi,

Same or similar problem here.

https://myexamplechat.com/admin/users/edit/xxxxXXxx

I noticed another similar problem at:

https://myexamplechat.com/account/tokens
https://myexamplechat.com/account/profile
https://myexamplechat.com/account/preferences

Some errors from chrome console:

98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473 TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at eval (/client/components/CustomFieldsForm.js:1)
    at Object.useMemo (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473)
    at n.useMemo (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:449)
    at b (/client/components/CustomFieldsForm.js:1)
    at po (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473)
    at Zo (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473)
    at us (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473)
    at ds (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473)
    at Xs (98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473)

Some line from chrome /client/components/CustomFieldsForm.js:formatted

          , i = u(()=>Object.values(n).map(e=>[e, e]), [n])

I can confirm I'm having the same issue after upgrading to 3.5, I've noticed it occurs only if I click a default user that registered but hasn't been edited yet (that has the default user role) the admin area goes white. If you are in the browser, you can REFRESH the browser and it loads the user card but all data is missing (username, etc...) but then you can click the EDIT button and it lets you in to edit the user.

This does not happen on users with already modified roles (I modify all users from the default user role to another role).

Here is the console error when it goes white:
98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473 Invariant Violation: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Blabel%2C%20value%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at i (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:296)
at s (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:566)
at Ra (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:50079)
at https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:54856
at Bo (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:61787)
at Zo (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:69721)
at us (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:91128)
at ds (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:91515)
at Xs (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:98599)
at Qs (https://chat.mysite.com/98cbd60f7c9f791e528b7293c7741c4255338a15.js?meteor_js_resource=true:473:97979)

@UAnton @BizClimb @phlbrz Do you have any custom fields set up?

Hi Martin,
No, this clean basic installation. One admin user and LDAP auth. No any changes.

@UAnton @BizClimb @phlbrz Do you have any custom fields set up?

I do have 2 custom fields setup. There was similar behavior when the JSON syntax wasn't indented with TABS properly in previous versions, I fixed this by adding TABS (expected spacing) to the JSON code and saving and then it worked again, but I re-confirmed the custom fields were spaced properly, and I also even added a new custom field to see if it would somehow refresh and work properly, but still nothing.

So yes, I DO have custom fields setup.

@MartinSchoeler

Yes, I do.

{   
    "title": "title",
    "telephoneNumber": "telephoneNumber",
    "division": "division",
    "extensionAttribute1": "extensionAttribute1",
    "extensionAttribute3": "extensionAttribute3",
    "streetAddress": "streetAddress",
    "manager": "manager"
}

Everything was working before 3.5.0.
First I always upgrade rocketchat in stage environment, test principal things and upgrade production, but this bug get me stuck until it solves first.
Before upgrade to 3.5.0 in stage, rocketchat version was 3.3.3 and worked.

I have a production instance in version 3.2.2 with this custom fields and it is working like a charm.

Thank's.

I can also confirm that I've upgraded through 3-4 releases as well. It was working fine for me in 3.4.2 as well as the previous versions. I should note that as a test I spun up a new rocket chat release 3.5, set the custom fields up, and it's working fine. So this leads me to believe something from at least 2 releases ago has caused the issue to become prevalent now in 3.5. This is unconfirmed, just speculation based on the information being gathered. Let me know if you need any more info from me or anything to test. Thanks.

I see, Yeah we did some heavy refactoring on the user info screens, It could be an issue with previous set custom fields. I'll try to test out more to see what we find out. Probably will need a migration for this. I'll keep you all updated about it

Can confirm seeing this issue building from current develop branch (55703f191f4a5a1230ce0fea3c536fee6d769277) on a clean database. Issue appears to be with the parameters on the users.list API. Passing no parameters is a successful call, but as soon as any parameters are added (such as the UI does), a timeout occurs. Of note is that the logger call at app/api/server/api.js:348 doesn't even run, so I suspect something about that function creation block is resulting in a badly defined function or something (not a js coder, so not 100% on this).

@MartinSchoeler

Some workaround for this line:

https://github.com/RocketChat/Rocket.Chat/blob/1bed2977cac7416741380ebfd4b41ce611d47545/client/components/CustomFieldsForm.js#L29

Could be:

options =  (options) ? options : "";
const mappedOptions = useMemo(() => Object.values(options).map((value) => [value, value]), [options]);

I don't know where options var come from the code, so just a guess.

Tested in https://playcode.io/ and TypeError: Cannot convert undefined or null to object solved.

Before:

Screenshot from 2020-07-30 12-20-54

After:

Screenshot from 2020-07-30 12-21-07

PS.: I'm not a javascript developer.

:smile:

3.5.1- problem still here. This happened after enabling LDAP sync. Before enable - all was ok.

Any news?

3.5.2 - problem still here. This happened after enabling LDAP auth and sync. Before enable - all was ok.

Logs from server:
I20200813-22:19:06.351(4) Exception while invoking method login Error: User not found [403] at AccountsServer.Accounts._runLoginHandlers (app/lib/server/lib/loginErrorMessageOverride.js:10:18) at MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:520:31) at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12) at packages/ddp-server/livedata_server.js:1689:15 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at packages/ddp-server/livedata_server.js:1687:36 at new Promise (<anonymous>) at Server.applyAsync (packages/ddp-server/livedata_server.js:1686:12) at Server.apply (packages/ddp-server/livedata_server.js:1625:26) at Server.call (packages/ddp-server/livedata_server.js:1607:17) at Object.post (app/api/server/v1/misc.js:262:26) at app/api/server/api.js:388:82 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Object._internalRouteActionHandler [as action] (app/api/server/api.js:388:39) at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32) at packages/nimble_restivus/lib/route.coffee:59:33 at packages/simple_json-routes.js:98:9 => awaited here: at Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12) at Server.apply (packages/ddp-server/livedata_server.js:1638:22) at Server.call (packages/ddp-server/livedata_server.js:1607:17) at Object.post (app/api/server/v1/misc.js:262:26) at app/api/server/api.js:388:82 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Object._internalRouteActionHandler [as action] (app/api/server/api.js:388:39) at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32) at packages/nimble_restivus/lib/route.coffee:59:33 at packages/simple_json-routes.js:98:9

Logs from browser console:

[Error] TypeError: undefined is not an object (evaluating 'g.user.roles.includes')
x
po β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:55932
Ho β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:62757
us β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:91131
ds β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:91518
Xs β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:98602
Qs β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:97982
Hs β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:97003
hs β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:95814
To β€” e49465247681928f62c29836b6a5fe7e1714f082.js:473:58919
To
(анонимная функция)
asyncFunctionResume
[native code]
promiseReactionJobWithoutPromise

    ki (e49465247681928f62c29836b6a5fe7e1714f082.js:473:77444)
    (анонимная функция) (e49465247681928f62c29836b6a5fe7e1714f082.js:473:82170)
    xi (e49465247681928f62c29836b6a5fe7e1714f082.js:473:75280)
    vi (e49465247681928f62c29836b6a5fe7e1714f082.js:473:75080)
    is (e49465247681928f62c29836b6a5fe7e1714f082.js:473:84383)
    fs (e49465247681928f62c29836b6a5fe7e1714f082.js:473:85799)
    (анонимная функция) (e49465247681928f62c29836b6a5fe7e1714f082.js:473:98927)
    (анонимная функция) (e49465247681928f62c29836b6a5fe7e1714f082.js:491:3223)
    Js (e49465247681928f62c29836b6a5fe7e1714f082.js:473:98883)
    Xs (e49465247681928f62c29836b6a5fe7e1714f082.js:473:98637)
    Qs (e49465247681928f62c29836b6a5fe7e1714f082.js:473:97982)
    Hs (e49465247681928f62c29836b6a5fe7e1714f082.js:473:97003)
    hs (e49465247681928f62c29836b6a5fe7e1714f082.js:473:95814)
    To (e49465247681928f62c29836b6a5fe7e1714f082.js:473:58919)
    To
    (анонимная функция) (/client/hooks/useEndpointDataExperimental.js:1:780)
    asyncFunctionResume
    (анонимная функция)
    promiseReactionJobWithoutPromise

This is still happening for me as well in 3.5.2. I do not have LDAP enabled, but I do have custom registration fields.

I noticed this on my RocketChat install via snap I did today. That also does the blank user info.

But it only does that for users without a role which happens to be all my users imported form LDAP.
Altho users that do have a role the user info will load for them.

At first this started only for users on the default role, and then users I moved over to a new role manually were ok. But today I noticed it happening on some users who had changed roles already.

I tried to install older versions but have the same problem and many LDAP errors like:
I20200826-20:00:00.414(4) server.js:204 LDAPSync βž” error Error creating user errorClass [Error]: Username already exists. [403] at handleError (packages/accounts-password/password_server.js:110:17) at checkForCaseInsensitiveDuplicates (packages/accounts-password/password_server.js:257:7) at createUser (packages/accounts-password/password_server.js:1116:3) at AccountsServer.Accounts.createUser (packages/accounts-password/password_server.js:1188:10) at addLdapUser (app/ldap/server/sync.js:463:29) at app/ldap/server/sync.js:529:5 at Array.forEach (<anonymous>) at app/ldap/server/sync.js:496:13 at runWithEnvironment (packages/meteor.js:1286:24) { isClientSafe: true, error: 403, reason: 'Username already exists.', details: undefined, message: 'Username already exists. [403]', errorType: 'Meteor.Error' }

This issue has been resolved for me since 3.5.3

This issue has been resolved for me since 3.5.3

Today I tried to install versions from 3.4.2 to 3.5.4 - no changes :(

This is still happening for me in 3.5.2 and 3.6.0 as well

same for 3.6.1

same for 3.6.2

also have this in 3.70 is getting very annoying for my customers, I really dont want to go back to Discord.

Should've been fixed on 3.61. by #18851.
If you're still having this problem, please share your error logs.

@pierre-lehnen-rc Solved for me!

Everything working as expected!

Thank's!

Hi,

After update to 3.7.0 my server cannot show my avatars.
Everytime I open /admin/users, avatars shows as code 403 in chrome.
Rocketchat logs The server detected an unauthenticated access to an user avatar. This type of request will soon be blocked by default.
If I'm admin and logged in, I don't understand why it's happening.
Already opened an incognito mode, same thing.

It happens in https://myinstance.chat.xxx/directory/users also.

I disabled Accounts -> Block Unauthenticated Access to Avatars, but still happening. I don't know if it has an issue already.

Screenshot from 2020-10-01 18-43-46

Screenshot from 2020-10-01 18-43-34


https://chat.xxx/avatar/my_id -> shows Forbidden
https://chat.xxx/avatar/my_id?etag=xxxxx -> shows avatars

My Roles:

Screenshot from 2020-10-02 14-15-12

  • user
  • Admin
  • Livechat Agent
  • Livechat Manager

I looked for some issue about that, I don't know if it's better to open a new one for 3.7.0, but it happened after update from
3.5.0.


Channel also, same problem, never show user avatar.

On 3.6.2, still experiencing this issue (or at least I thought it was the identical issue).
Going to Administration -> Users fails to load, with a red Undefined popup.
Console error:

GET https://im.REDACTED.com/api/v1/users.list?fields={%22name%22:1,%22username%22:1,%22emails%22:1,%22roles%22:1,%22status%22:1,%22avatarETag%22:1}&query={%22$or%22:[{%22emails.address%22:{%22$regex%22:%22%22,%22$options%22:%22i%22}},{%22username%22:{%22$regex%22:%22%22,%22$options%22:%22i%22}},{%22name%22:{%22$regex%22:%22%22,%22$options%22:%22i%22}}]}&sort={%22name%22:1,%22usernames%22:1}&count=25 502 (Proxy Error)
send @ 81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:48
ajax @ 81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:48
l @ 81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423
_jqueryCall @ 81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423
get @ 81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423
get @ 81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423
c @ /client/providers/ServerProvider.js:1
eval @ /client/contexts/ServerContext.ts:1
s @ /client/hooks/useEndpointData.js:1
eval @ /client/hooks/useEndpointData.js:1
Ii @ /node_modules/react-dom/cjs/react-dom.production.min.js:219
Vj @ /node_modules/react-dom/cjs/react-dom.production.min.js:265
exports.unstable_runWithPriority @ /node_modules/scheduler/cjs/scheduler.production.min.js:27
cg @ /node_modules/react-dom/cjs/react-dom.production.min.js:130
Dj @ /node_modules/react-dom/cjs/react-dom.production.min.js:265
eval @ /node_modules/react-dom/cjs/react-dom.production.min.js:264
X @ /node_modules/scheduler/cjs/scheduler.production.min.js:25
H.port1.onmessage @ /node_modules/scheduler/cjs/scheduler.production.min.js:22
/client/hooks/useEndpointData.js:1 Error: Proxy Error
    at originalCallback (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423)
    at Object.processTwoFactorError (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423)
    at Object.a [as error] (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:423)
    at c (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:48)
    at Object.fireWith [as rejectWith] (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:48)
    at w (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:48)
    at XMLHttpRequest.<anonymous> (81bba22dadcf0237c74ba4bd697dc8d8666e87f5.js?meteor_js_resource=true:48)

I think this might be the same issue (no email address for users): https://github.com/RocketChat/Rocket.Chat/issues/18435#issuecomment-698482010

Hi,

After update to 3.7.0 my server cannot show my avatars.
Everytime I open /admin/users, avatars shows as code 403 in chrome.
Rocketchat logs The server detected an unauthenticated access to an user avatar. This type of request will soon be blocked by default.
If I'm admin and logged in, I don't understand why it's happening.
Already opened an incognito mode, same thing.

It happens in https://myinstance.chat.xxx/directory/users also.

I disabled Accounts -> Block Unauthenticated Access to Avatars, but still happening. I don't know if it has an issue already.

Screenshot from 2020-10-01 18-43-46

Screenshot from 2020-10-01 18-43-34

https://chat.xxx/avatar/my_id -> shows Forbidden
https://chat.xxx/avatar/my_id?etag=xxxxx -> shows avatars

My Roles:

Screenshot from 2020-10-02 14-15-12

  • user
  • Admin
  • Livechat Agent
  • Livechat Manager

I looked for some issue about that, I don't know if it's better to open a new one for 3.7.0, but it happened after update from
3.5.0.

Channel also, same problem, never show user avatar.

Hello @phlbrz can you open a new issue for this problem, might not be related at all, also be sure to upgrade to 3.8.0 when is out, we did some improvements on the avatar providers. Thanks!

@Endareth Could you test with version 3.7.0+ Also do you get any errors on the server console? Thanks!

Hi,
After update to 3.7.0 my server cannot show my avatars.
Everytime I open /admin/users, avatars shows as code 403 in chrome.
Rocketchat logs The server detected an unauthenticated access to an user avatar. This type of request will soon be blocked by default.
If I'm admin and logged in, I don't understand why it's happening.
Already opened an incognito mode, same thing.
It happens in https://myinstance.chat.xxx/directory/users also.
I disabled Accounts -> Block Unauthenticated Access to Avatars, but still happening. I don't know if it has an issue already.
Screenshot from 2020-10-01 18-43-46
Screenshot from 2020-10-01 18-43-34
https://chat.xxx/avatar/my_id -> shows Forbidden
https://chat.xxx/avatar/my_id?etag=xxxxx -> shows avatars
My Roles:
Screenshot from 2020-10-02 14-15-12

  • user
  • Admin
  • Livechat Agent
  • Livechat Manager

I looked for some issue about that, I don't know if it's better to open a new one for 3.7.0, but it happened after update from
3.5.0.
Channel also, same problem, never show user avatar.

Hello @phlbrz can you open a new issue for this problem, might not be related at all, also be sure to upgrade to 3.8.0 when is out, we did some improvements on the avatar providers. Thanks!

Hello @MartinSchoeler , @ggazzo reopened https://github.com/RocketChat/Rocket.Chat/issues/17819, I'm ok with the description, also linked both issues. Thank you!

We did a ton of work to fix these blank pages on the user info, if any of you still face this issue with the latest develop version (or the upcoming release) please let me know. Thanks for all the feedback!

Still the same problem with 3.8.0

@Endareth Could you test with version 3.7.0+ Also do you get any errors on the server console? Thanks!

Finally able to test with latest snap (3.8.1), and still the same behaviour (undefined popup, page fails to load) for the Users scren. No log activity on the server at all. Still suspect root cause here is from an LDAP sync'd user account coming in with some dodgy data, but hard to check.

Still the same problem with 3.9.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

engelgabriel picture engelgabriel  Β·  3Comments

Buzzele picture Buzzele  Β·  3Comments

ghost picture ghost  Β·  3Comments

mattlin picture mattlin  Β·  3Comments

djeber picture djeber  Β·  3Comments