Getting error as below when trying to interact with facebook messenger with rasa

Getting error as below when trying to interact with facebook messenger with rasa. please help me in resolving this issue. I was able to get the utter action response from messenger but when interacting with custom action, was getting below error.

2021-02-03 10:20:15 WARNING rasa.core.channels.facebook - Wrong fb secret! Make sure this matches the secret in your facebook app settings

2021-02-03 10:20:17 ERROR rasa.core.processor - Encountered an exception while running action ‘admission_form’.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 “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\processor.py”, line 751, in _run_action output_channel, nlg, temporary_tracker, self.domain

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\loops.py”, line 29, in run events += await self.do(output_channel, nlg, tracker, domain, events)

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\forms.py”, line 680, in do events = await self._validate_if_required(tracker, domain, output_channel, nlg)

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\forms.py”, line 620, in _validate_if_required return await self.validate(tracker, domain, output_channel, nlg)

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\forms.py”, line 454, in validate slot_values, tracker, domain, output_channel, nlg

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\forms.py”, line 403, in validate_slots validate_events = await _action.run(output_channel, nlg, _tracker, domain)

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\action.py”, line 674, in run self._validate_action_result(response)

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\action.py”, line 612, in _validate_action_result raise e

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\action.py”, line 603, in _validate_action_result validate(result, self.action_response_format_spec())

File “c:\users\ratan\rasaenv\lib\site-packages\jsonschema\validators.py”, line 934, in validate raise error jsonschema.exceptions.ValidationError: None is not of type ‘object’. Failed to validate Action server response from API, make sure your response from the Action endpoint is valid. For more information about the format visit Custom Actions

Failed validating ‘type’ in schema: {‘properties’: {‘events’: {‘items’: {‘properties’: {‘event’: {‘type’: ‘string’}}, ‘type’: ‘object’}, ‘type’: ‘array’}, ‘responses’: {‘items’: {‘type’: ‘object’}, ‘type’: ‘array’}}, ‘type’: ‘object’}

On instance: None

2021-02-03 10:20:18 WARNING rasa.core.channels.facebook - Wrong fb secret! Make sure this matches the secret in your facebook app settings

2021-02-03 10:20:19 ERROR rasa.core.processor - Encountered an exception while running action ‘action_submit_admission_form’.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 “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\processor.py”, line 751, in _run_action output_channel, nlg, temporary_tracker, self.domain

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\action.py”, line 674, in run self._validate_action_result(response)

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\action.py”, line 612, in _validate_action_result raise e

File “c:\users\ratan\rasaenv\lib\site-packages\rasa\core\actions\action.py”, line 603, in _validate_action_result validate(result, self.action_response_format_spec())

File “c:\users\ratan\rasaenv\lib\site-packages\jsonschema\validators.py”, line 934, in validate raise error jsonschema.exceptions.ValidationError: None is not of type ‘object’. Failed to validate Action server response from API, make sure your response from the Action endpoint is valid. For more information about the format visit Custom Actions

Failed validating ‘type’ in schema: {‘properties’: {‘events’: {‘items’: {‘properties’: {‘event’: {‘type’: ‘string’}}, ‘type’: ‘object’}, ‘type’: ‘array’}, ‘responses’: {‘items’: {‘type’: ‘object’}, ‘type’: ‘array’}}, ‘type’: ‘object’}

On instance: None

credentials.yml file has below details

facebook:

verify: “chat_bot”

secret: “a8da297add0e8cc650727c76c22eb591”

page-access-token: “EAAbVjzDnXygBAIZB95wDSfyR2tXngo9iMlpQZB9X4Sj14rW7e7Ic4nAyg7mhc74eog1A4UCZCUn5WpFNZB4q8W0V7afjczVlNF9d4crcS7YxePGBcZBvWZC9yBmRLel7mSqM1tAiPJQke8pAAxU9J13wNQiJ8UnjP7WY0cAKMPjtOLLlIAXctQ”

I am using the same in facebook page and required settings.

endpoint.yml file has below details

action_endpoint:

url: “https://d6ec981f1690.ngrok.io/webhooks/facebook/webhook

action.py file has below details:

class ActionAdmission(Action): def name(self) -> Text: return “action_submit_admission_form”

@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
    print("required_slots(tracker: Tracker)")
    return("name1", "ssn", "subject")

def run(
    self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any],
#) -> List[Text]:
) -> List[EventType]:
    print("inside run")
    response = """All done"""
    #dispatcher.utter_message(text="All done")
    dispatcher.utter_message(response)
    return []
    

class ValidateAdmissionForm(FormValidationAction):

def name(self) -> Text:

    return "validate_admission_form"

def validate_name1(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
     """Validate name1 value."""
     print("im in Validate name1")
     if slot_value.lower() not in [' ']:
         print("im in Validate name1 in side if")
         # validation succeeded, set the value of the "name1" slot to value
         return {"name1": slot_value}
     else:
         # validation failed, set this slot to None so that the
        # user will be asked for the slot again
         print("im in Validate name1 in side else")
         return {"name1": None}

def validate_ssn(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
     """Validate ssn value."""
     print("im in Validate ssn")
     if slot_value.lower() not in [' ']:
        # validation succeeded, set the value of the "ssn" slot to value
        return {"ssn": slot_value}
     else:
        # validation failed, set this slot to None so that the
        # user will be asked for the slot again
        return {"ssn": None}
 
def validate_subject(
    self,
    slot_value: Any,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) -> Dict[Text, Any]:
    """Validate subject value."""
    print("im in Validate subject")
    if slot_value.lower() not in [' ']:
        # validation succeeded, set the value of the "subject" slot to value
        return {"subject": slot_value}
    else:
        # validation failed, set this slot to None so that the
        # user will be asked for the slot again
        return {"subject": None}
    

Kindly let me know if any further information required.