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

sanic-restplus breaks on sanic 19.12.2 #17

Closed
DavidBord opened this issue Jan 28, 2020 · 4 comments
Closed

sanic-restplus breaks on sanic 19.12.2 #17

DavidBord opened this issue Jan 28, 2020 · 4 comments

Comments

@DavidBord
Copy link

Run the quick start example on Sanic 19.12.2 and got this error message:

[2020-01-28 07:26:29 +0200] [53084] [INFO] Goin' Fast @ http://127.0.0.1:8000
[2020-01-28 07:26:29 +0200] [53084] [INFO] Starting worker [53084]
KeyError('PROPAGATE_EXCEPTIONS')
[2020-01-28 07:26:31 +0200] [53084] [ERROR] Exception occurred while handling uri: 'http://localhost:8000/todos'
Traceback (most recent call last):
  File "/Users/db/venvs/untitled3/lib/python3.7/site-packages/sanic/app.py", line 946, in handle_request
    request, request_name=name
TypeError: _run_request_middleware() got an unexpected keyword argument 'request_name'
[2020-01-28 07:26:31 +0200] - (sanic.access)[INFO][127.0.0.1:49633]: GET http://localhost:8000/todos  500 144
@ashleysommer
Copy link
Owner

Hi @DavidBord

I should put a notice in the Readme on the GitHub landing page about this.

It is related to this issue: ashleysommer/sanic-plugin-toolkit#15
Unfortunately the latest released version of Sanic-Plugins-Framework doesn't work on Sanic 19.12.0.

You can get around the problem by manually updating to the latest beta SPF.

@DavidBord
Copy link
Author

Hi,
Thanks for the quick reply.
For the latest beta SPF I get the following exception:

    rest_assoc.api(api)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/restplus.py:10: in api
    return plug.api(reg, *args, api_class=api_class, **kwargs)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/restplus.py:76: in api
    api.init_api(reg, **kwargs)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:212: in init_api
    self._init_app(app, context)
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:222: in _init_app
    self._register_specs()
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:273: in _register_specs
    resource_class_args=(self, )
../../../venvs/untitled3/lib/python3.7/site-packages/sanic_restplus/api.py:354: in _register_view
    spf._plugin_register_route(resource_func, restplus, context, rule,
E   AttributeError: 'SanicPluginsFramework' object has no attribute '_plugin_register_route'

@ashleysommer
Copy link
Owner

Hi @DavidBord
Thanks for the report. I forgot that Sanic-Restplus will need some modification to work with the new SPF version. I'm working on a new Beta release today that should fix it.

@ashleysommer
Copy link
Owner

@DavidBord
I've just pushed two new versions.

  • v0.4.1.post1 works on Sanic v18.12.0 to v19.9.0, and fixes the 'PROPAGATE_EXCEPTIONS' KeyError you saw in your first comment.
  • v0.5.0.b1 is a beta release, works on Sanic v19.12+ includes the above fix and Sanic compatibility fixes (and a API Url-Prefix issue)

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

No branches or pull requests

2 participants