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

After updating to 0.68.0 Sidebar shows Usernames instead of Real Names #11598

Closed
johnyb0y opened this issue Jul 29, 2018 · 74 comments
Closed

After updating to 0.68.0 Sidebar shows Usernames instead of Real Names #11598

johnyb0y opened this issue Jul 29, 2018 · 74 comments

Comments

@johnyb0y
Copy link

johnyb0y commented Jul 29, 2018

Description:

After updating to 0.68.0 the left sidebar displays usernames instead of Real names.
I already searched settings (twice) and as far as I can tell every setting is set to Use Real Names.
Have i overlooked something ?

EDIT: Just to be clear: Before the update the sidebar showed the Real Names, not the usernames.

Steps to reproduce:

  1. Update to 0.68.0 from 0.65.2

Expected behavior:

Setting shouldn't change. Also toggling the various "Use Real Names" settings should have an effect and configure the sidebar to use Real Names again.

Actual behavior:

Username is shown and settings don't seem to change anything regarding the sidebar.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.68.0
  • Operating System: Debian 9.5
  • Deployment Method: tar
  • Number of Running Instances: 2
  • DB Replicaset Oplog: Yes
  • NodeJS Version: 8.11.3
  • MongoDB Version: Up-to-date Debian Stable Package

Thanks.

@himpierre
Copy link

Just took a look. I guess it was always like that? The sidbar only shows the username. No? Just checked my 0.66.0 installation.

@baevga
Copy link

baevga commented Jul 29, 2018

I have the same problem too. i was using 0.65.1 version and can to show realnames in sidebar. After update this option not work and all current chats became a username. We using numeric usernames and that so uncomfortable

@johnyb0y
Copy link
Author

@himpierre Nope, it worked before. We used real names in sidebar since at least 6 months.

@baevga
Copy link

baevga commented Jul 29, 2018

i checked if you delete room and start new privite chat it's start working. But all history will be lost of course

@johnyb0y
Copy link
Author

@baevga I think you are talking about a different problem. I'm talking about Real Names in the left sidebar.
You should open another issue for your problem.

@baevga
Copy link

baevga commented Jul 29, 2018

@johnyb0y
I'm talking about that problem https://prnt.sc/kcdist . I deleted one chat and start new one. After that it has real name in it's title like that http://prntscr.com/kcdjhk

Your issue about another problem?

@johnyb0y
Copy link
Author

johnyb0y commented Jul 29, 2018

@baevga That looks like the same problem I'm experiencing. But for me, deleting a chat and starting a new one doesn't help.

You also said something about your login policy not working anymore. That might be worth a separate issue.
Nevermind, I misunderstood you.

@gabrielloberg
Copy link

Same problem here.

@himpierre
Copy link

Which setting enables that feature? I have set "Set a User Name to Alias in Message" to true, but thats it.

@johnyb0y
Copy link
Author

@himpierre which Setting specifically no idea. There are various „Use real name“ Settings spread across the configuration menu.

@baevga
Copy link

baevga commented Jul 30, 2018

@himpierre, Option path
Administration -> Layout ->User Interface -> Use Real Name

@himpierre
Copy link

Uah. Thanks. Never saw this page. You learn something new every hour. :-)

@XshzX
Copy link

XshzX commented Jul 30, 2018

i set "Use Real Name" to true but nothing changed. is there another solution for this issue?

@baevga
Copy link

baevga commented Jul 30, 2018

@a1268512, This is not solution. This is setting that not working correctly and that's why this issue was created

@mpiotrowski-im
Copy link

It looks like a duplicate of #11553

@tomcsi
Copy link

tomcsi commented Jul 30, 2018

@mpiotrowski-im The #11553 is ldap authenticated config. The sidebar doesn't work at all.

@johnyb0y
Copy link
Author

@tomcsi yeah, but I think he might have misinterpreted his issue to be related to LDAP. Looks like the same issue to me.

@mpiotrowski-im
Copy link

@tomcsi It started as that but if you look closely it was corrected as a bug about sidebar (called message list in the issue). Look at the screenshot and comments. It is not about only ldap authenticated config.

@Scream85
Copy link

I have the same problem after going from 0.65.1 to 0.68.0.
I have only LDAP users, so hard to tell if it is LDAP related or not. In channels above posts it show the proper full name.

@johnyb0y
Copy link
Author

@Scream85 I have registration users as well and it's still happening. So LDAP seems to have no effect regarding this issue - at least for me.

@bkraul
Copy link

bkraul commented Jul 30, 2018

I just wonder why this issue is being largely ignored while other minor things are getting worked on, seeing the commits on develop. While this is not functionally breaking, I would consider it high-impact. From what I saw, all efforts were focused on release of 0.68 which was slated for the 27th. Hopefully some attention will be given to this. 😄

@johnyb0y
Copy link
Author

johnyb0y commented Jul 30, 2018

@bkraul True. If someone uses numeric or randomized usernames in LDAP Rocketchat is essentially broken.

@himpich
Copy link

himpich commented Jul 30, 2018

We are using 0.67.0. My left sidebar is mixed with nice "Name" Versions and not so nice "username" Versions.

Old conversations show up as 'Username', if I send a message to such a contact, the chat gets renamed to the 'Username' variant.

PS: Checking on another Chat using version 0.66.3, the problem seems to be the same
PPS: third chat, v0.66.1: I can't reproduce the Problem

@danpospisil
Copy link
Contributor

The same here - we had real names on 0.66.0 and now there is username on 0.68.0 in the left column.

@ahartlaub
Copy link

Same here. Reported previously about 2 weeks ago. We store our users extension numbers in their real name for easy phone tree lookup and this is crippling our use of RC.

@vesvalo
Copy link

vesvalo commented Jul 31, 2018

+1, the same problem

@adipose
Copy link

adipose commented Jul 31, 2018

So I had never heard of this "real names" thing until today, but I turned on the setting, and something very odd happened. Only about half of the usernames show, and the other half show real names. It appears to be the original 3-4 users I had on the system, before I imported the rest. So perhaps if the history was first recorded under the username, the real name can never be displayed?

Edit: turns out I'm still on .67. I guess I'll wait to update.

@bkraul
Copy link

bkraul commented Jul 31, 2018

The ones that still show real names will change to usernames as soon as you type a direct message to them.

@adipose
Copy link

adipose commented Jul 31, 2018

ah, ok well in spite of myself I updated to .68.1, and now they all show usernames...

@adipose
Copy link

adipose commented Jul 31, 2018

Problem solved. First update bundle/programs/server/app/app.js and fix the line that wrongly identifies v130 as db version v129. Then restart rocketchat and verify in the logs it has updated the db version.

Next, in mongo shell, run command from antoine here:

#11553

Pasted for your convenience:

function u(username) { return { username: username, result: db.rocketchat_subscription.updateMany({ $and: [ { 't': 'd' }, { 'name': username } ] }, { $set: { fname: db.users.findOne({ username: username }).name }, $currentDate: { _updatedAt: true } }) }; }
db.rocketchat_subscription.distinct('name', { t: 'd' }).map(function (s) { try { print(s); return u(s); } catch(err) { print('=> Failed') } })

In client, I used CTRL+SHIFT+I (set cache to OFF when dev tools open) and then CTRL+R to reload the client.

@ghost
Copy link

ghost commented Sep 13, 2018

@sampaiodiego
hi sam. it does not fix if i refresh. we are using LDAP.
if i toggle to Layout - User interface - Use Real Names to false, it will make all DMs show as users
when i toggle it back to true it only shows some as Real names and others stay as User names.

I started a community topic with some details:
https://forums.rocket.chat/t/usernames-show-instead-of-displaynames/1960

@lehrhardt
Copy link

Hi. Having the same issue, even after updating to 0.69.3 and resetting the data in android and desktop app, some usernames are still shown with uid instead of their realnames.

@adipose
Copy link

adipose commented Sep 13, 2018

@Ghoshnik and @lehrhardt , have you tried the mongodb script I posted above? Despite those saying it is not necessary, I did have to use it before things worked. But perhaps I forgot to clear cache or something--still it is worth a try.

@lehrhardt
Copy link

@adipose thanks for pointing this out. We have run this script manually and indeed, this fixed the display issue and all users are now being displayed with their realnames. thx.

@adipose
Copy link

adipose commented Sep 14, 2018

@lehrhardt Great!
@sampaiodiego Perhaps it is time to reexamine whether the db upgrade is sufficient to fix this issue for LDAP users? I also use LDAP and felt the mongodb script was required, and now it's seeming that others are finding the same.

@sampaiodiego
Copy link
Member

I'm afraid it is not fixed for new users. I have to take a new look into this.

@photoninger
Copy link

Will this issue be fixed in 0.70?
Or should it's state be changed to open again?

@sampaiodiego
Copy link
Member

this was proper fixed by #12154 and will be released to stable today.

@RACunha
Copy link

RACunha commented Sep 14, 2021

Problem returned in 3.18.0.
It only happens when receiving the first message from someone new. If I search for a contact and send him a message, the problem doesn't occur.
Captura de tela 2021-09-14 143249

@andys448
Copy link

andys448 commented Nov 2, 2021

Confirm this issue.

3.18.1

@RACunha
Copy link

RACunha commented Nov 2, 2021

Confirmed at least until 3.18.2

@KRW85
Copy link

KRW85 commented Nov 3, 2021

Confirmed at 4.1.0

@icerootsvw
Copy link

Confirmed for 3.18.3

@homberger
Copy link

homberger commented Jan 5, 2022

Try this fix in mongo shell:

use parties
db.rocketchat_subscription.find().forEach(function (subscription) {
	var user = db.users.findOne({username: subscription.name,}, { name: 1 });
	if (!user) {
		return;
	}
	db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},});
});

@icerootsvw
Copy link

icerootsvw commented Jan 5, 2022

@homberger any further steps needed? i executed the command but the user is still shown with username instead of real name

cd /snap/rocketchat-server/current/bin/
root@bl-rocket:/snap/rocketchat-server/current/bin# ./mongo
MongoDB shell version v3.6.14
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("4ba0cd18-8f81-4f35-8ac2-XXXXXXXX") }
MongoDB server version: 3.6.14
Server has startup warnings:
2021-12-15T17:47:39.029+0100 I STORAGE [initandlisten]
2021-12-15T17:47:39.029+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2021-12-15T17:47:39.029+0100 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten]
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten]
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten]
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2021-12-15T17:48:12.297+0100 I CONTROL [initandlisten]
rs0:PRIMARY> db.rocketchat_subscription.find().forEach(function (subscription) {
... var user = db.users.findOne({username: subscription.name,}, { name: 1 });
... if (!user) {
... return;
... }
... db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},});
... });

@homberger
Copy link

The result of the command you entered is missing in your copied text.
Did you only paste it into the mongo shell without executing the command, maybe?

If it was executed successfully, you should try to force reload your RC client (CTRL + SHIFT + R).

@icerootsvw
Copy link

@homberger sorry for the late response. here is what i entered. I did not get any result. Just a new emtpy line and reload the client with ctrl + shift + r did not fix the issue

`root@bl-rocket:~# rocketchat-server.mongo
MongoDB shell version v4.2.17
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("7a8f107b-7d13-449e-848a-c4073033f5ca") }
MongoDB server version: 4.2.17
Server has startup warnings:
2022-02-22T09:02:09.878+0100 I STORAGE [initandlisten]
2022-02-22T09:02:09.878+0100 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2022-02-22T09:02:09.878+0100 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten]
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten]
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten]
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2022-02-22T09:02:27.063+0100 I CONTROL [initandlisten]

Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).

The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.

To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()

rs0:PRIMARY> db.rocketchat_subscription.find().forEach(function (subscription) {
... var user = db.users.findOne({username: subscription.name,}, { name: 1 });
... if (!user) {
... return;
... }
... db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},});
... });
rs0:PRIMARY>
`

