-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
3.11.1: createDirectMessage & getRoomByTypeAndName Exception: Invalid User #21735
Comments
HI, That's a fairly large jump - there's a lot that can go wrong there as there have been a lot of changes through every single version. It is normally better to go in incremental steps and allow changes to be applied gradually - they are usually tested for upgrades between a couple of versions, but not this many.
It may well do so, but you are no worse off and more likely to get some help. 3.11.x will not get patched. Standard procedure is to test on latest please. How long did it take? How many users? Any particular triggers you can see? Have you committed to the upgrade or still testing? |
Yeah, that was my main concern over this past year, sitting on 2.4; however it was outside of my control to perform the upgrade. Management wanted to remain on 2.4 as RC became our main form of communication, outside of email, when everyone transitioned to WFH.
Checking the logs:
It looks like the exceptions appear in pairs, the next occurrences are at:
And so on...looks like about every minute or two, the pair of exceptions are logged.
We have a total of 83 users, 21 of which are disabled (former employees). Here's our user metrics from the info panel:
Nothing that jumps out at me particularly. Would it be possible for an old desktop client version to cause that kind of error? Since we're a windows shop, and We do also have a testing/staging server hosted locally, to test server upgrades before deploying them in prod. On that node, which does not have any active users outside of myself and a coworker for testing; we aren't seeing those exceptions at all. I have not tried to manually step up the old snapshot from 2.4 to 3.11.x gradually; though I can do that (once I learn how to build it, anyway) to see if a more gradual update would resolve the issue...though, we would lose about 1.5mo of chatlogs and such...unless that info could be "ported" over.
We've committed production to 3.11.1 for now, with plans to upgrade to the latest build in the coming weeks (assuming testing looks fine). |
Similar behavior on 3.14.0
|
Can also confirm that we are receiving the same errors on 3.15.0. Unfortunately, I have not yet had a chance to incrementally update from our 2.4 backup. I will provide another update to this ticket when I've done so, and report my findings. |
I've having this issue as well and looking into it now. The error on Similarly, the error on Working on a solution now and will update here when I have one. |
Here's the solution I'm going to use in my own project: In https://github.com/RocketChat/Rocket.Chat/blob/develop/app/ui-utils/client/lib/openRoom.js#L104, replace this:
with this:
That will prevent the Meteor method call to I'm not going to change how the |
3.14.5 is affected, I don't believe this has to do with updates. I am also rather convinced that I am logged in when I see this.
Expected behavior
|
I have tested fix by @dkoo761 above. It works for me to remove the error "invalid user", which is now no longer displayed.
I made another change to display "loading" animation instead of the "roomNotFound" error while the room is being created. Displaying an error to the user while loading is not intended behaviour. index eec44400b..76ad23f8d 100644
--- a/app/ui-utils/client/lib/openRoom.js
+++ b/app/ui-utils/client/lib/openRoom.js
@@ -101,14 +101,14 @@ export const openRoom = async function(type, name) {
return callbacks.run('enter-room', sub);
} catch (error) {
c.stop();
- if (type === 'd') {
+ if (type === 'd' && error.error !== 'error-invalid-user') {
const result = await call('createDirectMessage', ...name.split(', ')).then((result) => waitUntilRoomBeInserted(type, result.rid)).catch(() => {});
if (result) {
return FlowRouter.go('direct', { rid: result._id }, FlowRouter.current().queryParams);
}
}
Session.set('roomNotFound', { type, name, error });
- return appLayout.render('main', { center: 'roomNotFound' });
+ appLayout.render('main', { center: 'loading' });
}
});
};``` |
Solves errors being shown to user when creating direct chat by directly navigating to URL RocketChat#21735
[FIX] Avoid Invalid User Exception when entering direct chat while not authenticated RocketChat#21735
Description:
Following a major upgrade from 2.4 to 3.11.1, we started seeing several errors crop up in the log, listed as "
[error-invalid-user]
". While there is some semblance of a stack trace, there's little to no additional information to explain which user is generating this issue; or from what channel this issue is occurring in...just that there's a problem.I've looked through our users both in RC's administration panel, as well as directly in MongoDB; and nothing is jumping out at me as out of place or misconfigured.
Steps to reproduce:
Expected behavior:
No exceptions -- or at the very least, a little more detail in the exception log.
Actual behavior:
I've redacted the stack trace in this section for brevity. Actual logs will be listed in full in the 'Relevant Logs' section.
While I do not have the exception to share, I have also seen similar messages for the method "
loadMissedMessages
" in the recent past as well.Server Setup Information:
Client Setup Information
N/A
Additional context
We were not seeing these exceptions prior to our upgrade. I'm assuming something with these methods/functions changed during the year we remained on the old build. Additionally, here are some related issues I was able to locate in the tracker:
We have not yet tried on the latest release to see if the issue still arises, though I fear it may still occur.
Relevant logs:
Rocket.Chat.Electron > Administration > View Logs
Exception @ Method: getRoomByTypeAndName
Exception @ Method: createDirectMessage
Journalctl -xeu rocketchat
Exception @ Method getRoomByNameAndType
Exception @ Method createDirectMessage
The text was updated successfully, but these errors were encountered: