Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open room with new LDAP user #24669

Closed
jsdidierlaurent opened this issue Mar 2, 2022 · 12 comments · Fixed by #24623
Closed

Cannot open room with new LDAP user #24669

jsdidierlaurent opened this issue Mar 2, 2022 · 12 comments · Fixed by #24623

Comments

@jsdidierlaurent
Copy link

jsdidierlaurent commented Mar 2, 2022

Description:

After a fresh rocket chat Update from 4.4.0 to 4.5.0
When i start a chat with new ldap user, i have "Room not found" message

Steps to reproduce:

  1. Adding new user in my Active Directory
  2. Connect this account to RocketChat successfully
  3. Trying to start chat with it

Expected behavior:

Correctly starting a Room

Actual behavior:

image

Server Setup Information:

  • Version of Rocket.Chat Server: 4.5.0
  • Operating System: Ubuntu 16.04.6 LTS
  • Deployment Method: Docker version 18.09.7, build 2d0083d
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v14.18.3 (Embed by your Dockerfile)
  • MongoDB Version: 4.2.17

Client Setup Information

  • Desktop App or Browser Version: Both
  • Operating System: Windows / Linux

Additional context

Everything was working fine in 4.4. And I can no longer rollback in 4.4 without having to rollback the data and I don't really want to lose 1 day of data.

The problem is the same when I start a chat with someone I've never spoken to. But if another user than me has already spoken to the person, everything works.

Relevant logs:

Server Log

{"level":50,"time":"2022-03-02T07:14:43.300Z","pid":1,"hostname":"ae9e47d46816","name":"","name":"System","msg":"Exception while invoking method getRoomByTypeAndName 'Invalid room [error-invalid-room]'"}
{"level":50,"time":"2022-03-02T07:14:43.348Z","pid":1,"hostname":"ae9e47d46816","name":"","name":"System","msg":"Exception while invoking method createDirectMessage 'Invalid user [error-invalid-user]'"}

Client Log

{
    "isClientSafe": true,
    "error": "error-invalid-user",
    "reason": "Invalid user",
    "details": {
        "method": "createDirectMessage"
    },
    "message": "Invalid user [error-invalid-user]",
    "errorType": "Meteor.Error"
}
@ankar84
Copy link

ankar84 commented Mar 2, 2022

@jsdidierlaurent Hey!
What if make a refresh (CTRL+R) right after room not found page appears?

If that will open proper DM chat with that new LDAP user, that means that issue is related to:
#24175
#22256 (comment)
RocketChat/Rocket.Chat.Electron#2241
#24579
And not fixed by #22944

@jsdidierlaurent
Copy link
Author

Same error 🥲

@ankar84
Copy link

ankar84 commented Mar 2, 2022

Same error 🥲

Ok! But what if you try to DM that user again from directory or any other way?

@jsdidierlaurent
Copy link
Author

jsdidierlaurent commented Mar 2, 2022

Oh ! From DIrectory it works ! It's only broken when i'm using Search !
This Workaround save my day ! Thanks a lot !

@ankar84
Copy link

ankar84 commented Mar 2, 2022

Oh ! From DIrectory it works ! It's only broken when i'm using Search !

When you say search you mean magnifying glass tool in left top panel?

@jsdidierlaurent
Copy link
Author

jsdidierlaurent commented Mar 2, 2022

Hum, I spoke too soon. Using Directory fix my issue with user i try to talk. But i have issue with other users ...
And Directory didn't work every time ...

And yes search = magnifying glass tool

It finally work with all user but i have to try 2 times using Directory

@ankar84
Copy link

ankar84 commented Mar 2, 2022

I totally confirm that issue!
Here is a reproduce steps:

  1. Create a new LDAP user via manual LDAP sync
  2. Find that new LDAP user via magnifying glass tool
  3. Click that user in magnifying glass tool
  4. Get Room not found error
  5. That issue is much worth since 4.5.0 because now CTRL+R don't fix DM chat
  6. To fix DM chat you need to find that new LDAP user via Directory search, and click it. Probably you need to do that twice!

