No registered action found for name \'action_session_start\'

I want to custom action_session_start. So I create actions.py

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher



class ActionSessionStart(Action):

    def name(self) -> Text:
        return "action_session_start"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        dispatcher.utter_message(text="hi can you repay now?")

        return []

and added in domain.yml

actions:
- action_session_start

but I run rasa shell. and type /restart

Your input ->  /restart                                                                                                                                                           
2021-02-04 18:26:06 ERROR    rasa.core.processor  - Encountered an exception while running action 'action_session_start'.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 "/Users/pjk/.pyenv/versions/3.7.4/lib/python3.7/site-packages/rasa/core/actions/action.py", line 671, in run
    json=json_body, method="post", timeout=DEFAULT_REQUEST_TIMEOUT
  File "/Users/pjk/.pyenv/versions/3.7.4/lib/python3.7/site-packages/rasa/utils/endpoints.py", line 155, in request
    response.status, response.reason, await response.content.read()
rasa.utils.endpoints.ClientResponseError: 404, Not Found, body='b'{"error":"No registered action found for name \'action_session_start\'.","action_name":"action_session_start"}''

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

Traceback (most recent call last):
  File "/Users/pjk/.pyenv/versions/3.7.4/lib/python3.7/site-packages/rasa/core/processor.py", line 751, in _run_action
    output_channel, nlg, temporary_tracker, self.domain
  File "/Users/pjk/.pyenv/versions/3.7.4/lib/python3.7/site-packages/rasa/core/actions/action.py", line 694, in run
    raise RasaException("Failed to execute custom action.") from e
rasa.shared.exceptions.RasaException: Failed to execute custom action.

can you help me?

Because the action_session_start is a default action in Rasa, you need to follow certain rules while overriding it. For instance:

  1. The session should begin with a session_started event
  2. Any slots that should be carried over should come after the session_started event
  3. An action_listen should be added at the end

You can refer to the docs here to get a blueprint so that you can customise the action_session_start