Remote Custom Action Server never responds

I have been trying to deploy my rasa bot to a Google Cloud, but while I generally don’t have trouble getting the core bot uploaded. And even action server runs locally, I cannot ever get my custom action server to respond when it’s uploaded (I’ve also tried on Heroku as well with the same problem).

Action Server Running Locally

Action Server Running in Cloud Just hangs

My endpoints.yml

# This file contains the different endpoints your bot can use.

# Server where the models are pulled from.
# https://rasa.com/docs/rasa/model-storage#fetching-models-from-a-server

#models:
#  url: http://my-server.com/models/default_core@latest
#  wait_time_between_pulls:  10   # [optional](default: 100)

# Server which runs your custom actions.
# https://rasa.com/docs/rasa/custom-actions

action_endpoint:
  url: "http://localhost:5055/webhook"
  

My Dockerfile

# Extend the official Rasa SDK image
FROM rasa/rasa-sdk:latest

# Use subdirectory as working directory
WORKDIR /app

# Copy any additional custom requirements
COPY actions/requirements-actions.txt ./

COPY weather.py ./
COPY airtable.py ./
# Change back to root user to install dependencies
USER root

# Install extra requirements for actions code, if necessary (otherwise comment this out)
RUN pip install -r requirements-actions.txt

# Copy actions folder to working directory
COPY ./actions /app/actions

# By best practices, don't run the code with root user
USER 1001

CMD $(echo "rasa run actions -p $PORT --debug" | sed 's/=//')


I’ve tried creating a custom action server in nodeJS [from [Lykos94's rasa-node-action-server git](https://github.com/Lykos94/rasa-node-action-server)]


const { RasaNodeActionServer, RasaActionEvent } = require("rasa-node-action-server");

const rnas = new RasaNodeActionServer();

rnas.define("action_hello_world", (action, res) => {
  res
    .addEvent(RasaActionEvent.bot("Hello world, from your action server"))
    .send();
});

rnas.define("action_weather_test", async (action, res) => {
  var weatherdata;
  const { zipcode } = action.getSlots();
  try{
    weatherdata = await axios.get(`https://api.openweathermap.org/data/2.5/weather?q=${zipcode}&units=imperial&appid=${process.env.WEATHER_KEY}`);
    console.log(weatherdata);
  
  } catch (err){  console.error(err);}
  
  res
    .addEvent(RasaActionEvent.bot("Here's the weather for "+zipcode+": "+weatherdata['data']['weather'][0]['description']+ " with a temperature of "+((weatherdata['data']['main']['temp']).toFixed(1)+ "F")))
    .send();
    
    
});

rnas.define("action_test_airtable", (action, res) => {
  res
    .addEvent(RasaActionEvent.bot("Hello world, from your action server"))
    .send();
});

rnas.start();

But whenever I submit a POST to the action server (on port 5055 or 80), I never get a response. I don’t know what I’m doing wrong as I’ve tried using the rasa sdk on both heroku and google cloud, and even developing a custom action server in node and not a single one ever responds. What am I missing?

Hello and welcome to the forum!

Are you using Docker or Helm for deployment?

Docker. But I find it very confusing.

Oh I just noticed!

In your picture here, there is a / before :5055 which should not be there in the POST URL.

If it doesn’t work, maybe try without mentioning the port (I have used Quick/Helm installation, for which you don’t mention the port).

I’ve removed the port and the ‘/’ but that doesn’t resolve the problem. It’s as though the server is listening to the right port now, but it won’t execute the POST

1 Like

Does it work if you try to hit the following endpoint?

POST http://<whatever>/webhooks/rest/webhook

{
    "sender": "Postman",
    "message": "Hello there"
}

@player9 are you using only dockerfile or you using docker-compose as well? can you share all your docker file for rasa and rasa-sdk with endpoints.yml ?