Change username on demo instance - Internal Server error
Your Rocket.Chat version: demo system
Hey Guys,
i try to change my name from "TheReal1604-1" to "TheReal-BusinessCat" - all my posts on the demo system changed the name, but i got an internal server error on the mask where i do the change.. if i logoff and logon again i got my old username in my account.


Same error when changing name
Did this happen more then once? Or just the one time?
@geekgonecrazy It is every time i try to change my username on the demo system.
@geekgonecrazy, In server console.
Exception while invoking method 'saveUserProfile' MongoError: The positional operator did not find the match needed from the query. Unexpanded update: usernames.$ at [object Object].Mongo.Collection.(anonymous function) (packages/mongo/collection.js:590:1) at [object Object].Mongo.Collection.(anonymous function) (packages/dispatch_run-as-user/packages/dispatch_run-as-user.js:300:1) at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/aldeed_collection2-core/lib/collection2.js:191:1) at _Class.update (server/models/_Base.js:78:29) at _Class.RocketChat.models.Rooms._Class.replaceUsername (packages/rocketchat_lib/server/models/Rooms.coffee:344:11) at RocketChat._setUsername (packages/rocketchat_lib/server/functions/setUsername.coffee:40:26) at Object.setUsername (packages/rocketchat_lib/server/lib/RateLimiter.coffee:14:15) at [object Object].Meteor.methods.setUsername (packages/rocketchat_lib/server/methods/setUsername.coffee:33:20)......
Same thing here in our own setup, changing the nick results in a 500 internal server error
I have the same issue. I started with version 0.33.0 and now am running the latest 0.38.0 but I didn't notice this until now. Not sure if it was introduced in an earlier version. I get the same exception on the server log as listed above. I use SAML to create the users, but currently it creates them as first initial then last name. We are changing all those users to first.last name for easier name search.
I wanted to followup with this. After further testing this seems to be hit and miss. Some email addresses were changeable while others cause the "internal Error" All usernames I have attempted this on causes the error.
After upgrading to version 0.39.0 I no longer have this issue. Thanks
@TheReal1604 can you confirm you still have this issue on 0.39.0 or the demo server?
@geekgonecrazy Change my username now works on the demo system. Thx! :-)
@TheReal1604 thanks for testing that out! 👍