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

Rasa SDK incompatible with Sanic version 21.12.0 #647

Closed
2 tasks
khalidtwl opened this issue Jan 4, 2022 · 5 comments · Fixed by #696 or #698
Closed
2 tasks

Rasa SDK incompatible with Sanic version 21.12.0 #647

khalidtwl opened this issue Jan 4, 2022 · 5 comments · Fixed by #696 or #698
Assignees
Labels
area:rasa-sdk 🧑‍💻 Everything that touches our python Rasa SDK type:bug 🐛 Something isn't working

Comments

@khalidtwl
Copy link

khalidtwl commented Jan 4, 2022

Rasa version: 1.10.5

Rasa SDK version: 3.0.2

Python version: 3.7.1

Operating system (windows, osx, ...): linux

Issue: Sanic's latest version 21.12.0 release includes several deprecations, the most notable of which involves replacing a "warn" message with an exception in the sanic/base/root.py file (line 37) if the name passed into the Sanic constructor does not match their regex. Sanic is now enforcing that names have only alphanumeric, underscore, or dash characters.

This is an issue because in the Rasa SDK's endpoint.py line 77, it passes in __name__ into the Sanic constructor, which is rasa_sdk.endpoint and fails the Sanic checks due to it containing a . character. This results in a sanic.exceptions.SanicException and our custom Action Server failing to start.

According to the project dependencies, there is a Sanic version constraint of "^21.6.0" which allows Sanic version "21.12.0" to be used despite their incompatibility. Downgrading our Sanic version resolved this issue.

Error (including full traceback):

Starting rasa action server on port 5055
2022-01-04 01:58:17 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
Traceback (most recent call last):
File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/site-packages/rasa_sdk/__main__.py", line 38, in <module>
main()
File "/usr/local/lib/python3.7/site-packages/rasa_sdk/__main__.py", line 34, in main
main_from_args(cmdline_args)
File "/usr/local/lib/python3.7/site-packages/rasa_sdk/__main__.py", line 25, in main_from_args
args.auto_reload,
File "/usr/local/lib/python3.7/site-packages/rasa_sdk/endpoint.py", line 140, in run
action_package_name, cors_origins=cors_origins, auto_reload=auto_reload
File "/usr/local/lib/python3.7/site-packages/rasa_sdk/endpoint.py", line 77, in create_app
app = Sanic(__name__, configure_logging=False)
File "/usr/local/lib/python3.7/site-packages/sanic/app.py", line 194, in __init__
super().__init__(name=name)
File "/usr/local/lib/python3.7/site-packages/sanic/base/root.py", line 38, in __init__
f"{class_name} instance named '{name}' uses an invalid "
sanic.exceptions.SanicException: Sanic instance named 'rasa_sdk.endpoint' uses an invalid format. Names must begin with a character and may only contain alphanumeric characters, _, or -.

Command or request that led to error:

python3.7 -m rasa_sdk --actions actionserver

Definition of done

  • Change Sanic server name from module name (eg. rasa.server) to a clear name without dots (eg. rasa_server) for rasa-sdk
  • Create a ticket for Rasa repo to do the same.
@khalidtwl khalidtwl added area:rasa-sdk 🧑‍💻 Everything that touches our python Rasa SDK type:bug 🐛 Something isn't working labels Jan 4, 2022
@sara-tagger
Copy link

Thanks for raising this issue, @tayfun will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗

@tayfun
Copy link
Contributor

tayfun commented Jan 5, 2022

Thank you for this detailed issue @khalidtwl . You are right as far as I can see and we have similar problem (and a little more) with rasa as well. I will create a ticket for rasa and we should work on this and the new ticket as well.

For this ticket I think the solution could easily be explicitly specifying Sanic app name instead of getting it from the module name. Sanic apps are not created in many places and hence we do not need naming like loggers.

@TyDunn
Copy link
Contributor

TyDunn commented Jan 31, 2022

@tayfun can we close this?

@tayfun
Copy link
Contributor

tayfun commented Jan 31, 2022

@TyDunn not yet, we removed compositionview but we haven't fixed server names. I'll assign @donodje now.

This was linked to pull requests Feb 11, 2022
@m-vdb
Copy link
Collaborator

m-vdb commented Feb 14, 2022

@donodje can we close this issue?

@m-vdb m-vdb closed this as completed Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-sdk 🧑‍💻 Everything that touches our python Rasa SDK type:bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants