I’m facing this error while running a action in action.py
ERROR rasa.core.actions.action - Failed to run custom action ‘action_pincode’. Couldn’t connect to the server at ‘http://localhost:5055/webhook’. Is the server running? Error: Cannot connect to host localhost:5055 ssl:default [Connection refused]
ERROR rasa.core.processor - Encountered an exception while running action ‘action_pincode’. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
def name(self) -> Text:
async def run(self,
domain: 'Domain') -> List[Event]:
path = '/pincode.txt'
pincode_file = open(path,'r')
pincodes = pincode_file.read()
pin = next(tracker.get_latest_entity_values("pincode"), None)
for i in pincodes:
await dispatcher.utter_message("yes", tracker, silent_fail=True)
await dispatcher.utter_message("no", tracker, silent_fail=True)
Did you start the action server ?
If yes, how are you running the Rasa server and action server, by command line or by Docker ?
If possible, post your action_server config in your endpoints.yml.
I’m running the server by command line
if i use "rasa shell " command it will direct me to localhost
Yes, but did you start the action server by running the command:
rasa run actions
Yes, I have already run this command and got this result
All right, as you can see when you start the action server there is an error, therefore your Rasa server can not connect to the action server to execute your custom actions. I check the constants.py in Rasa github and don’t see any constant named DOCS_BASE_URL, are you sure this is the right constant that you want to import ? This is the link to the constants.py on github: rasa/constants.py at master · RasaHQ/rasa · GitHub
@fuith I also checked my constants.py file but didn’t see any any consatnt named DOCS_BASE_URL and I don’t know what is the use of this file.
It said in the log that in you are importing DOCS_BASE_URL in your actions.py at line 11, is this not your intention ? Can you post your actions.py here ?
@fuith Actually I copied this file from somewhere to implement " action_default_fallback " but I think there are some unwanted things that were used in this file.
actions.py (19.1 KB)
This seems to me like an outdated source code actions.py of Rasa. You should only define your own custom actions in your actions.py. I suggest you remove all the copied code and keep only your custom actions. The “action_default_fallback” is already implemented, if you want to customize it, just override it with your own logic.