# FormAction on Server with Rasa X does not work

**URL:** <https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [September 29, 2020, 9:26am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235 "2020-09-29T09:26:29Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias/32/5772_2.png) [@Tobias](https://forum.rasa.com/u/Tobias)\
**Post date:** [September 29, 2020, 9:26am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/1 "2020-09-29T09:26:29Z")

</div>

Hi everyone,

could you please help me. I have just uploaded my chatbot to an server. It is currently running with docker and I have the following software packages installed:

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/c/cc0585b53f6ea8c185d6f5007ee3943f97460d95.png)

Everything works right except for one thing. If I want to run the FormAction the chatbot does not run it correctly:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/b/b6bc7ffb010dbf604830eaf497b98c9883af17dc.png)

Here is my actions.py:

```auto
from typing import Dict, Text, Any, List, Union
from rasa_sdk import Tracker, Action 
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction

class SubscribeNewsletterForm(FormAction):
   
    def name(self) -> Text:
        return "abonnieren_newsletter_form"

    @staticmethod
    def required_slots(tracker: Tracker) -> List[Text]:
        return ["email"] 
    
    def submit(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict]:
                       
        
        dispatcher.utter_message("Vielen Dank. Wir senden absofort hilfreiche Informationen an Ihre E-mail Adresse.")
            
        return []
```

---

<div class="post-metadata">

**Author:** ![UlisesVD](https://avatars.discourse-cdn.com/v4/letter/u/8e7dd6/32.png) [@UlisesVD](https://forum.rasa.com/u/UlisesVD)\
**Post date:** [September 29, 2020, 10:50pm UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/2 "2020-09-29T22:50:44Z")

</div>

how do you run your bot??? I never had don’t that but it seems that the command **rasa run actions** is never execute. maybe you need to put that line in you docker file?

---

<div class="post-metadata">

**Author:** ![Tobias](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias/32/5772_2.png) [@Tobias](https://forum.rasa.com/u/Tobias)\
**Post date:** [September 30, 2020, 8:03am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/3 "2020-09-30T08:03:51Z")

</div>

Thank you for your reply. In my actions.py I have already tested an Action. This one runs well without any problems. I don´t think that I have to run this command in docker separately?

Does anyone have a solution for my problem?

Thanks!

---

<div class="post-metadata">

**Author:** ![ricwo](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ricwo](https://forum.rasa.com/u/ricwo)\
**Post date:** [October 1, 2020, 6:09am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/4 "2020-10-01T06:09:37Z")

</div>

Hi @Tobias, what does your training data look like? Can you share the part of `stories.yml` that is relevant to this form?

---

<div class="post-metadata">

**Author:** ![Tobias](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias/32/5772_2.png) [@Tobias](https://forum.rasa.com/u/Tobias)\
**Post date:** [October 1, 2020, 8:09am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/5 "2020-10-01T08:09:14Z")

</div>

Hi @ricwo, here is my stories.md:

```auto
## begruessen_bestellung
* begruessen
	- utter_begruessen
	- utter_faehigkeiten

## newsletter
* newsletter_abonnieren
    - abonnieren_newsletter_form
    - form{"name":"abonnieren_newsletter_form"}
	- form{"name": null}
    - utter_anders_weiterhelfen

## verabschiedung
* verabschieden
    - utter_verabschieden

## fallback story
* out_of_scope
  - action_default_fallback

```

Domain.yml:

```auto
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

intents:
- begruessen
- verabschieden
- out_of_scope
- newsletter_abonnieren

entities:
- email

slots:
  email:
    type: unfeaturized
  requested_slot:
    type: unfeaturized
    auto_fill: false

responses:
  utter_begruessen:
  - text: Hi!
  utter_faehigkeiten:
  - buttons:
    - payload: Newsletter abonnieren
      title: Newsletter abonnieren
    text: Ich bin Chati, ein digitaler Assistent! Gerne kann ich Ihnen bei folgenden
      Themen weiterhelfen.
  utter_ask_email:
  - text: Geben Sie Ihre E-mail Adresse an, um weitere Informationen zu erhalten!
  utter_anders_weiterhelfen:
  - text: Kann ich Ihnen noch anderweitig helfen?
  utter_default:
  - buttons:
    - payload: Newsletter abonnieren
      title: Newsletter abonnieren
    text: Leider hab ich nicht immer eine passende Antwort. Gerne kann ich Ihnen bei
      folgenden Themen weiterhelfen
  utter_verabschieden:
  - text: Vielen Dank für Ihr Vertrauen. Bis dann!

actions:
- utter_begruessen
- utter_faehigkeiten
- utter_anders_weiterhelfen
- utter_default
- utter_verabschieden
- utter_ask_email

forms:
- abonnieren_newsletter_form

```

config.yml:

```auto
language: de
pipeline:
  - name: WhitespaceTokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: "char_wb"
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 50
  - name: EntitySynonymMapper

policies:
  - name: MemoizationPolicy
    max_history: 5
  - name: TEDPolicy
    max_history: 5
    epochs: 100
  - name: MappingPolicy
  - name: FormPolicy
  - name: FallbackPolicy
    nlu_threshold: 0.4
    core_threshold: 0.5
    fallback_action_name: "action_default_fallback"
```

---

<div class="post-metadata">

**Author:** ![ricwo](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ricwo](https://forum.rasa.com/u/ricwo)\
**Post date:** [October 2, 2020, 6:16am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/6 "2020-10-02T06:16:07Z")

</div>

Would you mind sharing the output logs of `rasa-sdk` and `rasa-production`? Also, is the message you sent (“Newsletter abonnieren”) the first one in the conversation?

---

<div class="post-metadata">

**Author:** ![Tobias](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias/32/5772_2.png) [@Tobias](https://forum.rasa.com/u/Tobias)\
**Post date:** [October 2, 2020, 10:29am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/7 "2020-10-02T10:29:23Z")

</div>

How can I share the output logs of rasa-sdk and rasa-production? What is the command for that?`

No, I started the conversation with “Hi” as user.

---

<div class="post-metadata">

**Author:** ![basil-chatha](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/basil-chatha/32/9260_2.png) [@basil-chatha](https://forum.rasa.com/u/basil-chatha)\
**Post date:** [October 4, 2020, 1:15am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/8 "2020-10-04T01:15:14Z")

</div>

@ricwo @akelad @stephens @mloubser @erohmensing  
There seems to be an issue with a new event (active\_loop) that rasa forms don’t recognize. I am having the same issue, it used to work but it doesn’t now. I am using rasa version `1.10.10` and rasa x version `0.32.2`:

```auto
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.nlu.selectors.response_selector - Adding following selector key to message property: default
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.processor - Received user message 'need a house' with intent '{'name': 'inform', 'confidence': 0.9481670260429382}' and entities '[]'
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 7 events.
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.policies.memoization - Current tracker state [{'intent_inform': 1.0, 'prev_action_listen': 1.0}]
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.policies.memoization - There is a memorised next action 'my_form'
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.policies.form_policy - There is no active form
rasa-production_1 | 2020-10-04 01:05:37 INFO root - return all zero probabilities, nothing to do 
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_MemoizationPolicy
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.processor - Predicted next action 'my_form' with confidence 1.00.
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'my_form'.
rasa-production_1 | 2020-10-04 01:05:37 ERROR rasa.core.processor - Encountered an exception while running action 'my_form'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.processor - Unknown event name 'active_loop'.
rasa-production_1 | Traceback (most recent call last):
rasa-production_1 | File "/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py", line 650, in _run_action
rasa-production_1 | events = await action.run(output_channel, nlg, tracker, self.domain)
rasa-production_1 | File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 562, in run
rasa-production_1 | evts = events.deserialise_events(events_json)
rasa-production_1 | File "/opt/venv/lib/python3.7/site-packages/rasa/core/events/ __init__.py", line 39, in deserialise_events
rasa-production_1 | event = Event.from_parameters(e)
rasa-production_1 | File "/opt/venv/lib/python3.7/site-packages/rasa/core/events/ __init__.py", line 142, in from_parameters
rasa-production_1 | event_class: Optional[Type[Event]] = Event.resolve_by_type(event_name, default)
rasa-production_1 | File "/opt/venv/lib/python3.7/site-packages/rasa/core/events/ __init__.py", line 195, in resolve_by_type
rasa-production_1 | raise ValueError(f"Unknown event name '{type_name}'.")
rasa-production_1 | ValueError: Unknown event name 'active_loop'.
rasa-production_1 | 2020-10-04 01:05:37 DEBUG rasa.core.processor - Action 'find_property_form' ended with events '[]'.

```

---

<div class="post-metadata">

**Author:** ![Tobias](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias/32/5772_2.png) [@Tobias](https://forum.rasa.com/u/Tobias)\
**Post date:** [October 12, 2020, 7:30am UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/9 "2020-10-12T07:30:22Z")

</div>

Hi @ricwo,

do you have any recommandations so far?

---

<div class="post-metadata">

**Author:** ![ricwo](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ricwo](https://forum.rasa.com/u/ricwo)\
**Post date:** [October 14, 2020, 2:43pm UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/10 "2020-10-14T14:43:26Z")

</div>

@Tobias it would still be great to see your logs for `rasa-production` and `rasa-sdk`. To get those, please run `sudo docker ps -a` and then run `sudo docker logs <X>`, substituting the names of the two containers for `<X>`

---

<div class="post-metadata">

**Author:** ![ricwo](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ricwo](https://forum.rasa.com/u/ricwo)\
**Post date:** [October 14, 2020, 2:48pm UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/11 "2020-10-14T14:48:06Z")

</div>

@basil-chatha The `active_loop` event was introduced in Rasa 2.0. Please check out the docs on [Forms](https://rasa.com/docs/rasa/forms#activating-a-form)

---

<div class="post-metadata">

**Author:** ![Tobias](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias/32/5772_2.png) [@Tobias](https://forum.rasa.com/u/Tobias)\
**Post date:** [October 19, 2020, 12:13pm UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/12 "2020-10-19T12:13:16Z")

</div>

Here are the logs for production:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/5/56245aebae2378be11c209ab91f34bca2f703132.png)

Here for rasa-sdk:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/b/be1fbce5c2cc550e9bb21bd579aa90bc51e7f13c.png)

---

<div class="post-metadata">

**Author:** ![geniuslead](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/geniuslead/32/12091_2.png) [@geniuslead](https://forum.rasa.com/u/geniuslead)\
**Post date:** [December 19, 2020, 3:53pm UTC](https://forum.rasa.com/t/formaction-on-server-with-rasa-x-does-not-work/35235/13 "2020-12-19T15:53:23Z")

</div>

I had the same issue where form action wasn’t found I followed [(Ep #9 - Rasa Masterclass) Improving the assistant: Setting up the Rasa X | Rasa 1.8.0 - YouTube](https://www.youtube.com/watch?v=IUYdwy8HPVc&feature=youtu.be&ab_channel=Rasa).

Didn’t follow any other steps of creating action server separately

* * *

Finally - all started working

Get Action server Image container Id by running

Run : sudo docker ps

The container Id 603339fd04e0 is mapped to Image: rasa/rasa-sdk:latest  
COMMAND : "./entrypoint.sh Ports : 5055/tcp

Run: docker container restart 603339fd04e0

This is the action server, I restarted then Rasa X was able to find the actions registered, and is responding.
