question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

document RASA_DUCKLING_HTTP_URL env variable usage

See original GitHub issue

Rasa version: 1.10.7

Python version: 3.7

Operating system (windows, osx, …): Windows 10 1909

Issue: It seems like the Duckling-URL becomes a hard-coded part of the NLU-Model. Changing the Duckling-URL after training seems to have no effect.

Repro:

  1. Train a model using f. e. http://localhost:8000 as Duckling-URL
  2. Change the URL to f. e. http://localhost:55555 (but DONT retrain the model)
  3. Start the Duckling-server on http://localhost:55555
  4. Run rasa run
  5. See failure after parsing any message

See also: https://forum.rasa.com/t/does-the-duckling-url-become-a-hard-coded-part-of-the-trained-model/31001

Error (including full traceback):

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: https://github.com/facebook/duckling#quickstart Error: HTTPConnectionPool(host=‘localhost’, port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002BE546C5D48>: Failed to establish a new connection: <span class="error">[WinError 10061]</span> Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte’))

Note: Port 8000 is still used.

Content of configuration file (config.yml) (if relevant): Before

language: de
 pipeline:

*   name: WhitespaceTokenizer
*   name: RegexFeaturizer
*   name: LexicalSyntacticFeaturizer
*   name: CountVectorsFeaturizer
*   name: CountVectorsFeaturizer
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
*   name: DIETClassifier
     epochs: 100
*   name: EntitySynonymMapper
*   name: ResponseSelector
     epochs: 100
*   name: "DucklingHTTPExtractor"
     url: "http://localhost:8000"
     dimensions: <span class="error">["time"]</span>
     locale: "de_DE"
     timezone: "UTC"
     timeout : 3

After

language: de
 pipeline:

*   name: WhitespaceTokenizer
*   name: RegexFeaturizer
*   name: LexicalSyntacticFeaturizer
*   name: CountVectorsFeaturizer
*   name: CountVectorsFeaturizer
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
*   name: DIETClassifier
     epochs: 100
*   name: EntitySynonymMapper
*   name: ResponseSelector
     epochs: 100
*   name: "DucklingHTTPExtractor"
     url: "http://localhost:55555" #This is the only change
     dimensions: <span class="error">["time"]</span>
     locale: "de_DE"
     timezone: "UTC"
     timeout : 3

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wochingecommented, Mar 17, 2022

Exalate commented:

wochinge commented:

You could use an environment variable instead of a hardcoded URL in your configuration, e.g.

language: de
 pipeline:

*   name: WhitespaceTokenizer
*   name: RegexFeaturizer
*   name: LexicalSyntacticFeaturizer
*   name: CountVectorsFeaturizer
*   name: CountVectorsFeaturizer
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
*   name: DIETClassifier
     epochs: 100
*   name: EntitySynonymMapper
*   name: ResponseSelector
     epochs: 100
*   name: "DucklingHTTPExtractor"
     url: $ {DUCKLING_URL} 

     #This is the only change
     dimensions: <span class="error">["time"]</span>
     locale: "de_DE"
     timezone: "UTC"
     timeout : 3

I see that this isn’t ideal in terms of usability, but otherwise we’d need some way to pass in the duckling url during loading the model. I think using an env variable still seems the best way to do this. Wdyt?

1reaction
N-Olbertcommented, Mar 17, 2022

Exalate commented:

N-Olbert commented:

According to the forum, this is defined functionality (see https://forum.rasa.com/t/does-the-duckling-url-become-a-hard-coded-part-of-the-trained-model/31001), so please consider this as an enhancement request rather than a bug.

Not being able to change the port/uri after training is bad because if a customer has already used the Duckling-port which was provided during training there is no way to change this port except to train a new model (which takes some time).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment Variables
Read the Docs supports two types of environment variables in project builds: Default environment variables. User-defined environment variables.
Read more >
How to Use Environmental Variables (.env) Files - YouTube
In this video tutorial I'll be demonstrating the usage of Environmental Variables (.env) Files in software projects.
Read more >
Env Variable Operators - yq - GitBook
These operators are used to handle environment variables usage in expressions and documents. While environment variables can, of course, be passed in via ......
Read more >
Introduction to environment variables
Introduction. Use environment variables to set up various configuration options, and keep your set-up secure with secrets, private keys, and contexts.
Read more >
Using Environment Variables
To set a a runtime environment variable using the Google Cloud CLI, use the --set-env-vars flag at deploy time: gcloud functions deploy. FUNCTION_NAME...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found