AttributeError: ‘str’ object has no attribute ‘get_attributes_of_object’

Getting attribute error on running action ‘action_query_knowledge_base’ Any ideas? Thanks in advance Ana

rasa actions terminal

2021-06-13 06:20:13 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055

Exception occurred while handling uri: ‘http://localhost:5055/webhook

Traceback (most recent call last):

File “/lib/python3.8/site-packages/sanic/app.py”, line 938, in handle_request

response = await response

File “/lib/python3.8/site-packages/rasa_sdk/endpoint.py”, line 104, in webhook

result = await executor.run(action_call)

File “/lib/python3.8/site-packages/rasa_sdk/executor.py”, line 397, in run

events = await utils.call_potential_coroutine(

File “/lib/python3.8/site-packages/rasa_sdk/utils.py”, line 230, in call_potential_coroutine

return await coroutine_or_return_value

File “/lib/python3.8/site-packages/rasa_sdk/knowledge_base/actions.py”, line 137, in run

return await self._query_objects(dispatcher, object_type, tracker)

File “/lib/python3.8/site-packages/rasa_sdk/knowledge_base/actions.py”, line 161, in _query_objects

self.knowledge_base.get_attributes_of_object(object_type)

AttributeError: ‘str’ object has no attribute ‘get_attributes_of_object’

rasa shell terminal

ERROR rasa.core.processor - Encountered an exception while running action ‘action_query_knowledge_base’.Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.

Traceback (most recent call last):

File “/media/amontalvo/Storage/Rasa/venv3.8_Rasa2.0.x/lib/python3.8/site-packages/rasa/core/actions/action.py”, line 683, in run

response = await self.action_endpoint.request(

File “/media/amontalvo/Storage/Rasa/venv3.8_Rasa2.0.x/lib/python3.8/site-packages/rasa/utils/endpoints.py”, line 154, in request

raise ClientResponseError(

rasa.utils.endpoints.ClientResponseError: 500, Internal Server Error, body=‘b’\xe2\x9a\xa0\xef\xb8\x8f 500 \xe2\x80\x94 Internal Server Error\n\n html { font-family: sans-serif }\n h2 { color: #888; }\n .tb-wrapper p { margin: 0 }\n .frame-border { margin: 1rem }\n .frame-line > * { padding: 0.3rem 0.6rem }\n .frame-line { margin-bottom: 0.3rem }\n .frame-code { font-size: 16px; padding-left: 4ch }\n .tb-wrapper { border: 1px solid #eee }\n .tb-header { background: #eee; padding: 0.3rem; font-weight: bold }\n .frame-descriptor { background: #e2eafb; font-size: 14px }\n \n

\xe2\x9a\xa0\x\xb8\x8f 500 \xe2\x80\x94 Internal Server Error

The server encountered an internal error and cannot complete your request.\n’’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File “/media/amontalvo/Storage/Rasa/venv3.8_Rasa2.0.x/lib/python3.8/site-packages/rasa/core/processor.py”, line 772, in _run_action

events = await action.run(

File “/media/amontalvo/Storage/Rasa/venv3.8_Rasa2.0.x/lib/python3.8/site-packages/rasa/core/actions/action.py”, line 707, in run

raise RasaException(“Failed to execute custom action.”) from e rasa.shared.exceptions.RasaException: Failed to execute custom action.

@anarucu Can you give a screenshot of error?

@anarucu AttributeError: ‘str’ object has no attribute ‘get_attributes_of_object’

This means : something try to find a ‘.get_attributes_of_object’ attribute on the object that had given, and you had given it as an object of type str (i.e., a string).

Hey nik! The chitchat works fine with some rules, it fails when triggers the action_query_knowledge_base! Here is a screenshot of the error in debug mode, it is not detecting the attribute.

thx again!

@anarucu You need to check the action.py the code you wrote, it has some issue. Can I see the action file ? Did you run the action server at the next terminal window? rasa run actions

You were so right!! It was a misspelling in the action.py file. Thanks a lot for your time regards ana

1 Like