Rasa X docker container fails during start: AttributeError: 'NoneType' object has no attribute 'status'

tobias
(martin.m) #1

I receive the following error when trying to deploy Rasa X container on Kubernetes:

INFO:apscheduler.scheduler:Scheduler started
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/site-packages/rasax/community/server.py", line 57, in <module>
    main()
  File "/usr/local/lib/python3.6/site-packages/rasax/community/server.py", line 31, in main
    model_service.discover_models_on_init()
  File "/usr/local/lib/python3.6/site-packages/rasax/community/services/model_service.py", line 64, in discover_models_on_init
    loop.run_until_complete(self._discover_models())
  File "uvloop/loop.pyx", line 1451, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.6/site-packages/rasax/community/services/model_service.py", line 90, in _discover_models
    minimum_version = await self.minimum_compatible_version()
  File "/usr/local/lib/python3.6/site-packages/rasax/community/services/model_service.py", line 83, in minimum_compatible_version
    info = await stack_service.status()
AttributeError: 'NoneType' object has no attribute 'status'

I am using the rasa/rasa-x:latest image. From the code of the rasax package it looks like the program can not find the respective environment in the db and therefore returns None, though I did not change “project_id” or any parameter (knowingly).

(Tobias Wochinger) #2

Did you define an environments.yml in the rasa service? There was a bug in the docs which we fixed. I think the error was in step 16, could you check the instructions from master

(martin.m) #3

Yes, I already did this (otherwise the Pod would not have started)…

(Greg Stephens) #4

I’m having the same issue. I’ve configured my environments.yml.

I’m not sure which step #16 @Tobias_Wochinger is referring to but I’ve reviewed all of the Rasa X doc pages. The only 16 I see is on the Enterprise > OpenShift and K8S page but I’m trying out the CE version of Rasa X.

(Tobias Wochinger) #5

@stephens Sorry, that I didn’t link the guide. I mean exactly this one OpenShift and K8S (should be quite the same for CE).

Makes no sense to have in the Enterprise section imho.

(martin.m) #6

@stephens Yes it was step 16 on that page. I was also trying to deploy the CE version. Most steps are the same for both versions in this guide. The error in the docs was that the name of the ConfigMap should be configuration-files instead of environment-config. This is now fixed in the docs for version 19.3.

However, what fixed the “NoneType” error for me was to change the environments section of the configuration-files.yaml configMap from “stack” to “rasa”, so that finally it looks like this:

environments: |
    rasa:
        production:
          url: http://rasa-production:5005
          token: ${RASA_TOKEN}
        worker:
          url: http://rasa-worker:5005
          token: ${RASA_TOKEN}

Hope that helps.

(Greg Stephens) #7

Thanks, I was already using rasa:

(J) #8

I was getting this same error as well. For some reason the mount of the configuration files was showing up in Openshift but it didn’t seem like the app was finding it. I ended up deleting the mount and recreating through the openshift UI and explicitly pointing the configuration environments section to /app/environments.yml. Now I can see that file in terminal when I go to apps and also it resolved the “NoneType” error. Also note that for me the port configuration needed to be changed for some of the services to make sure the deployment configs had the ports being exposed, like in step 14 for NGINX. I needed to do that step for the other services as well, not just NGINX, not sure if that documentation needs to be updated or something is different in my environment.

(Greg Stephens) #9

Thanks, @jcoo.

@Tobias_Wochinger how about an improved error message based on @jcoo’s findings - “environments.yml not found”

(Tobias Wochinger) #10

@stephens I did a pr for it which increases the log level for it to warning :slight_smile: