Can't connect to duckling (RasaX running on Kubernetes)

Hello…

I have set up RasaX in a cluster environment using Kubernetes. I am however failing to connect to the duckling server. I am getting the error on the rasa production container. :

2020-03-02 03:37:57 ERROR rasa.nlu.extractors.duckling_http_extractor - Failed to connect to duckling http server. Make sure the duckling server is running/healthy/not stale and the proper host and port are set in the configuration. More information on how to run the server can be found on github: GitHub - facebook/duckling: Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings. Error: HTTPConnectionPool(host=‘duckling’, port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7fa13bc3f748>: Failed to establish a new connection: [Errno -2] Name or service not known’,))

This is my config file: language: en pipeline:

  • name: SpacyNLP
  • name: SpacyTokenizer
  • name: SpacyFeaturizer
  • name: RegexFeaturizer
  • name: CRFEntityExtractor
  • name: EntitySynonymMapper
  • name: SklearnIntentClassifier
  • name: DucklingHTTPExtractor url: ‘http://duckling:8000’ dimensions:
    • time
    • number
    • amount-of-money policies:
  • name: MemoizationPolicy
  • name: KerasPolicy
  • name: MappingPolicy
  • name: FormPolicy
  • name: FallbackPolicy nlu_threshold: 0.4 core_threshold: 0.3 fallback_action_name: action_sos

If I run the kubectl get pods --namespace=rasaxbube I get the below showing that the duckling server us up and running

NAME READY STATUS RESTARTS AGE rasa-x-1583082199-app-6d946b666-4jdkv 1/1 Running 0 10h rasa-x-1583082199-duckling-6484d99665-gd4xl 1/1 Running 0 10h rasa-x-1583082199-event-service-77df68d5bd-f2mff 1/1 Running 1 10h rasa-x-1583082199-nginx-5cdd9f9f64-pggnb 1/1 Running 0 10h rasa-x-1583082199-postgresql-0 1/1 Running 0 10h rasa-x-1583082199-rabbit-0 1/1 Running 0 10h rasa-x-1583082199-rasa-production-7f658f6c7f-mpc96 1/1 Running 0 10h rasa-x-1583082199-rasa-worker-c566fc784-jrzdt 1/1 Running 0 10h rasa-x-1583082199-rasa-x-7566879b77-zt7m5 1/1 Running 4 10h rasa-x-1583082199-redis-master-0 1/1 Running 0 10h

How do I fix this error. I am thinking that duckling is using another hostname that is not “duckling” that is why I am getting this error. What should i put in my config file to fix this

Hi @SimbaM,

Did you use the Rasa X helm charts to deploy rasa x to your kubernetes cluster?

Yes… I basically followed through the steps in the Master class

@Arjaan… tell me what am i missing here.

Hey @SimbaM, so the url won’t just be duckling, it’ll be the service name. So probably something similar to <release-name>-duckling, but you can check that in your kubernetes console

1 Like

Hey @akelad

Thanks for your response. So I did as you advised, but still cant connect to duckling. So these are the steps that I took:

  1. Getting the name of the service

    kubectl get services --namespace=rasaxkube

    NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE rasa-x-1583082199-app ClusterIP 10.12.8.92 5055/TCP,80/TCP 6d1h rasa-x-1583082199-duckling ClusterIP 10.12.13.245 8000/TCP 6d1h

  2. Insert it in the config file:

language: en pipeline:

  • name: SpacyNLP
  • name: SpacyTokenizer
  • name: SpacyFeaturizer
  • name: RegexFeaturizer
  • name: CRFEntityExtractor
  • name: EntitySynonymMapper
  • name: SklearnIntentClassifier
  • name: DucklingHTTPExtractor url: ‘http://rasa-x-1583082199-duckling’ dimensions:
    • time
    • number
    • amount-of-money policies:
  • name: MemoizationPolicy
  • name: KerasPolicy
  • name: MappingPolicy
  • name: FormPolicy
  • name: FallbackPolicy nlu_threshold: 0.4 core_threshold: 0.3 fallback_action_name: action_sos
  1. Had a sample chat and this was what was in the logs of the production pod.

2020-03-08 12:23:42 ERROR rasa.nlu.extractors.duckling_http_extractor - Failed to connect to duckling http server. Make sure the duckling server is running/healthy/not stale and the proper host and port are set in the configuration. More information on how to run the server can be found on github: GitHub - facebook/duckling: Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings. Error: HTTPConnectionPool(host=‘rasa-x-1583082199-duckling’, port=80): Max retries exceeded with url: /parse (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f0e3db7c978>, ‘Connection to rasa-x-1583082199-duckling timed out. (connect timeout=3)’))

Looking forward to hearing from you on this

Simba

@akelad Thanks for your help… i got it now… I had left the port… its now working :slight_smile:

1 Like