How to debug issue of action server and rasa-x in docker

Hi,

I am running rasa-x on docker and running thru docker compose. In action.py i am calling an api to fetch data. Earlier it was working fine but now no response in rasa-x interactive learning

i checked logs of action server and no issues are there. In rasa-x, 3 dots keep blinking with no response.

How to debug the issue in docker? How to implement exception handling in actions.py? How to handle such issues

Hi @poojavi :wave: Does Rasa X respond to any messages? Or is the error occurring only when you send messages that hit the action server?

in action server, white I say these lines, it print all - app_id as well as hello.

     app_id = tracker.get_slot('e_car_app_id')
     dispatcher.utter_message(app_id)
     where = Car_app_id(app_id).json()
     dispatcher.utter_message('hello')

But when i added one more line to print where, it does not print at all, not even app_id and hello which it printed above.

     app_id = tracker.get_slot('e_car_app_id')
     dispatcher.utter_message(app_id)
     where = Car_app_id(app_id).json()
     dispatcher.utter_message('hello')
     dispatcher.utter_message(where)

while checking log of rasa production docker container, it says - “ERROR rasa.server - An unexpected error occurred. Error: ‘dict’ object has no attribute ‘strip’”

while checking log of rasa production docker container, it says - “ERROR rasa.server - An unexpected error occurred. Error: ‘dict’ object has no attribute ‘strip’”

Sorry, just saw that line in your last post. Is your where variable a dictionary?

where is the json form of what api returned

def Car_app_id(app_id): api_address = ‘http://some URL of API’ api_param = ‘assetID?assetID=’ url = api_address + api_param + app_id data = requests.get(url) return data

where = Car_app_id(app_id).json()

Do you know the content of where? Since you’re passing the raw json response to utter_message there could be something in that where object that is causing the issue.

New update…

instead of - dispatcher.utter_message(where) i gave - dispatcher.utter_template(“utter_temp”,tracker, where = where) where utter_temp is your details are here : {where} and it worked.

If it work in 2nd way (utter_template), it should also work with utter_message.

Oh, looks like you might be missing the template declaration.

Does dispatcher.utter_message(template="utter_temp", where=where) work?

No, it did not work declaring template in utter_message. :frowning:

Can you provide an example of what your where variable contains? And what the full definition of your response template looks like?

I can recreate the error message under and assumption that where is a dictionary. Changing utter_message to dispatcher.utter_message(template="utter_temp", where=where) resolves the error and responds with the correct text.