@debdutdeb @dudanogueira @ggazzo @tassoevan @sampaiodiego that issue is from very old 3.15.0 version (maybe even earlier) and now it become more critical, because web client not crashes now (like is was on pre 4.5.0 versions, but shows Room not found error and CTRL+R don't fix DM now!
I guess it's some race conditions, like Tasso fixed in #24623 but it is still in search and directory results.

Please fix that very annoying issue!

Screen
image
invalid-user01

Update. Directory search works fine for me - DM creates from first attempt

@nickerber
Copy link

That's a very annoying issue!
The issue, that one had to press CTRL + R after joining a direct message with a user the first time was very annoying. This new issue makes the process even more complicated. It is hard to tell our users how to proceed.
We're currently evaluating the usage of rocketchat in an enterprise environment and this seems to be a showstopper.

Some more information from my side inspecting the Network tab in Chrome DevTools:
From search (magnifying glass tool):
(1) First try opening a direct message with an ldap user with whom I did not start a direct message yet:

Call of api/v1/method.call/getRoomByTypeAndName

Request Payload: 
{
    "message": "{\"msg\":\"method\",\"id\":\"18\",\"method\":\"getRoomByTypeAndName\",\"params\":[\"d\",\"CHBSgNZoZkqF4SteF\"]}"
}

Response: {"message":"{\"msg\":\"result\",\"id\":\"18\",\"error\":{\"isClientSafe\":true,\"error\":\"error-invalid-room\",\"reason\":\"Invalid room\",\"details\":{\"method\":\"getRoomByTypeAndName\"},\"message\":\"Invalid room [error-invalid-room]\",\"errorType\":\"Meteor.Error\"}}","success":true}

Call of api/v1/method.call/createDirectMessage

Payload: 
{
    "message": "{\"msg\":\"method\",\"id\":\"19\",\"method\":\"createDirectMessage\",\"params\":[\"CHBSgNZoZkqF4SteF\"]}"
}

Response: 
{"message":"{\"msg\":\"result\",\"id\":\"19\",\"error\":{\"isClientSafe\":true,\"error\":\"error-invalid-user\",\"reason\":\"Invalid user\",\"details\":{\"method\":\"createDirectMessage\"},\"message\":\"Invalid user [error-invalid-user]\",\"errorType\":\"Meteor.Error\"}}","success":true}

(2) Second try opening a direct message, with the same user as in (1):
No api call, except: api/v1/method.call/license%3AgetModules

(3) After changing to another channel first and then repeating the steps in (1) the same api-calls as in (1) are performed.

From directory:
(1) First try opening a direct message with an ldap user with whom I did not start a direct message yet:
Call of api/v1/method.call/getRoomByTypeAndName

Request Payload:
{
    "message": "{\"msg\":\"method\",\"id\":\"63\",\"method\":\"getRoomByTypeAndName\",\"params\":[\"d\",\"da\"]}"
}
Response:
{"message":"{\"msg\":\"result\",\"id\":\"63\",\"error\":{\"isClientSafe\":true,\"error\":\"error-invalid-room\",\"reason\":\"Invalid room\",\"details\":{\"method\":\"getRoomByTypeAndName\"},\"message\":\"Invalid room [error-invalid-room]\",\"errorType\":\"Meteor.Error\"}}","success":true}

Call of api/v1/method.call/createDirectMessage

Request Payload:
{
  "message": "{\"msg\":\"method\",\"id\":\"64\",\"method\":\"createDirectMessage\",\"params\":[\"da\"]}"
}
Response:
{"message":"{\"msg\":\"result\",\"id\":\"64\",\"result\":{\"t\":\"d\",\"rid\":\"CHBSgNZoZkqF4SteFm3FZKyD5zsJ6areLf\",\"usernames\":[\"Administrator1\",\"da\"]}}","success":true}

Call of api/v1/method.call/getRoomByTypeAndName

Request Payload:
{
  "message": "{\"msg\":\"method\",\"id\":\"65\",\"method\":\"getRoomByTypeAndName\",\"params\":[\"d\",\"CHBSgNZoZkqF4SteFm3FZKyD5zsJ6areLf\"]}"
}
Response:
{"message":"{\"msg\":\"result\",\"id\":\"65\",\"result\":{\"_id\":\"CHBSgNZoZkqF4SteFm3FZKyD5zsJ6areLf\",\"t\":\"d\",\"_updatedAt\":{\"$date\":1646216056057},\"default\":false,\"usersCount\":2,\"ro\":false,\"sysMes\":true,\"ts\":{\"$date\":1646216056054},\"usernames\":[\"Administrator1\",\"da\"],\"uids\":[\"CHBSgNZoZkqF4SteF\",\"m3FZKyD5zsJ6areLf\"]}}","success":true}

Result: Blank screen

(2) Refreshing by pressing CTRL + F3
Call of api/v1/method.call/getRoomByTypeAndName

Request Payload:
{
  "message": "{\"msg\":\"method\",\"id\":\"7\",\"method\":\"getRoomByTypeAndName\",\"params\":[\"d\",\"CHBSgNZoZkqF4SteFm3FZKyD5zsJ6areLf\"]}"
}
Response:
{"message":"{\"msg\":\"result\",\"id\":\"7\",\"result\":{\"_id\":\"CHBSgNZoZkqF4SteFm3FZKyD5zsJ6areLf\",\"t\":\"d\",\"_updatedAt\":{\"$date\":1646216056057},\"default\":false,\"usersCount\":2,\"ro\":false,\"sysMes\":true,\"ts\":{\"$date\":1646216056054},\"usernames\":[\"Administrator1\",\"da\"],\"uids\":[\"CHBSgNZoZkqF4SteF\",\"m3FZKyD5zsJ6areLf\"]}}","success":true}

Result: Direct message opens as expected

@ankar84
Copy link

ankar84 commented Mar 2, 2022

The issue, that one had to press CTRL + R after joining a direct message with a user the first time was very annoying. This new issue makes the process even more complicated. It is hard to tell our users how to proceed.

Totally agree with you!
Thank you for you detailed analysis!

@rodrigok @engelgabriel @milton-rucks hello!
Please check that issue.
Issues like that shows Rocket.Chat in bad way for community and customers.

@raczkow
Copy link

raczkow commented Mar 4, 2022

I've got this issue with local accounts.

@toantc
Copy link

toantc commented Mar 7, 2022

We've got this issue with the Google OAuth account

@william00179
Copy link

We have this issue with SAML accounts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants