invalid_array_arg when trying to change the user status
See original GitHub issue- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Description
I’m trying to update the status of my bot using the web client, but it fails with an error: invalid_array_arg
Steps to reproduce:
import * as SlackClient from '@slack/client';
const slackWebClient = new SlackClient.WebClient(botToken);
slackWebClient.users.profile.set({
profile: {
status_text: 'riding a train',
status_emoji: ':mountain_railway:'
}
});
Expected result:
Status of my bot is changed
Actual result:
It fails with an error
invalid_array_arg
Attachments:
error: Response not OK: invalid_array_arg
Unhandled rejection Error: invalid_array_arg
at handleHttpResponse (C:\Projects\slack-app\node_modules\@slack\client\lib\clients\transports\call-transport.js:103:17)
at handleTransportResponse (C:\Projects\slack-app\node_modules\@slack\client\lib\clients\transports\call-transport.js:153:19)
at apply (C:\Projects\slack-app\node_modules\lodash\lodash.js:499:17)
at wrapper (C:\Projects\slack-app\node_modules\lodash\lodash.js:5356:16)
at Request.handleRequestTranportRes (C:\Projects\slack-app\node_modules\@slack\client\lib\clients\transports\request.js:20:5)
at apply (C:\Projects\slack-app\node_modules\lodash\lodash.js:499:17)
at Request.wrapper [as _callback] (C:\Projects\slack-app\node_modules\lodash\lodash.js:5356:16)
at Request.self.callback (C:\Projects\slack-app\node_modules\request\request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (C:\Projects\slack-app\node_modules\request\request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (C:\Projects\slack-app\node_modules\request\request.js:1091:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
chat unfurl invalid array argument · Issue #1522 · howdyai/botkit
I have issue using bot.api.chat.unfurl, according the unfurl API everything should be correct. Error debug: Got response null {"ok":false ...
Read more >How to use try catch to replace invalid data of user input array ...
I want it to kick out the invalid input, and prompt the user to re-enter a valid input, and keep building it. import...
Read more >RangeError: invalid array length - JavaScript - MDN Web Docs
The JavaScript exception "Invalid array length" occurs when specifying an array length that is either negative, a floating number or exceeds ...
Read more >Error handling - Apollo GraphQL Docs
The GraphQL operation is not valid against the server's schema. BAD_USER_INPUT. The GraphQL operation includes an invalid value for a field argument.
Read more >JavaScript RangeErrors and How to Prevent Them
A RangeError is used to convey to a user that a value was passed into a ... an uncaught RangeError with the message...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks for the bug report, i was able to reproduce, so i’m labeling it accordingly.
here is a debug dump i captured while reproducing:
it looks like the value for
profile
is getting serialized asprofile[status_text]=...&profile[status_message]=...
rather thanprofile={"status_text":"...","status_message":"..."}
. This serialization is done for similar greater-than-one level JSON arguments in theassignApiArgs()
function. My suggested fix is to add an additional condition in there for whenkey === 'profile'
. I can probably get around to this in the next week or so, but PRs welcome too!I’m experiencing the same issue when updating the status