-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[aiohttp.web] TypeError: Application.__call__() takes 1 positional argument but 2 were given #7017
Comments
If this library added to unit frameworks it will be at top of the list (alphabetical order) 😃 |
I'm not too familiar with exactly how WSGI works, but our docs suggest either deploying with a proxy over unix socket (https://docs.aiohttp.org/en/stable/deployment.html#nginx-supervisord) or with Gunicorn (https://docs.aiohttp.org/en/stable/deployment.html#nginx-gunicorn). I think the gunicorn worker creates a WSGI interface (atleast I see references to wsgi in the code: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/worker.py), so maybe you just need to make use of Gunicorn in order to give Unit a WSGI environment to work with? If you figure it out, we can consider taking any changes or updating the docs if it's not obvious. To be clear though, the |
ASGI ? |
I tried with protocol "asgi" (https://unit.nginx.org/configuration/#python) .
I know. But all the popular lib already supported and listed there. I don't know how the unit works actually. It just works with all the similar libraries. So i thought may be it support aiohttp too. If you can please consider adding support for unit 🙏 |
Seem to be similar, Unit says it supports both, and I suspect you can get Gunicorn to do either too.
Docs say it just uses WSGI or ASGI (https://unit.nginx.org/#supported-app-languages), so I doubt we need Unit-specific config. But, other libraries often use these as the default method of running their applications, whereas we default to running on a socket. So, you'll just need play around to figure it out. Again, Gunicorn may provide what you need, so I'd start looking there. |
@4n1qz5skwv aiohttp doesn't support ASGI, so you would not be able to run it as described unless you provide your own wrapper around. See #2902 |
I'm going to close this as a duplicate of #8473, as it doesn't look like there's any other approach that Unit will work other than ASGI. |
Describe the bug
Trying use "aiohttp" with "nginx unit"
aiohttp is not listed in https://unit.nginx.org/howto/#frameworks
So, tried to use basic ASGI approach. Not working.
To Reproduce
Expected behavior
Expected behavior:
404: Not Found
Actual behavior:
Error 503.
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
$ python -m pip show multidict
yarl Version
$ python -m pip show yarl
OS
ubuntu 22.04
Related component
Server
Additional context
Please add support for unit.
https://unit.nginx.org/
https://unit.nginx.org/howto/#frameworks
If possible please add this library to unit frameworks list with a demo. It will be very very helpful for us to get started.
Thank you for this awesome lib.
Code of Conduct
The text was updated successfully, but these errors were encountered: