-
Notifications
You must be signed in to change notification settings - Fork 844
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
conversations_invite() fails with "error: no_user" #1053
Comments
Hi @noperator -- thanks for taking the time to bring this to our attention! This is actually a bug on the SDK side of things: one we overlooked when sequence support was introduced. We'll work on getting a PR out to fix it. Thanks again for reporting it 🙂 |
Hi @noperator, thanks again for taking the time to report this. I was going to fix this issue but I found that the current implementation does work without any issues.
This error indicates the situation where no client.conversations_invite(channel=channel_id, users=None) Perhaps, the |
At this point, it seems clear that this is/was an issue with Slack's To summarize the core issue that I reported yesterday: Slack's
Totally—that was the first thing we ruled out yesterday. Here's how the
Okay—just tested It seems like this was an unintended "blip" in JSON types that Passing curl \
--request 'POST' \
--url 'https://slack.com/api/conversations.invite' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json; charset=utf-8' \
--data '{
"channel": "C1234567890",
"users": "U2345678901"
}'
# {
# "ok": false,
# "error": "no_user"
# } But passing curl \
--request 'POST' \
--url 'https://slack.com/api/conversations.invite' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json; charset=utf-8' \
--data '{
"channel": "C1234567890",
"users": ["U2345678901"]
}'
# {
# "ok": true,
# "channel": {
# [...]
# }
# }
# } Will follow up shortly with some quick testing just to ensure the |
@noperator Thanks for sharing more details! I will come up with a pull request to eliminate this issue with a few API methods. |
TL;DR: Until a few hours ago, the SDK function
conversations_invite()
used to succeed with no issues. Now, it fails witherror: no_user
. It seems that theusers
argument to theconversations.invite
API method may have changed to require a JSON array (rather than a comma-separated string), soconversations_invite()
may need to be updated accordingly. CC: @tracerteaReproducible in:
The Slack SDK version
Python runtime version
OS info
Steps to reproduce:
Attempt to invite a user to a channel via
conversations_invite()
, passing the following arguments:channel
(str
): The channel IDusers
(str
orlist
): A list of user IDs to inviteNote that if
conversations_invite()
is passedusers
as alist
(i.e., rather thanstr
—both types are indicated to be valid), it will collapse that list into a comma-separatedstr
, which is consistent with Slack's API documentation for theconversations.invite
method'susers
argument:Surprisingly, this will fail:
However, if we instead bypass
conversations_invite()
and directly call theconversations.invite
method so thatusers
is not collapsed into a comma-separatedstr
and is passed directly as alist
, the call succeeds:Expected result:
Expected a successful response from the
conversations.invite
API method:Actual result:
We get an error indicating that "No value was passed for
users
":The text was updated successfully, but these errors were encountered: