Slack integration error with interactive components - Rasa Open Source - Rasa Community Forum
Slack integration error with interactive components
You have selected 0 posts.
4.4k views 9 likes 6 links 9 users
15](https://forum.rasa.com/u/mina.fsh "mina.fsh")
9](https://forum.rasa.com/u/athenasaurav "athenasaurav")
7](https://forum.rasa.com/u/rajas.black "rajas.black")
7](https://forum.rasa.com/u/cck197 "cck197")
5](https://forum.rasa.com/u/JiteshGaikwad "JiteshGaikwad")
read 9 min
Top replies
50 / 50
May 2020
post by mina.fsh on Apr 5, 2020
Hey, I integrated my Rasa bot in Slack. I have some buttons defined in my domain file : utter_otherQuestions:
- text: “Do you have any other question?”
buttons:
- title: “Yes” payload: ‘/affirm’
- title: “No” payload: ‘/deny’
I followed all the instructions, after running rasa and hitting the button in slack, I get the error: 2020-04-05 13:30:51 WARNING rasa.core.channels.slack - Received message on unsupported channel: D010VBL775H [2020-04-05 13:30:56 +0200] [1376] [ERROR] Exception occurred while handling uri: ‘ http://ac8cc757.ngrok.io/webhooks/slack/webhook’
So basically when I hit the button in slack, nothing happens. Can someone help me here?
Me too
4.4k views 9 likes 6 links 9 users
15](https://forum.rasa.com/u/mina.fsh "mina.fsh")
9](https://forum.rasa.com/u/athenasaurav "athenasaurav")
7](https://forum.rasa.com/u/rajas.black "rajas.black")
7](https://forum.rasa.com/u/cck197 "cck197")
5](https://forum.rasa.com/u/JiteshGaikwad "JiteshGaikwad")
read 9 min
Top replies
post by athenasaurav on Apr 5, 2020
You can set channel specific responses in rasa. Please visit this link :
post by mina.fsh on Apr 6, 2020
@athenasaurav Hey, Thanks for the help. I did add the channel specific response in my domain file:
responses:
utter_greet:
- text: "Welcome to Rasa digital assistant! It can provide you information about tracked products. What would you like to know?"
channel: "slack"
custom:
- # payload for Slack buttons
- title: "Location of the product"
payload: '/Where{"productNumber": "None"}'
- title: "Business step of the product"
payload: '/why{"location": "None"}'
- title: "Products in the location"
payload: '/what{"location": "None"}'
But still, I get the same error:
2020-04-06 10:51:10 WARNING rasa.core.channels.slack - Received message on unsupported channel: D010VBL775H
[2020-04-06 10:51:13 +0200] [24009] [ERROR] Exception occurred while handling uri: 'http://ea7a90fb.ngrok.io/webhooks/slack/webhook'
Traceback (most recent call last):
File "/home/home/assistant/lib/python3.7/site-packages/sanic/request.py", line 173, in load_json
self.parsed_json = loads(self.body)
ValueError: Expected object or value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/home/assistant/lib/python3.7/site-packages/sanic/app.py", line 976, in handle_request
response = await response
File "/home/home/assistant/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 356, in webhook
metadata = self.get_metadata(request)
File "/home/home/assistant/lib/python3.7/site-packages/rasa/core/channels/slack.py", line 329, in get_metadata
slack_event = request.json
File "/home/home/assistant/lib/python3.7/site-packages/sanic/request.py", line 167, in json
self.load_json()
File "/home/home/assistant/lib/python3.7/site-packages/sanic/request.py", line 177, in load_json
raise InvalidUsage("Failed when parsing body as json")
sanic.exceptions.InvalidUsage: Failed when parsing body as json
Any Idea how I can get rid of this error? I am trying to solve it for 4 days, but were not successfull.
post by athenasaurav on Apr 6, 2020
Hi. Does you buttom appears but payload is not delivered.
post by mina.fsh on Apr 6, 2020
@athenasaurav yes, the buttons appear. I hit one and then nothing happens.
when I run ra run --enable-api --cors "*" --debug in my terminal, I also get this:
2020-04-06 11:45:30 DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model for 'ResponseSelector'. Maybe you did not provide enough training data and no model was trained or the path '/tmp/tmpcaixaoxb/nlu' doesn't exist?
And then comes the error I mentioned above.
post by athenasaurav on Apr 6, 2020
I thought so too. Can you show your intent, stories and domain data completely
post by mina.fsh on Apr 6, 2020
1
@athenasaurav This is my stories file:
## greet
* greet
- utter_greet
## goodbye
* goodbye
- utter_goodbye
## what with correct location name
* what{"location":"Robot area"}
- action_product_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* affirm
- utter_suggestions
## what with correct location name
* what{"location":"Robot area"}
- action_product_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* deny
- utter_goodbye
## greet + what with no location name
* greet
- utter_greet
* what
- utter_ask_location
* inform{"location":"Robot area"}
- action_product_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* affirm
- utter_suggestions
## greet + what with no location name
* greet
- utter_greet
* what
- utter_ask_location
* inform{"location":"Robot area"}
- action_product_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* deny
- utter_goodbye
## where with correct PN
* where{"productNumber":"LB-4488-3-A1103"}
- action_location_search
- slot{"productNumber":"LB-4488-3-A1103"}
- slot{"location":"Cold storage"}
- utter_otherQuestions
* affirm
- utter_suggestions
## where with correct PN
* where{"productNumber":"LB-4488-3-A1103"}
- action_location_search
- slot{"productNumber":"LB-4488-3-A1103"}
- slot{"location":"Cold storage"}
- utter_otherQuestions
* deny
- utter_goodbye
## greet + where with no PN + affirm
* greet
- utter_greet
* where
- utter_ask_productNumber
* inform{"productNumber":"LB-4488-3-A1103"}
- action_location_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* affirm
- utter_suggestions
## greet + where with no PN + deny
* greet
- utter_greet
* where
- utter_ask_productNumber
* inform{"productNumber":"LB-4488-3-A1103"}
- action_location_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* deny
- utter_goodbye
## where with different PNs
* where{"productNumber":"LB-4488-3-A1103"}
- action_location_search
- slot{"productNumber":"LB-4488-3-A1103"}
- slot{"location":"Robot area"}
- utter_otherQuestions
* affirm
- utter_suggestions
* where{"productNumber":"LB-4488-3-A1102"}
- action_location_search
- slot{"productNumber":"LB-4488-3-A1102"}
- slot{"location":"Pod Tiling area"}
- utter_otherQuestions
* deny
- utter_goodbye
## why with correct PN
* why{"productNumber":"LB-4488-3-A1103"}
- action_bizStep_search
- slot{"productNumber":"LB-4488-3-A1103"}
- slot{"location":"Robot area"}
- utter_otherQuestions
* affirm
- utter_suggestions
## why with correct PN
* why{"productNumber":"LB-4488-3-A1103"}
- action_bizStep_search
- slot{"productNumber":"LB-4488-3-A1103"}
- slot{"location":"Robot area"}
- utter_otherQuestions
* deny
- utter_goodbye
## greet + why with no PN + affirm
* greet
- utter_greet
* why
- utter_ask_productNumber
* inform{"productNumber":"LB-4488-3-A1103"}
- action_bizStep_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* affirm
- utter_suggestions
## greet + where with no PN + deny
* greet
- utter_greet
* why
- utter_ask_productNumber
* inform{"productNumber":"LB-4488-3-A1103"}
- action_bizStep_search
- slot{"location":"Robot area"}
- slot{"productNumber":"LB-4488-3-A1103"}
- utter_otherQuestions
* deny
- utter_goodbye
post by mina.fsh on Apr 6, 2020
this is how my domain file looks:
intents:
- greet
- goodbye
- affirm
- deny
- what
- where
- why
- inform
entities:
- productNumber
- location
slots:
location:
type: unfeaturized
auto_fill: True
productNumber:
type: unfeaturized
auto_fill: True
actions:
- utter_greet
- utter_goodbye
- utter_otherQuestions
- utter_suggestions
- utter_ask_location
- utter_ask_productNumber
- action_location_search
- action_bizStep_search
- action_product_search
responses:
utter_greet:
- text: "Welcome to Rasa digital assistant! It can provide you information about tracked products. What would you like to know?"
channel: "SlackBot"
custom:
- # payload for Slack buttons
buttons:
- title: "Location of the product"
payload: '/where'
- title: "Business step of the product"
payload: '/why'
- title: "Products in the location"
payload: '/what'
- text: "Welcome to Rasa digital assistant! It can provide you information about tracked products. What would you like to know?"
buttons:
- title: "Location of the product"
payload: '/Where'
- title: "Business step of the product"
payload: '/why'
- title: "Products in the location"
payload: '/what'
utter_ask_location:
- text: "Please tell me a valid location name."
utter_ask_productNumber:
- text: "Please tell me a valid product number."
utter_goodbye:
- text: "Bye!"
utter_otherQuestions:
- text: "Do you have any other question?"
channel: "SlackBot"
custom:
- # payload for Slack buttons
buttons:
- title: "Yes"
payload: '/affirm'
- title: "No"
payload: '/deny'
- text: "Do you have any other question?"
buttons:
- title: "Yes"
payload: '/affirm'
- title: "No"
payload: '/deny'
utter_suggestions:
- text: "What would you like to know?"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: false
post by mina.fsh on Apr 6, 2020
my endpoin is:
action_endpoint:
url: http://localhost:5055/webhook
and credentials is:
rest:
# # you don't need to provide anything here - this channel doesn't
# # require any credentials
slack:
slack_token: "xoxb-631506400631-1xxxxxx4-TR7ZcBsY5gvXyGlrw6eodw5w"
slack_channel: "#vui-design"
slack_retry_reason_header: "x-slack-retry-reason" # Slack HTTP header name indicating reason that slack send retry request. This configuration is optional.
slack_retry_number_header: "x-slack-retry-num" # Slack HTTP header name indicating the attempt number. This configuration is optional.
errors_ignore_retry: None # Any error codes given by Slack included in this list will be ignored. Error codes are listed `here <https://api.slack.com/events-api#errors>`_.
rasa:
url: "http://localhost:5002/api"
post by athenasaurav on Apr 6, 2020
Intents also please
post by athenasaurav on Apr 6, 2020
mina.fsh](https://forum.rasa.com/t/slack-integration-error-with-interactive-components/27047/50 "Load parent post")
Channel need to be Slack not slackbot
post by mina.fsh on Apr 6, 2020
athenasaurav](https://forum.rasa.com/t/slack-integration-error-with-interactive-components/27047/50 "Load parent post")
@athenasaurav you mean my nlu data?
post by athenasaurav on Apr 6, 2020
Yes
post by mina.fsh on Apr 6, 2020
@athenasaurav I corrected the channel name to slack, but still the same error. here is my nlu data:
## intent:greet
- hey
- hello
- hi
- good morning
- good evening
- hey there
- hello assistant
- hey assistant
- hi assistant
- hi rasa
- hi digital assistant
- hello rasa
- hello digital assistant
## intent:goodbye
- bye
- goodbye
- see you around
- see you later
- thanks
- that's all. thanks
## intent:affirm
- yes
- indeed
- of course
- that sounds good
- correct
## intent:deny
- no
- never
- I don't think so
- don't like that
- no way
- not really
## intent:what
- what is in [storage](location)
- which product is in [robot](location)
- tell me the products in [tiling](location)
- what product is under [installation](location)
- tell me the products in [Pod Tiling](location)
- what can you find in the [Storage Area](location)
- tell me a list of all products in the [Cold Storage](location)
- i want to know a list of products in this location
- i need to know the products currently [entering](location)
- What's in the [tiling area](location) at the moment
- products in the [Cold](location) area
- Give me a list of all products that are [exiting](location)
- tell me which products are in the [Robot Area](location)?
- what is in the [robot area](location)
- what is in [Robot area](location)?
- what is in [robot area](location)
- what is in the [storage area](location)
- what is in the [storage](location)
- products in the [Tiling](location)
- which products are they [installing](location)
- list of products in [tiling area](location)
- inform me about all products in [pod tiling](location)
- what is [entering and exiting](location)
- what is in currently [entering](location:Cold storage)
- what is in the [room number one](location)
- what is in the [kitchen](location)
- what is in the [business location](location)
- I want to know the products in the [business area](location)
- I want to know the list of products in the [shop floor area](location)
- what else is in this location?
- Products in the location
## intent:where
- Where's the product [LB-4488-3-A1101](productNumber) at the moment
- Find [LB-4488-3-A1102](productNumber)
- Where can I find [LB-4488-3-A1103](productNumber)
- Help me to find the product [LB-4488-3-A1103](productNumber)
- I want to know the current location of the product [LB-4488-3-A1104](productNumber)
- Location of [LB-4488-3-A1102](productNumber)
- Tell me where is [LB-4488-3-A1102](productNumber)
- Let's find [LB-4488-3-A1101](productNumber)
- Tell me in which business location is [LB-4488-3-A1103](productNumber)
- where is [LB-4488-3-A1102](productNumber)
- where is [A1102] (productNumber)
- where is the product [1102](productNumber)
- Location of the product
- Location of a product
- business location
## intent:why
- What is happening to [LB-4488-3-A1101](productNumber)
- [LB-4488-3-A1102](productNumber)
- business step for [LB-4488-3-A1103](productNumber)
- what is the business step for [LB-4488-3-A1103](productNumber)
- at which business step is [A1103](productNumber)
- why is it there?
- Business step of the product
- what is happening to it?
- what is happening to this product
- what is the business step
- business step
## intent:inform
- [LB-4488-3-A1101](productNumber)
- [LB-4488-3-A1104](productNumber)
- [LB-4488-3-A1103](productNumber)
- [LB-4488-3-A1102](productNumber)
- [1103](productNumber)
- [A1113](productNumber)
- the product number is [LB-4488-3-A1101](productNumber)
- the product number is [LB-4488-3-A1105](productNumber)
- the location is [robot area](location)
- the location is [cold storage](location)
- [robot](location)
- [storage](location)
- [storage area](location)
- [entering](location)
- [exiting](location)
- [installation](location)
- [tiling](location)
- [pod tiling area](location)
- [pod tiling](location)
- [shop floor](location)
## synonym:Cold storage
- exiting
- cold area
- cold storage
- entering and exiting
- entering
- cold storage area
- Cold Storage
- Cold
- Storage Area
- storage
- storage area
## synonym:Pod Tiling area
- Tiling
- Pod Tiling
- installing
- tiling
- pod tiling
- installation
- tiling area
- pod tiling area
## synonym:Robot area
- robot area
- Robot Area
- robot
post by athenasaurav on Apr 6, 2020
Okay i got it. You custom channel payload is incorrect. Your payload should be like.
utter_greet:
- text : "Wecome to Rasa digital assistant"
channel: "Slack"
custom:
- text : "what would u like to know?"
buttons:
- title: "Location of the product"
payload: '/Where's the product LB-4488-3-A1101 at the moment'
- title: "Business step of the product"
payload: '/why is it there?'
- title: "Products in the location"
payload: '/what is in storage.'
similarly for others.
post by mina.fsh on Apr 6, 2020
@athenasaurav Thanks for giving me your time. I did the changes as you proposed in the domain file, but I am still getting the same error.
post by athenasaurav on Apr 6, 2020
Hello please refer to this thread Slack buttons fail silently
post by mina.fsh on Apr 7, 2020
@akelad @Juste Hi Rasa team, could you please help me with this issue. Thank you.
post by stephens on Apr 9, 2020
stephensGreg Stephens Advanced Rasa Certified Developer
Hi Mina,
Under Apps at the bottom of the channels pane, find your app and try sending a direct message.
In the credentials.yml, replace
slack_channel: "#vui-design"
with
slack_channel: "D010VBL775H"
Greg
post by mina.fsh on Apr 10, 2020
Thank you for the help so far. However, the problem persists. I investigated the error further and drilled down to slack.py and request.py. The lowest-level error I found is this: “Failed when parsing body as json” in the request.py. line 173. I cannot parse the body of the response and outputting the body reveals to me that the body is not a valid json.
It looks like this (xxx I used to replace real data):
‘payload={“type”:“block_actions”,“user”:{“id”:“UJHLBCLMT”,“username”:“xxx”,“name”:“xxx”,“team_id”:“TJKEWBSJK”},“api_app_id”:“xxx”,“token”:“xxx”,“container”:{“type”:“message”,“message_ts”:“1586512448.003600”,“channel_id”:“D010VBL775H”,“is_ephemeral”:false},“trigger_id”:“1063872498833.631506400631.785c625eb6683cd0e4fc973f28870f67”,“team”:{“id”:“TJKEWBSJK”,“domain”:“biba-workspace”},“channel”:{“id”:“D010VBL775H”,“name”:“directmessage”},“message”:{“bot_id”:“B0118SEML31”,“type”:“message”,“text”:“Welcome+to+Rasa+digital+assistant!+It+can+provide+you+information+about+products.+What+would+you+like+to+know?”,“user”:“U0116RJKP0Q”,“ts”:“1586512448.003600”,“team”:“TJKEWBSJK”,“blocks”:[{“type”:“section”,“block_id”:“B2A”,“text”:{“type”:“plain_text”,“text”:“Welcome+to+Rasa+digital+assistant!+It+can+provide+you+information+about+products.+What+would+you+like+to+know?”,“emoji”:true}},{“type”:“actions”,“block_id”:“WCej”,“elements”:[{“type”:“button”,“action_id”:“1Eq”,“text”:{“type”:“plain_text”,“text”:“Affirm”,“emoji”:true},“value”:“affirm”}]}]},“response_url”:“https://hooks.slack.com/actions/TJKEWBSJK/1063872498705/HyIZ0Vg7Bgwbeug5mjntcZTX”,“actions”:\[{“action\_id”:“1Eq”,“block\_id”:“WCej”,“text”:{“type”:“plain\_text”,“text”:“Affirm”,“emoji”:true},“value”:“affirm”,“type”:“button”,“action\_ts”:“1586512450.073137”}\]}’
To me this looks like Rasa cannot properly process the button response from Slack.
post by evios on Apr 14, 2020
Hi @mina.fsh, @stephens, @athenasaurav. Same error for me with very default configuration: Everythink OK wile chatting, but once button (interactivity) should be pressed error occured. File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/sanic/request.py”, line 177, in load_json raise InvalidUsage(“Failed when parsing body as json”) sanic.exceptions.InvalidUsage: Failed when parsing body as json
Detailed debug: 2020-04-14 22:53:57 DEBUG rasa.core.tracker_store - Recreating tracker from sender id ‘UT4KC4Q4U’ 2020-04-14 22:53:57 DEBUG rasa.core.processor - Received user message ‘hey’ with intent ‘{‘name’: ‘greet’, ‘confidence’: 0.9118240223407343}’ and entities ‘[]’ 2020-04-14 22:53:57 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 47 events. 2020-04-14 22:53:57 DEBUG rasa.core.policies.memoization - Current tracker state [{‘prev_action_listen’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_ask_domain’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_ask_domain’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}] 2020-04-14 22:53:57 DEBUG rasa.core.policies.memoization - There is no memorised next action 2020-04-14 22:53:58 DEBUG rasa.core.policies.mapping_policy - The predicted intent ‘greet’ is mapped to action ‘utter_ask_domain’ in the domain. 2020-04-14 22:53:58 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_MappingPolicy 2020-04-14 22:53:58 DEBUG rasa.core.processor - Predicted next action ‘utter_ask_domain’ with confidence 1.00. 2020-04-14 22:53:58 DEBUG rasa.core.processor - Action ‘utter_ask_domain’ ended with events ‘[BotUttered(‘Welcome to Knowledge Base Assistant. Which skills you would like to improve? You can easily change domain in future by simply ask assistant to ‘change domain’ or alike request:)’, {“elements”: null, “quick_replies”: null, “buttons”: [{“payload”: “/set_domain{“domain”: “Agile”}”, “title”: “Agile skills”}, {“payload”: “/set_domain{“domain”: “Startup”}”, “title”: “Startup skills”}], “attachment”: null, “image”: null, “custom”: null}, {}, 1586894038.061376)]’. 2020-04-14 22:53:58 DEBUG slack.web.slack_response - Received the following response: {‘ok’: True, ‘channel’: ‘D011ZUAKES0’, ‘ts’: ‘1586894038.004400’, ‘message’: {‘bot_id’: ‘B011ZUAK6J0’, ‘type’: ‘message’, ‘text’: “Welcome to Knowledge Base Assistant. Which skills you would like to improve? You can easily change domain in future by simply ask assistant to ‘change domain’ or alike request:)”, ‘user’: ‘U011ZUAK7V2’, ‘ts’: ‘1586894038.004400’, ‘team’: ‘TT539R8V6’, ‘bot_profile’: {‘id’: ‘B011ZUAK6J0’, ‘deleted’: False, ‘name’: ‘EnderTuring’, ‘updated’: 1586879448, ‘app_id’: ‘A012GNFGESC’, ‘icons’: {‘image_36’: ‘ https://a.slack-edge.com/80588/img/plugins/app/bot_36.png’, ‘image_48’: ‘ https://a.slack-edge.com/80588/img/plugins/app/bot_48.png’, ‘image_72’: ‘ https://a.slack-edge.com/80588/img/plugins/app/service_72.png’}, ‘team_id’: ‘TT539R8V6’}, ‘blocks’: [{‘type’: ‘section’, ‘block_id’: ‘qlP9’, ‘text’: {‘type’: ‘plain_text’, ‘text’: “Welcome to Knowledge Base Assistant. Which skills you would like to improve? You can easily change domain in future by simply ask assistant to ‘change domain’ or alike request:)”, ‘emoji’: True}}, {‘type’: ‘actions’, ‘block_id’: ‘UHo’, ‘elements’: [{‘type’: ‘button’, ‘action_id’: ‘olkTx’, ‘text’: {‘type’: ‘plain_text’, ‘text’: ‘Agile skills’, ‘emoji’: True}, ‘value’: ‘/set_domain{“domain”: “Agile”}’}, {‘type’: ‘button’, ‘action_id’: ‘c47Nm’, ‘text’: {‘type’: ‘plain_text’, ‘text’: ‘Startup skills’, ‘emoji’: True}, ‘value’: ‘/set_domain{“domain”: “Startup”}’}]}]}} 2020-04-14 22:53:58 DEBUG rasa.core.policies.memoization - Current tracker state [{‘prev_utter_ask_domain’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_ask_domain’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_action_listen’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_ask_domain’: 1.0, ‘slot_domain_0’: 1.0, ‘intent_greet’: 1.0}] 2020-04-14 22:53:58 DEBUG rasa.core.policies.memoization - There is no memorised next action 2020-04-14 22:53:58 DEBUG rasa.core.policies.mapping_policy - The mapped action, ‘utter_ask_domain’, for this intent, ‘greet’, was executed last so MappingPolicy is returning to action_listen. 2020-04-14 22:53:58 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_MappingPolicy 2020-04-14 22:53:58 DEBUG rasa.core.processor - Predicted next action ‘action_listen’ with confidence 1.00. 2020-04-14 22:53:58 DEBUG rasa.core.processor - Action ‘action_listen’ ended with events ‘[]’. 2020-04-14 22:53:58 DEBUG rasa.core.tracker_store - Tracker with sender_id ‘UT4KC4Q4U’ stored to database 2020-04-14 22:53:58 DEBUG rasa.core.lock_store - Deleted lock for conversation ‘UT4KC4Q4U’. 2020-04-14 22:53:58 WARNING rasa.core.channels.slack - Received message on unsupported channel: D011ZUAKES0 [2020-04-14 22:54:01 +0300] [15799] [ERROR] Exception occurred while handling uri: ‘ http://edd4eeb3.ngrok.io/webhooks/slack/webhook’ Traceback (most recent call last): File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/sanic/request.py”, line 173, in load_json self.parsed_json = loads(self.body) ValueError: Expected object or value
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/sanic/app.py”, line 976, in handle_request response = await response File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/rasa/core/channels/slack.py”, line 356, in webhook metadata = self.get_metadata(request) File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/rasa/core/channels/slack.py”, line 329, in get_metadata slack_event = request.json File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/sanic/request.py”, line 167, in json self.load_json() File “/Users/evios/opt/anaconda3/lib/python3.7/site-packages/sanic/request.py”, line 177, in load_json raise InvalidUsage(“Failed when parsing body as json”) sanic.exceptions.InvalidUsage: Failed when parsing body as json
post by rajas.black on Apr 18, 2020
rajas.blackRajesh Kumar Enthusiast
Hi @mina.fsh Is the error resolved for you? If so, please explain how did you go with the error.
I’m facing exactly the same error after deploying my chatbot on slack. Tried troubleshooting following the steps mentioned by others, but no joy.
Please help. Thanks.
post by mina.fsh on Apr 19, 2020
@evios @rajas.black Hi, welcome to Rasa forum.
Unfortunately my problem persists and I could not find a solution yet.
post by rajas.black on Apr 19, 2020
rajas.blackRajesh Kumar Enthusiast
Hi @mina.fsh
I figured out the issue. It’s resolved and working fine. Thanks everyone.
post by rajas.black on Apr 19, 2020
rajas.blackRajesh Kumar Enthusiast
mina.fsh](https://forum.rasa.com/t/slack-integration-error-with-interactive-components/27047/50 "Load parent post")
Let me know if we can connect offline and try to resolve. It becomes cumbersome to troubleshoot by going to and fro.
post by mina.fsh on Apr 19, 2020
@rajas.black Nice job. How can I connect to you to get the solution?
post by rajas.black on Apr 19, 2020
rajas.blackRajesh Kumar Enthusiast
Yes i am wondering how can we connect
post by mina.fsh on Apr 19, 2020
Can you please write shortly what you did in here, so other people can also use it later?
post by rajas.black on Apr 19, 2020
rajas.blackRajesh Kumar Enthusiast
I made sure my credential files are right. I made sure the action server is running. Action server has only one resource, so you can either run interactive or shell or the ngrok. So after the action server is running, i started a public domain from ngrok and installed the app from slack. It is working as expected.
Make sure the credentials are correct, i.e., the bot user token authID.
Regards, Rajesh
post by mina.fsh on Apr 19, 2020
@rajas.black can you please show me how you coded your buttons in domain file. I think that might lead me to the problem I have. For me the credentials are correct. about running the actions, so first you use the command rasa run actions and then you start the domain from ngrok, while the actions are not being used in rasa x or any other resource, right? I do the same. that’s why I believe my problem can be related to wrong structure in the domain file for the slack buttons.
post by rajas.black on Apr 20, 2020
rajas.blackRajesh Kumar Enthusiast
@mina.fsh Just an example below. My domain file is .yml and not .json
responses: utter_example - buttons: - payload: ABC - title: ABC
post by athenasaurav on Apr 23, 2020
yes we did this all but the bot is working fine with text messages but not with the buttons. how did you made buttons work in slack. i read another issue on forum where PR was raised in sdk Slack buttons fail silently - #7 by akelad but no update in it since then.
post by rajas.black on Apr 23, 2020
rajas.blackRajesh Kumar Enthusiast
I am not sure if I have understood your question as you intend to, but i can give a throw at it. Make sure the buttons (payload) are tagged with the relevant (text) choice the user makes.
post by cck197 on Apr 23, 2020
athenasaurav](https://forum.rasa.com/t/slack-integration-error-with-interactive-components/27047/50 "Load parent post")
Are we running into the same problem?
There’s something different about the interaction payload:
The payload will be sent to your specified request URL in an HTTP POST. The body of that request will contain a
payloadparameter. Your app should parse thispayloadparameter as JSON.
https://api.slack.com/messaging/interactivity#components
Pretty sure @JiteshGaikwad has the answer!
post by JiteshGaikwad on Apr 23, 2020
JiteshGaikwad Rasa Certified Developer
hey @cck197, check this issue in this I have mentioned the workaround that I did to overcome this issue:
I am not pretty sure whether this is a reliable solution
post by cck197 on Apr 23, 2020
LOL I’d just bodged in the exact same hack:
cck197@ubuntu:~/rasa/rasa$ diff --color /home/cck197/rasa/venv2/lib/python3.6/site-packages/rasa/core/channels/slack.py ./rasa/core/channels/slack.py
356,357c356
< #metadata = self.get_metadata(request)
< metadata = {"out_channel": payload["channel"]["id"], "users": payload["user"]["id"]}
---
> metadata = self.get_metadata(request)
post by JiteshGaikwad on Apr 23, 2020
JiteshGaikwad Rasa Certified Developer
@cck197 great , glad that it helps…
post by cck197 on Apr 23, 2020
Yes, thank you! I never would have got this far without your video, and I appreciate your hard work filing the bug report.
post by JiteshGaikwad on Apr 23, 2020
JiteshGaikwad Rasa Certified Developer
Thanks for following the video
post by cck197 on Apr 23, 2020
The more I think about this, the more I think I’m doing it wrong. Otherwise, wouldn’t more people be running into the same problem? I developed a minimum viable bot first using Rasa X. Now I’m trying to connect it to some channels. If I ever do SMS or voice, will I be able to use buttons? I don’t think so.
Perhaps I need a better way to prompt the user for input?
post by JiteshGaikwad on Apr 23, 2020
JiteshGaikwad Rasa Certified Developer
I don’t think so buttons will be available for Voice and for sms you can show buttons as menu form just like ordered list.
post by cck197 on Apr 23, 2020
I just got going on Whatsapp via Twilio. The buttons are rendered as a numbered list and as far as I can tell, the only way to respond is to type the payload or something that hits the appropriate intent.
\ 25%20AM1214×182 59.5 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/3/3cb5c94236ef216510cb5511a9050a3dde2ecc17.png "25%20AM")
post by JiteshGaikwad on Apr 23, 2020
JiteshGaikwad Rasa Certified Developer
Hey @cck197 if this is something you are stuck at please raise another topic as this topic is related to slack integration
post by cck197 on Apr 23, 2020
It might be relevant here if we end up spending a lot of time making it work on Slack when it can’t work elsewhere. Or can it work elsewhere? Is there any evidence of buttons working via SMS or WhatsApp?
post by akelad on Apr 24, 2020
akeladAkela Drissner Leader
@cck197 buttons won’t work with SMS or Whatsapp (though I think Whatsapp are working on developing something along the lines of buttons). On Slack, however, they should work, but I think we’ve discovered a bug with it due to an update of one of the packages we use - @stephens maybe you can chime in here
post by cck197 on Apr 24, 2020
Thanks for your response! I appreciate it. I think Rasa is an incredible product and I’m excited about what I might be able to build using it. What you just said is exactly the type of thing I’d like to see more of in the docs!
Rather than:
Responses defined in a domain’s yaml file can contain images and buttons as well
Be more opinionated and say something like: “Responses defined in a domain’s yaml file can contain images and buttons as well but understand that in using them, you’re making a design decision. In essence, Rasa is about natural language processing, and UI elements like buttons may not render on all channels, e.g. SMS and voice.”
#noui
http://www.nointerface.com/book/
post by stephens on Apr 27, 2020
stephensGreg Stephens Advanced Rasa Certified Developer
I’m looking at a couple of things in the slack connector and will get back regarding the buttons. I also ran into an issue with that.
13 days later
post by alebeta90 on May 11, 2020
Hi @stephens
Thanks for having a look at the issue.
Did you found something relevant to this problem? we are having the same problem
cheers
post by stephens on May 11, 2020
stephensGreg Stephens Advanced Rasa Certified Developer
No, I’m just back from vacation and don’t have any updates.
post by alebeta90 on May 18, 2020
Hi @stephens
there is any update regarding this topic?
thanks
Reply
Related topics
Topic list, column headers with buttons are sortable.
We collect and process your personal information for the following purposes: Visitor Statistics, Browsing Behavior. Learn more...
OKDecline