Trigger Id Expired--Socket Mode
See original GitHub issueI want to open a modal (a dropdown menu) in socket mode using the slash command and collect the data that users enter. However, no matter what I do, I keep getting a “trigger_id expired” error when I run the slash command. Sometimes the command will work the first time and open up the menu, but the second time I run the command it will say trigger_id expired. At first I thought this was because it was taking more than 3 seconds for my modal to open, but then I simplified the view a lot just to test this and got the same error. I also tried to follow this example (in case it is just a timeout issue): https://github.com/slackapi/node-slack-sdk/issues/1131 but it might be helpful if you could post what this would look like in python if possible. Thank you!
The slack_bolt
version
slack-sdk==3.5.0 slack-bolt==1.5.0
Python runtime version
python==2.7.16
OS info
ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H524 Darwin Kernel Version 19.6.0
Steps to reproduce:
- Use socket mode
- Have the following listener
app.command("/mycommand")
def open_modal(ack, body, client):
ack()
client.views_open(
# Pass a valid trigger_id within 3 seconds of receiving it
trigger_id=body["trigger_id"],
# View payload
view= {
"type": "modal",
"title": {
"type": "plain_text",
....}
})
Expected result:
The modal to open
Actual result:
Slack says dispatch_failed and I get the error: The server responded with:
{'ok': False, 'error': 'invalid_arguments', 'response_metadata': {'messages': ['[ERROR] `trigger_id` expired [json-pointer:/trigger_id]']}}
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
@mariebarrramsey
This indicates that your app has other active connections at the moment. If you are not sure where the other connections live, I would recommend trying the following steps:
You can configure app-level tokens at Settings > Basic Information > App-Level Tokens section.
Wow that was the problem!! Thank you so much! I have no idea how those other connections happened. All I can think is maybe some process was still running in the background or never got properly terminated.