Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Channel Moderators List REST API does no longer accept roomName

Open jadolg opened this issue 2 years ago • 12 comments

Description:

/api/v1/channels.moderators is no longer accepting listing moderators by roomName.

Calling the endpoint with only this returns {'error': "must have required property 'roomId' [invalid-params]", 'errorType': 'invalid-params', 'success': False}

Steps to reproduce:

  1. Do a call against the endpoint curl -H "X-Auth-Token: yourToken"
    -H "X-User-Id: yourUserID"
    http://localhost:3000/api/v1/channels.moderators?roomName=General

Expected behavior:

Get the list of moderators for the GENERAL room

Actual behavior:

Returns an error asking for roomId

{'error': "must have required property 'roomId' [invalid-params]", 'errorType': 'invalid-params', 'success': False}

Server Setup Information:

  • Version of Rocket.Chat Server: 4.8
  • Operating System: linux
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version: 4

Client Setup Information

  • Desktop App or Browser Version:
  • Operating System:

Additional context

Relevant logs:

jadolg avatar Jul 14 '22 12:07 jadolg

@debdutdeb looks like you might have been the last one to touch this in https://github.com/RocketChat/Rocket.Chat/pull/25279 any ideas?

geekgonecrazy avatar Jul 14 '22 19:07 geekgonecrazy

This is fixed in the latest develop.

debdutdeb avatar Jul 16 '22 13:07 debdutdeb

I was trying to give it a try with rocketchat/rocket.chat:develop but seems I can't use it the same way I use rocket.chat:latest. The server seems to ignore MONGO_URL and directly tries to connect to MongoDB on localhost. :confused:

jadolg avatar Jul 16 '22 17:07 jadolg

The only situation I can see this happen is if the env variable was actually not passed to the container. Can you share the command[s] or compose file you're using?

debdutdeb avatar Jul 16 '22 18:07 debdutdeb

This is the compose file I use for testing. I only replaced the image. https://github.com/jadolg/rocketchat_API/blob/master/docker-compose-test-server.yml

jadolg avatar Jul 16 '22 18:07 jadolg

@debdutdeb is there any schedule I can follow for when this fix will be released in latest? I have a couple of PRs I'd like to merge and I would like to avoid skipping the failing test.

jadolg avatar Jul 25 '22 07:07 jadolg

@geekgonecrazy @debdutdeb are this changes already life in latest? I was not able to test against your develop branch.

jadolg avatar Aug 07 '22 09:08 jadolg

Yes this should now be fixed in the latest release.

debdutdeb avatar Aug 07 '22 09:08 debdutdeb

Ah no wait i might be confusing with another similar bug. Give me an hour; in the store. I thought this was covered in the PR.

debdutdeb avatar Aug 07 '22 09:08 debdutdeb

Hey @jadolg thanks for waiting. I just checked, it is indeed working on latest develop so I didn't confuse. Screenshot 2022-08-07 at 3 58 47 PM I won't close the issue just yet; can you check one more time please?

debdutdeb avatar Aug 07 '22 10:08 debdutdeb

You can also check against our open server; Screenshot 2022-08-07 at 4 03 16 PM

debdutdeb avatar Aug 07 '22 10:08 debdutdeb

Thank you so much for checking. I still cannot run my tests against your develop image. I guess I'll wait until it gets merged and eventually lands on this image which I use for testing every week. Do you know approximately when these changes are being released? Do you have any quick docker-compose setup I can use (like the one here https://github.com/jadolg/rocketchat_API/blob/master/docker-compose-test-server.yml) but for the images your produce in https://hub.docker.com/r/rocketchat/rocket.chat ? edit: I also tried with registry.rocket.chat/rocketchat/rocket.chat:develop and I get the same result. It seems to ignore MONGO_URL and tries to connect to localhost.

jadolg avatar Aug 07 '22 21:08 jadolg

Well, the problem seems to be gone in the latest version.

jadolg avatar Aug 30 '22 13:08 jadolg