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

Opsdroid exits with a weird error when Rasa is not reachable #1970

Closed
oleg-fiksel opened this issue Dec 17, 2022 · 0 comments · Fixed by #1971
Closed

Opsdroid exits with a weird error when Rasa is not reachable #1970

oleg-fiksel opened this issue Dec 17, 2022 · 0 comments · Fixed by #1971
Assignees
Labels

Comments

@oleg-fiksel
Copy link
Contributor

oleg-fiksel commented Dec 17, 2022

Description

When using Opsdroid with Rasa (rasanlu parser) and Rasa is not reachable, then Opsdroid exits with an exception, which doesn't describe directly the cause of the error.

Also described here: #1785 (review)

Steps to Reproduce

  • Make sure Opsdroid cannot connect to Rasa (shut it down or use non-existent hostname)
  • Run Opsdroid with a sample skill and intents.yml for Rasa

Expected Functionality

  • Opsdroid exits with a non-zero error code and a appropriate error message stating, what caused the error.

Experienced Functionality

Opsdroid exits with a stack trace:

...
DEBUG opsdroid.core Loaded 1 skills.
DEBUG opsdroid.connector.websocket Starting Websocket connector.
DEBUG opsdroid.parsers.rasanlu Checking Rasa NLU version.
ERROR opsdroid.parsers.rasanlu Unable to connect to Rasa NLU.
DEBUG asyncio Using selector: KqueueSelector
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/olegfiksel/opsdroid/opsdroid/__main__.py", line 12, in <module>
    init()
  File "/Users/olegfiksel/opsdroid/opsdroid/__main__.py", line 9, in init
    opsdroid.cli.cli()
  File "/Users/olegfiksel/opsdroid/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/olegfiksel/opsdroid/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/olegfiksel/opsdroid/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/olegfiksel/opsdroid/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/olegfiksel/opsdroid/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/olegfiksel/opsdroid/opsdroid/cli/start.py", line 41, in start
    opsdroid.run()
  File "/Users/olegfiksel/opsdroid/opsdroid/core.py", line 170, in run
    self.sync_load()
  File "/Users/olegfiksel/opsdroid/opsdroid/core.py", line 219, in sync_load
    self.eventloop.run_until_complete(self.load())
  File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/Users/olegfiksel/opsdroid/opsdroid/core.py", line 232, in load
    await self.train_parsers(self.modules["skills"])
  File "/Users/olegfiksel/opsdroid/opsdroid/core.py", line 360, in train_parsers
    rasa_version_is_compatible = await has_compatible_version_rasanlu(
  File "/Users/olegfiksel/opsdroid/opsdroid/parsers/rasanlu.py", line 103, in has_compatible_version_rasanlu
    version = json_object["version"]
TypeError: 'NoneType' object is not subscriptable

Versions

  • Opsdroid version: master (1b392dd)
  • Python version: 3.9.9
  • OS/Docker version: MacOS 12.6

Configuration File

welcome-message: false
logging:
  level: debug
connectors:
  websocket:
parsers:
  rasanlu:
    url: http://non-existent-host:5005
    token: very-secure-rasa-auth-token
skills:
  rasa-test:
    path: /Users/olegfiksel/opsdroid/rasa_test_skill

Skill file and intents.yml are irrelevant because Opsdroid doesn't get to this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant