API issue with new user added to a room

Description

Server Setup Information

  • Version of Rocket.Chat Server: 7.10.0
  • Operating System: Ubuntu 24.04.3 LTS
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v22.16.0
  • MongoDB Version: 6.0.13 / wiredTiger (oplog Enabled)
  • Proxy:
  • Firewalls involved: No

Any additional Information

Hi All,

and sorry for my English.

Very basic usage of Rocketchat.

Many time ago I created this Room with 6 Users

image

Every morning a simple powershell execute API call to create a daily channel for the team and set the Autojoin.

All worked fine until we added the seventh users in the Room. The below request continue to return the original 6 users and totally missed the newone.

$getteaminfo =@{‘teamName’ = ‘OURTEAM’}

$getteaminfo_resultb = Invoke-RestMethod -Uri http://<serverip>:3000/api/v1/teams.members -Method GET -Body $getteaminfo -ContentType “application/json” -Headers $headers

Result: @{members=System.Object[]; total=6; count=6; offset=0; success=True}

The new user need every morning to join maually the daily channel.

Can someone help me to understand what i’m doing wrong?

Thanks in advance.

Best regards.

Massimo

You should either be on the latest 7.10.10 LTS which has a number of security fixes, or 8.4.x

You should also be on at least Mongo 7.x

Upgrade now.

Hi reetp,

just updated following Migrate from Bitnami MongoDB to the official MongoDB Image but unfortunately seems that nothing changed in our API request.

Trying to update again to 8.4.1 we found an issue with orphans docker that, in case, i need to post in a separate thread to avoid crossed argument.

Thanks.

Regards.

Massimo

Check the perms are right per the docs.

List all members of a team. Permission required: view-all-teams

I’d disable then enable again just to be sure.

Also read all the Teams docs to make sure nothing has changed.

You don’t mention your licence version or number of users, but be aware that IIRC some Team functions are limited if you are on CE.

Next thing is to check your logs.

That will probably tell you. You might need to set it to debug level.

Hi reetp,

just to be sure, you talking about the permission of the user that run the API request? Because he is user and we never change its permission.

About the version, hope this help:

Thanks.

Regards.

Massimo

Hi All,

some ideas?

Thanks.

Regards.

Massimo

OK I am trying to understand exactly what you are doing here so I can try and test it on a server.

Many time ago I created this Room with 6 Users

OK.

Create a daily channel for the team and set the Autojoin.

But you already have a channel above? Why create a new one?


I think you may be confusing Teams and Channels/Groups somehow, and possibly a ‘bug’ has allowed you to do something you probably shouldn’t and has now been closed. It won’t be the first time this has happened!

These are the two methods I know of.

With no teams:

Create a Private Room or Public Channel and add then add users.

You can script to create the Room/.Channel and ad all your users

Or:

Create a room/channel, create a Team, add users to the Team, add Rooms or Channels that you want them to join, and and set autojoin.

They should be automatically joined to that room/channel.

You should only need to add a user to the Team for them to join any channels.


Please explain exactly what you are trying to do, and show me how you do it all so I can try and replicate it.

Hi reetp,

and thanks for your time.

Probably you are right when say that i’m a little bit confused on the difference between Teams and Channels/Groups.

I will try again to explain:

In the Room section i have this:

image

That was originally created with 6 users. For me this is a Team and some day ago we added a new member and so you see 7 in the members columns.

We need to differenziate what we “discuss” every day and so we use this way, probably wrong but that work very well for us. I’m explaining manually what we do with the API.

From the admin access in the web interface:

  • HomeJoin roomsOpen Directory
  • Teams and then select OurTeam
  • Team channels (# button) → Create new
  • Write only the name and then Create
  • 3 dots on the right of the new Team channel → Auto-Join

Immediately after the selection of Auto-Join flag all 6 “original” members receive join notification in its clients, instead nothing for the seventh one added a few days ago that need to join manually the new Team Channel.

Our Powershell Script execute automatically exactly the above steps and, as for my first post, also the API return the “original” 6 users.

Hope i was more clear now.

Thanks.

Regards.

Massimo

Hi All,

any update after my (hopefully clear) explanation?

Thanks.

Regards.

Massimo

I understand a bit more now. However…

Yes Teams are odd as they appear as a /group message channel but appear as a ‘room’ in the #Rooms view in Settings. :fearful:

So you can use a Team as a single message channel for messages.

Equally you can nominate channels/groups that Team members can automatically be joined to.

I presume you do not use the 'Team channel for messages, but JUST create a new channel/room that you autojoin daily (you must have a lot of channels now?) ?

Very confusing IMHO.

Regardless it doesn’t tell us why user number 7 is not joined to a channel if they are a member of a group.

What do you have for Team Advanced settings?

Is the Team ‘Private’?

Security & permissions? Is the new user properly registered?

What do your logs say - you need to set them to debug mode and check.

Hi reetp,

and thanks again for you time.

(you must have a lot of channels now?) ?

For sure :slightly_smiling_face: but currently this IMHO work well for us and a second powershell script, that run monthly, remove the older channel.

Going to your questions:

What do you have for Team Advanced settings?

Is the Team ‘Private’?

Seems to be public as for attached image in my previous post

Security & permissions? Is the new user properly registered?

Compared a lot of time with the existing. Everything is exactly equal for all 7 users.

What do your logs say - you need to set them to debug mode and check.

Please, can you explain me how to achieve this?

Thanks.

Regards.

Massimo

Look at “retention policy” and save yourself work…

If you are using scripts and APIs you probably shouldn’t be asking this.

Read the docs? Look in the admin settings under Logs?