# Buggy code
async def _ask_for_slot(
    self,
    domain: Domain,
    nlg: NaturalLanguageGenerator,
    output_channel: OutputChannel,
    slot_name: Text,
    tracker: DialogueStateTracker,
) -> List[Event]:
    logger.debug(f"Request next slot '{slot_name}'")

    action_to_ask_for_next_slot = action.action_from_name(
        self._name_of_utterance(domain, slot_name), None, domain.user_actions
    )
    events_to_ask_for_next_slot = await action_to_ask_for_next_slot.run(
        output_channel, nlg, tracker, domain
    )
    return events_to_ask_for_next_slot


# Traceback (Exception)
2020-08-26 16:45:44 DEBUG    rasa.core.actions.forms  - Request next slot 'cuisine'
2020-08-26 16:45:44 ERROR    rasa.core.actions.action  - The model predicted the custom action 'action_ask_cuisine', but you didn't configure an endpoint to run this custom action. Please take a look at the docs and set an endpoint configuration via the --endpoints flag. https://rasa.com/docs/rasa/core/actions
2020-08-26 16:45:44 ERROR    rasa.core.processor  - Encountered an exception while running action 'restaurant_form'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
2020-08-26 16:45:44 DEBUG    rasa.core.processor  - Failed to execute custom action.
Traceback (most recent call last):
File "/home/kdery/.local/lib/python3.6/site-packages/rasa/core/processor.py", line 644, in _run_action
events = await action.run(output_channel, nlg, tracker, self.domain)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
return self.gen.send(None)
File "/home/kdery/.local/lib/python3.6/site-packages/rasa/core/actions/loops.py", line 29, in run
events += await self.do(output_channel, nlg, tracker, domain, events)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
return self.gen.send(None)
File "/home/kdery/.local/lib/python3.6/site-packages/rasa/core/actions/forms.py", line 586, in do
tracker, domain, output_channel, nlg, events_so_far + events
File "/usr/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
return self.gen.send(None)
File "/home/kdery/.local/lib/python3.6/site-packages/rasa/core/actions/forms.py", line 424, in request_next_slot
domain, nlg, output_channel, slot_to_request, temp_tracker
File "/usr/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
return self.gen.send(None)
File "/home/kdery/.local/lib/python3.6/site-packages/rasa/core/actions/forms.py", line 472, in _ask_for_slot
output_channel, nlg, tracker, domain
File "/usr/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
return self.gen.send(None)
File "/home/kdery/.local/lib/python3.6/site-packages/rasa/core/actions/action.py", line 557, in run
raise Exception("Failed to execute custom action.")
Exception: Failed to execute custom action.
2020-08-26 16:45:44 DEBUG    rasa.core.processor  - Action 'restaurant_form' ended with events '[]'.

# Fixed code
async def _ask_for_slot(
    self,
    domain: Domain,
    nlg: NaturalLanguageGenerator,
    output_channel: OutputChannel,
    slot_name: Text,
    tracker: DialogueStateTracker,
) -> List[Event]:
    logger.debug(f"Request next slot '{slot_name}'")

    action_to_ask_for_next_slot = action.action_from_name(
        self._name_of_utterance(domain, slot_name),
        self.action_endpoint,
        domain.user_actions,
    )
    events_to_ask_for_next_slot = await action_to_ask_for_next_slot.run(
        output_channel, nlg, tracker, domain
    )
    return events_to_ask_for_next_slot