asgiref dependency should be updated; channels 3.0.3 requires min. 3.2.10, which doesn't work for background workers
See original GitHub issueChannels 3.0.3 depends on asgiref>=3.2.10
, however with that version, background workers will fail with TypeError: __call__() missing 2 required positional arguments: 'receive' and 'send'
when receiving a message, even if declared with .as_asgi()
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
asgiref dependency should be updated; channels 3.0.3 requires min ...
asgiref dependency should be updated; channels 3.0.3 requires min. 3.2.10, which doesn't work for background workers.
Read more >32128 (Issue with asgiref dependency installing Django 3.1.x)
I installed asgiref first here just for demonstration. A straight pip install Django equally picks 3.2.10. I think this is a RB as...
Read more >Issue with asgiref dependency installing Django 3.1.x
Successfully uninstalled asgiref-3.2.10. ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will ...
Read more >Recommended update for python-Sphinx, python-amqp ...
An update that has 5 recommended fixes can now be installed. Description: This update for python-Sphinx, python-amqp, python-asgiref, python-billiard, python- ...
Read more >All NetBSD Packages
'GitHub' Username of the Current User; R-withr-2.5.0: Run code 'with' temporarily modified ... bsetroot-0.1nb7: Tools to set the root windows background ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Channels 3.0.3 depends on
asgiref>=3.2.10
. However, when actually running with 3.2.10 (as can happen after an upgrade from Channels 2), background workers fail withTypeError: __call__() missing 2 required positional arguments: 'receive' and 'send'
when receiving a message. This looks like the workers are not ASGI 3 compliant, even though they have been defined with.as_asgi()
inrouting.py
. Manually upgrading asgiref to 3.3.1 resolves the issue. I have not tested interim versions to identify the actual minimum required vesion.With 3.2.10, both SyncConsumer and AsyncConsumer workers fail. Groups however work fine.
This is with Debian 10.7, with stock Python 3.7.3. Packages:
Minimal setup to reproduce:
settings.py:
routing.py:
workers.py:
Steps:
./manage.py runworker testworker
async_to_sync(channel_layer.send)('testworker', {'type': 'test.action', 'data': 'Test'})
Expected outcome:
Actual outcome:
Closed in #1614