@icerootsvw
Copy link

my issue was i was not selecting the correct database (thank you to rocket chat support team)

rs0:PRIMARY> show dbs
admin 0.000GB
config 0.000GB
local 2.381GB
parties 1.536GB
rs0:PRIMARY> use parties

After that i executed this and it was fixed directly

`var subscriptions = db.rocketchat_subscription.find({
t: 'd',
});

subscriptions.forEach(function(subscription) {
var user = db.users.findOne({
username: subscription.name,
}, {
name: 1
});
if (!user) {
return;
}
db.rocketchat_subscription.update({
_id: subscription._id,
}, {
$set: {
fname: user.name,
},
});
})`

@homberger
Copy link

@homberger any further steps needed? i executed the command but the user is still shown with username instead of real name

In my comment a line was missing: use parties
Sorry!

@andys448
Copy link

use parties
db.rocketchat_subscription.find().forEach(function (subscription) {
var user = db.users.findOne({username: subscription.name,}, { name: 1 });
if (!user) {
return;
}
db.rocketchat_subscription.update({_id: subscription._id,}, {$set: {fname: user.name,},});
});

Hi! Works fine!

But this is a very long and expensive query:(

However many thanks for temporary solution. :)

@paulopera
Copy link

I'm facing the same problem where I need to run the mongo query in order to show the full name from the users in the sidebar.
My server information:
Deployment Version: 3.18.7
Apps Engine Version: 1.27.1
Node Version: v12.22.1
Database Migration: 232 (3 de Agosto de 2022 06:31)
MongoDB: 4.0.28 / mmapv1 (oplog Enabled)

Right now I'm creating a script to run the query daily in order to fix the display name.
Does somebody found a solution to fix?
Thanks!

@icerootsvw
Copy link

@paulopera die Script i postet on 17.03.22 fixed the wrong names for me, with the latest rocket chat version i did not notice the issue again, so i just had to fix the usernames onces with the script

@paulopera
Copy link

paulopera commented Aug 15, 2022

The scrip only works for the past conversations, some new conversations are still displaying the username and not the display name.
Could you please share the server information you're running right now @icerootsvw ?
I suspect because I'm running the 3.18.* I'm missing some DB update or something like that.

@icerootsvw
Copy link

@paulopera with 4.x/stable: 4.8.3 2022-08-08
the bug is gone, so maybe you check Version 4 if that is fine for you. I dont know if the bugfix was backported to 3.x as well

@paulopera
Copy link

I'm still running the old version because of the changes in Basic User Data Sync.

@CeeSharpDev
Copy link

Hello,

Got same issue, the RC client shows only usernames, even on the 'user info' there is no field that displays user's full name. Admin settings / Client Settings doesn't seem to change the behavior.

Well running the laltest stable version of RC: 6.11.1 / Mongo: 5.0

thanks in advance :)

@paulopera
Copy link

paulopera commented Sep 2, 2024

Hello @CeeSharpDev I got it fixed by using the script @icerootsvw posted but now we need to use the mongosh instead of the mongo to run the script.
Here the steps I did as I run RC on docker:

1- At the container folder: docker compose exec mongo bash
2- At the mongo container bash: mongosh
3- Select the mongo RC DB: use rocketchat;
4- Run the script provided above by @icerootsvw here

And now all the users got the Display Names instead of the usernames.
If some user still shows only the username try to logout and login back again that it will fix.

@CeeSharpDev
Copy link

Hello @paulopera thanks a ton for your response. Actually a wrong setting via Admin Settings was toggled earlier, hence no changes were realized, But found the right setting: 'Layout --> Use Real Names', this had fixed the issue.

Thank you again :)

@paulopera
Copy link

You are welcome @CeeSharpDev ! Indeed there's this setting where you can choose the Real Name.

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

No branches or pull requests