First login on fresh install won't work

Hello !

I’m trying to setup a simple Rasa-X CE Docker container for evaluation (I’m a beginner with Docker). Here’s my Dockerfile :

FROM python:3.6

RUN pip install rasa-x --extra-index-url Simple Index

RUN mkdir -p /app/rasa/projects/

WORKDIR /app/rasa/projects/

RUN rasa init --no-prompt && ls -l

EXPOSE 5002

CMD rasa x --no-prompt

After this, I can reach the Rasa-X login screen on localhost:5002 however I can’t find a way to create a user and got a ‘Please fill all the fields’ error message. What am I missing ? Is there any default user ? I can’t find any related information about this on Introduction to Rasa X/Enterprise

Thanks

I’ve added extra steps to create a user but it won’t work either :

Step 6/9 : RUN wget -qO rasa_x_commands.py https://storage.googleapis.com/rasa-x-releases/stable/rasa_x_commands.py

—> Using cache

—> 1f7f17f119de

Step 7/9 : RUN python rasa_x_commands.py create admin me password

—> Running in 27716667fd60

/bin/sh: 1: docker-compose: not found

ERROR:main:Failed to create user.

The command ‘/bin/sh -c python rasa_x_commands.py create admin me password’ returned a non-zero code: 127

Why would this need ‘docker-compose’ to create a user ? I don’t understand

Update: I found a workaround by running the container in interactive mode with a bash and start rasa x. The link was then displayed in the logs :slight_smile:

$local machine> winpty docker run -p 5002:5002 -it rasa-local bash

$container /bin/bash> rasa x

The server is running at http://localhost:5002/login?username=me&password=xxxxxx

It would be nice if this log could be displayed with the “–no-prompt” option when launching rasa x

What did the docker logs look like when you weren’t in interactive mode?

Hi,

in the meantime i face the same issue. i also have a custom dockerfile and rasa x with no-prompt and production including a tracker_store postgres db. The docker-compose runs, it starts rasa x but there is no mention of a username, also if i use the workaround, it works in the container and the user is not persisted in the database, i provide the login_DB in the endpoints.yml

How do i get the username/password created first time and persist it on my database(tracker_store)

Hi,

normally the password for admin area should persist with no problem. Check that your database has a persistent volume at docker. You always need to use the python script to create the user. Maybe you could automate it with the docker-compose to create your desired password passing a env variable.

note that if you are using rasa x community edition, you just need to set the password, but no user.

Hi,

I use community. The problem is when i use the rasa x without --production, it creates sqllite database. so i added --production for it to use postgres but in that case i have weird errors

2019-09-28 09:47:25 +0000] [16] [ERROR] Exception occurred while handling uri: unknown
rasa_x_prod_en_1  | NoneType: None

I am building my custom dockerfile

FROM python:3.7

SHELL ["/bin/bash", "-c"]

RUN apt-get update -qq && \
  apt-get install -y --no-install-recommends \
  build-essential && \
  apt-get clean && \
  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
  mkdir /app

WORKDIR /app

COPY requirements.txt .

RUN pip install -r ./requirements.txt --no-cache-dir

RUN pip install rasa-x --extra-index-url https://pypi.rasa.com/simple

COPY . .

RUN make install-language-en

CMD rasa x --enable-api -endpoints config/rasa-x-endpoints.yml

When i use the rasa/rasa-x dockerfile, i always have permission error to install my extra dependencies like psycopg, google cloud etc needed for running other stuff because the dockerfile created is using non-root user.

Every option i take brings me to some other problem

Thanks

I’d also like to run Rasa X locally on my system using docker and docker-compose but I find like @souvikg10 that every option I try leads me to another problem.

Is it possible to run the sqlite Rasa X under a docker-compose configuration on my local system?

for me on my system, rasa X works fine using python venv. i have been trying to with docker-compose

if i run rasa x in local mode, docker-compose doesn’t work since prompts are not supported. in Production, i have no error but nothing starts, unless i use do the deploy steps from the docs which is too heavy for my use-case, starting up rasa workers etc, rabbit MQ and SQL tracker store.

If I use the official docker, i am not able to use spaCy which i prefer to tensorflow. @amn41

If I use docker run to init the project and then start Rasa X, it’s working locally for me.

docker run -p 5002:5002 -it -v $(pwd):/app rasa/rasa-x:stable rasa init --no-prompt
docker run -p 5002:5002 -it -v $(pwd):/app rasa/rasa-x:stable rasa x --no-prompt

It never generates the credentials for me when i use my local docker-compose

Can you share your docker-compose.yml?

rasa_x_prod_en:
    image: rasa_x_en
    ports:
      - 5005:5005
      - 5002:5002
    volumes:
      - ./models:/app/models
      - ./config:/app/config
    command: rasa x --enable-api --endpoints config/rasa-x-endpoints.yml --no-prompt
  action_server:
    image: action_server
    volumes:
      - ./actions:/app/actions
  duckling:
    image: rasa/duckling:latest
    ports:
      - "8002:8002"
    command: stack exec duckling-example-exe -- --port 8002
  db:
    image: postgres:latest
    volumes:
      # using docker toolbox, a named volume should already be created before using
      # docker volume create --name postgresql-windows -d local
      # see root readme for more details
      - ./data/db:/var/lib/postgresql/data
    ports:
      - "5454:5432" # Avoid collision with default host postgreSQL port.
  reverseproxy:
    image: reverseproxy
    build:
      context: nginx/.
    ports:
      - 8080:8080
      - 8081:8081
    volumes:
      # using docker toolbox, a named volume should already be created before using
      # docker volume create --name postgresql-windows -d local
      # see root readme for more details
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
    restart: always
  nginx:
    depends_on:
      - reverseproxy
    image: nginx:alpine
    restart: always

I also don’t get the The server is running at http://localhost:5002/login?username=me&password=3GPdaeauhj9W message when run from docker.

managed to use the Deploy to a Server

to run the server along with my custom action but i still don’t know whether and how i can install spaCy

or is it already installed? for pipeline en, how do i add another language for spaCy?

@tmbo

Good to know that you got it working on a Mac with the server setup. Last time I tried this several weeks ago it didn’t work for me.

To install spaCy, couldn’t you build your own version of the rasa/rasa container using it’s Dockerfile and a modified requirements.txt?

okay, i was trying to install it in rasa/rasa-x container but if i do so in the rasa/rasa container , which image is used to train the model? i know the training process is done using rasa worker container

Yes, both the production and worker containers should be identical so you would use the same modified rasa/rasa image.

1 Like