Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Unavailable in 'http://localhost:5005/webhooks/rest/webhook?stream=true&token=' #11110

Closed
HariharanMiracle opened this issue May 3, 2022 · 11 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@HariharanMiracle
Copy link

Rasa Open Source version

3.1

Rasa SDK version

No response

Rasa X version

No response

Python version

3.8

What operating system are you using?

Windows

What happened?

Hi Getting similar error in rasa 3.1 version, I tried pip install sanic==19.9.0, but did not work. Any help?

Found a similar issue: #5019
.ClientResponseError: 503, message='Service Unavailable', url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&token=')

Command / Request

Step: 
Install rasa
Train
Added fallback according to https://rasa.com/docs/rasa/fallback-handoff/  ->  NLU Fallback
After rasa shell it did not work

Relevant log output

TRACE:
(env) (base) C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\Kaweesha-Bot>rasa shell
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\keras_preprocessing\image\utils.py:23: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
'nearest': pil_image.NEAREST,
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\keras_preprocessing\image\utils.py:24: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
'bilinear': pil_image.BILINEAR,
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\keras_preprocessing\image\utils.py:25: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
'bicubic': pil_image.BICUBIC,
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\keras_preprocessing\image\utils.py:28: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
if hasattr(pil_image, 'HAMMING'):
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\keras_preprocessing\image\utils.py:30: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
if hasattr(pil_image, 'BOX'):
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\keras_preprocessing\image\utils.py:33: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
if hasattr(pil_image, 'LANCZOS'):
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\flatbuffers\compat.py:19: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\sklearn\utils\multiclass.py:14: DeprecationWarning: Please use spmatrix from the scipy.sparse namespace, the scipy.sparse.base namespace is deprecated.
from scipy.sparse.base import spmatrix
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\matplotlib_init_.py:169: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(module.version) < minver:
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\setuptools_distutils\version.py:351: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
other = LooseVersion(other)
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\tensorflow_addons\utils\ensure_tf_install.py:47: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
min_version = LooseVersion(INCLUSIVE_MIN_TF_VERSION)
C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\sanic_cors\extension.py:39: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
SANIC_VERSION = LooseVersion(sanic_version)
2022-05-03 13:36:32 INFO root - Connecting to channel 'cmdline' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.
2022-05-03 13:36:32 INFO root - Starting Rasa server on http://0.0.0.0:5005
2022-05-03 13:36:33 INFO rasa.core.processor - Loading model models\20220503-132150-rigid-geyser.tar.gz...
2022-05-03 13:36:53 WARNING rasa.shared.utils.common - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future 🔬 Please share your feedback on it in the forum (https://forum.rasa.com) to help us make this feature ready for production.
2022-05-03 13:37:10 INFO root - Rasa server is up and running.
Bot loaded. Type a message and press enter (use '/stop' to exit):
Your input -> Hello
2022-05-03 13:38:17 ERROR asyncio - Task exception was never retrieved
future: <Task finished name='Task-14' coro=<RestInput.on_message_wrapper() done, defined at C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\channels\rest.py:33> exception=GraphComponentException('Error running graph component for node run_FallbackClassifier0.')>
Traceback (most recent call last):
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\engine\graph.py", line 464, in call
output = self._fn(self._component, **run_kwargs)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\nlu\classifiers\fallback_classifier.py", line 87, in process
if not self._should_fallback(message):
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\nlu\classifiers\fallback_classifier.py", line 108, in _should_fallback
intent_name = message.data[INTENT].get(INTENT_NAME_KEY)
KeyError: 'intent'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\channels\rest.py", line 47, in on_message_wrapper
await on_new_message(message)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\channels\channel.py", line 89, in handler
await app.ctx.agent.handle_message(message)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\agent.py", line 420, in handle_message
return await self.processor.handle_message( # type: ignore[union-attr]
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\processor.py", line 136, in handle_message
tracker = await self.log_message(message, should_save_tracker=False)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\processor.py", line 383, in log_message
await self._handle_message_with_tracker(message, tracker)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\processor.py", line 682, in _handle_message_with_tracker
parse_data = await self.parse_message(message)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\processor.py", line 635, in parse_message
parse_data = self._parse_message_with_graph(message, only_output_properties)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\processor.py", line 659, in _parse_message_with_graph
results = self.graph_runner.run(
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\engine\runner\dask.py", line 101, in run
dask_result = dask.get(run_graph, run_targets)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 553, in get_sync
return get_async(
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 496, in get_async
for key, res_info, failed in queue_get(queue).result():
File "c:\users\zincat-user\anaconda3\lib\concurrent\futures_base.py", line 432, in result
return self.__get_result()
File "c:\users\zincat-user\anaconda3\lib\concurrent\futures_base.py", line 388, in __get_result
raise self._exception
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 538, in submit
fut.set_result(fn(args, **kwargs))
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 234, in batch_execute_tasks
return [execute_task(a) for a in it]
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 234, in
return [execute_task(a) for a in it]
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 225, in execute_task
result = pack_exception(e, dumps)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\local.py", line 220, in execute_task
result = _execute_task(task, data)
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\dask\core.py", line 119, in _execute_task
return func((_execute_task(a, cache) for a in args))
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\engine\graph.py", line 471, in call
raise GraphComponentException(
rasa.engine.exceptions.GraphComponentException: Error running graph component for node run_FallbackClassifier0.
2022-05-03 13:38:17 ERROR asyncio - Task exception was never retrieved
future: <Task finished name='Task-9' coro=<SignalRouter._dispatch() done, defined at C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\sanic\signals.py:122> exception=ClientResponseError(RequestInfo(url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&token='), method='POST', headers=<CIMultiDictProxy('Host': 'localhost:5005', 'Accept': '/', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.8 aiohttp/3.7.4', 'Content-Length': '66', 'Content-Type': 'application/json')>, real_url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&token=')), (), status=503, message='Service Unavailable', headers=<CIMultiDictProxy('Content-Length': '79', 'Connection': 'close', 'Content-Type': 'application/json')>)>
Traceback (most recent call last):
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\sanic\signals.py", line 163, in _dispatch
retval = await maybe_coroutine
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\sanic\app.py", line 1202, in run_delayed_task
await prepped
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\run.py", line 135, in run_cmdline_io
await console.record_messages(
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\channels\console.py", line 195, in record_messages
async for response in bot_responses_stream:
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\rasa\core\channels\console.py", line 141, in _send_message_receive_stream
async with session.post(url, json=payload, raise_for_status=True) as resp:
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\aiohttp\client.py", line 1117, in aenter
self._resp = await self._coro
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\aiohttp\client.py", line 625, in _request
resp.raise_for_status()
File "C:\Users\Zincat-User\Documents\Clients\Kaweesha\Workspace\env\lib\site-packages\aiohttp\client_reqrep.py", line 1000, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 503, message='Service Unavailable', url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&token=')
@HariharanMiracle HariharanMiracle added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels May 3, 2022
@sara-tagger
Copy link
Collaborator

Thanks for the issue, @b-quachtran will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@KongHongYi
Copy link

I got the same error. Looking for an answer.

@HariharanMiracle
Copy link
Author

I actually found the solution I guess, Try having the right pipelines and policies in the config file, that solved me the issue.

Example file:

The config recipe.

https://rasa.com/docs/rasa/model-configuration/

recipe: default.v1

Configuration for Rasa NLU.

https://rasa.com/docs/rasa/nlu/components/

language: en

pipeline:

# No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.

# If you'd like to customize it, uncomment and adjust the pipeline.

# See https://rasa.com/docs/rasa/tuning-your-model for more information.

  • name: WhitespaceTokenizer
  • name: RegexFeaturizer
  • name: LexicalSyntacticFeaturizer
  • name: CountVectorsFeaturizer
  • name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  • name: DIETClassifier
    epochs: 100
    constrain_similarities: true
  • name: EntitySynonymMapper
  • name: ResponseSelector
    epochs: 100
    constrain_similarities: true

- name: FallbackClassifier

threshold: 0.3

ambiguity_threshold: 0.1

  • name: FallbackClassifier
    threshold: 0.7

# No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.

# If you'd like to customize it, uncomment and adjust the pipeline.

# See https://rasa.com/docs/rasa/tuning-your-model for more information.

- name: WhitespaceTokenizer

- name: RegexFeaturizer

- name: LexicalSyntacticFeaturizer

- name: CountVectorsFeaturizer

- name: CountVectorsFeaturizer

analyzer: char_wb

min_ngram: 1

max_ngram: 4

- name: DIETClassifier

epochs: 100

constrain_similarities: true

- name: EntitySynonymMapper

- name: ResponseSelector

epochs: 100

constrain_similarities: true

- name: FallbackClassifier

threshold: 0.3

ambiguity_threshold: 0.1

Configuration for Rasa Core.

https://rasa.com/docs/rasa/core/policies/

policies:

# No configuration for policies was provided. The following default policies were used to train your model.

# If you'd like to customize them, uncomment and adjust the policies.

# See https://rasa.com/docs/rasa/policies for more information.

  • name: MemoizationPolicy
  • name: RulePolicy
  • name: UnexpecTEDIntentPolicy
    max_history: 5
    epochs: 100
  • name: TEDPolicy
    max_history: 5
    epochs: 100
    constrain_similarities: true

@HariharanMiracle
Copy link
Author

I got the same error. Looking for an answer.

Please refer the above, if u need a sample project, tell me your email address I will share a sample working project with you.

@m-vdb
Copy link
Collaborator

m-vdb commented May 12, 2022

thanks @HariharanMiracle for posting your solution, I'll close this issue then

@m-vdb m-vdb closed this as completed May 12, 2022
@Nummulit
Copy link

Nummulit commented Jun 2, 2022

So the solution is to just uncomment default pipeline in config.yml file?

@HariharanMiracle
Copy link
Author

So the solution is to just uncomment default pipeline in config.yml file?

@Nummulit yes, to give you an explanation:
Rasa works with default configuration if you have the uncommented file (config.yml).
But to use fall back policy you need to add some more configuration as in the rasa documentation refers to "https://rasa.com/docs/rasa/fallback-handoff/"
To achieve this, you need to modify the config file. In the first case I tried to modify the file just having the fallback policy related policies. "I think which caused me such issue"
Later on I uncommented the whole file and added the relevant policies and pipelines, so which worked fine later.
May be try this as well > pip install sanic==19.9.0
But I don't recommend this bcoz rasa imports most of the dependencies for you.

@Nummulit
Copy link

Nummulit commented Jun 2, 2022

Unfortunately, it doesn't work for me. Honestly, I doubted changes in pipeline would change anything regarding this error. It seems it has to do something with the aiohttp library (or maybe sanic).
Changing sanic version seems to be a good idea, but this version doesn't work with Rasa 3.0.9. Now it requires sanic 21.12, which I have installed, but the problem remains 😞

@luisarmandom
Copy link

was this ever fixed @Nummulit ? I'm running across the same issue.

@Harshal1810
Copy link

I am facing the same issue. Has anyone been able to resolve it?

@bmorris-ocsd
Copy link

I had the same problem as the OP. Uncommented the lines under the pipeline heading in my config.yml file, ran rasa train, then ran rasa actions and rasa shell again, and it worked! What he wrote in: #11110 (comment)

seems to be spot on. It's beyond frustrating to follow a project's documentation (in this case, https://rasa.com/docs/rasa/fallback-handoff/#fallbacks) and find out that a pretty important part is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

8 participants