Endpoints.yml with env var

hey guys, i want to know how i could use envs var in my endpoints.yml, I’ve tried thoes examples bellow and all them show the same error:

endpoints.yml

Exemple 1:

action_endpoint:
  url: "http://{{ lookup('env','RASA_ACTIONS_ENDPOINTS') }}:5055/webhook"

Erro 1:

 Failed to run custom action 'action_check_pessoa'. Couldn't connect to the server at 'http://{{ lookup('env','RASA_ACTIONS_ENDPOINTS') }}:5055/webhook'. Is the server running? Error: HTTPConnectionPool(host="%7b%7b%20lookup('env','rasa_actions_endpoints')%20%7d%7d", port=5055): Max retries exceeded with url: /webhook (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f67d4f038d0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2018-11-27 16:44:21 ERROR    rasa_core.processor  - Encountered an exception while running action 'action_check_pessoa'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2018-11-27 16:44:21 ERROR    rasa_core.processor  - Failed to execute custom action.

Exemple 2:

action_endpoint:
  url: http://{{RASA_ACTIONS_ENDPOINTS}}:5055/webhook

Error 2:

2018-11-27 16:42:27 ERROR    rasa_core.actions.action  - Failed to run custom action 'action_check_pessoa'. Couldn't connect to the server at 'http://{{RASA_ACTIONS_ENDPOINTS}}:5055/webhook'. Is the server running? Error: HTTPConnectionPool(host='%7b%7brasa_actions_endpoints%7d%7d', port=5055): Max retries exceeded with url: /webhook (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa391341780>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2018-11-27 16:42:27 ERROR    rasa_core.processor  - Encountered an exception while running action 'action_check_pessoa'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2018-11-27 16:42:27 ERROR    rasa_core.processor  - Failed to execute custom action.

Exemple 3:

action_endpoint:
  url: ["http://",{{RASA_ACTIONS_ENDPOINTS}},":5055/webhook"]

Error 3:

2018-11-27 16:32:57 ERROR    rasa_core.actions.action  - Failed to run custom action 'action_check_pessoa'. Couldn't connect to the server at 'http://${RASA_ACTIONS_ENDPOINTS}:5055/webhook'. Is the server running? Error: HTTPConnectionPool(host='$%7brasa_actions_endpoints%7d', port=5055): Max retries exceeded with url: /webhook (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2901584cc0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2018-11-27 16:32:57 ERROR    rasa_core.processor  - Encountered an exception while running action 'action_check_pessoa'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2018-11-27 16:32:57 ERROR    rasa_core.processor  - Failed to execute custom action.

Exemple 4:

action_endpoint:
  url: http://${RASA_ACTIONS_ENDPOINTS}:5055/webhook

Error 4:

2018-11-27 16:32:57 ERROR    rasa_core.actions.action  - Failed to run custom action 'action_check_pessoa'. Couldn't connect to the server at 'http://${RASA_ACTIONS_ENDPOINTS}:5055/webhook'. Is the server running? Error: HTTPConnectionPool(host='$%7brasa_actions_endpoints%7d', port=5055): Max retries exceeded with url: /webhook (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2901584cc0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2018-11-27 16:32:57 ERROR    rasa_core.processor  - Encountered an exception while running action 'action_check_pessoa'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2018-11-27 16:32:57 ERROR    rasa_core.processor  - Failed to execute custom action.

Hi, which Rasa Core version did you use and how did you set the environment variable?

Example 4 should normally work.

Rasa 0.11.12

Then it cannot work. This feature was added in version 0.12, see rasa_core/CHANGELOG.rst at master · RasaHQ/rasa_core · GitHub .

I’m getting the same error in the latest rasa image “rasa/rasa:latest-full”

My endpoints.yml file contains:

action_endpoint:
  url: "http://${ACTION_SERVER}:${ACTION_PORT}/webhook"

My docker-compose defines the 2 environment variables:

  rasa:
    image: rasa/rasa:latest-full
    ports:
      - '5005:5005'
    environment:
      - ACTION_SERVER=action-server
      - ACTION_PORT=5055
    volumes:
      - ./rasa-bot/:/app
    command: ["run", "--enable-api"]

But when I ask the chatbot to do something requiring the action server, I get this error:

2019-11-13 06:13:22 ERROR rasa.core.actions.action - Failed to run custom action ‘action_create_doc’. Action server responded with a non 200 status code of None. Make sure your action server properly runs actions and returns a 200 once the action is executed. Error: http://${ACTION_SERVER}:${ACTION_PORT}/webhook

`

Shouldn’t this config in endpoints replace ${ACTION_SERVER} with the value in the environment variable ACTION_SERVER ?

When I put the below into my endpoints.yml, it works fine…

action_endpoint:
  url: "http://action-server:5055/webhook"

Thank you, Jason