Issue running starlette: TypeError: _run_asgi2() takes 2 positional arguments but 4 were given
See original GitHub issueI am getting the following traceback when trying to launch an asgi server with starlette:
I am using this run command: newrelic-admin run-program gunicorn -w 4 -k uvicorn.workers.UvicornWorker my_package:app
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 391, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/app/.heroku/python/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/api/asgi_application.py", line 387, in nr_async_asgi
return await coro
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/common/async_proxy.py", line 148, in __next__
return self.send(None)
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/common/async_proxy.py", line 120, in send
return self.__wrapped__.send(value)
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/api/asgi_application.py", line 387, in nr_async_asgi
return await coro
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/common/async_proxy.py", line 148, in __next__
return self.send(None)
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/common/async_proxy.py", line 120, in send
return self.__wrapped__.send(value)
File "/app/.heroku/python/lib/python3.8/site-packages/starlette/applications.py", line 111, in __call__
await self.middleware_stack(scope, receive, send)
File "<string>", line 5, in wrapper
File "/app/.heroku/python/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/app/.heroku/python/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/hooks/framework_starlette.py", line 108, in middleware_wrapper
return await FunctionTraceWrapper(wrapped, name=name)(*args, **kwargs)
File "/app/.heroku/python/lib/python3.8/site-packages/newrelic/api/function_trace.py", line 150, in literal_wrapper
return wrapped(*args, **kwargs)
TypeError: _run_asgi2() takes 2 positional arguments but 4 were given
Using:
newrelic==5.24.0.153
starlette==0.13.8
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:32 (12 by maintainers)
Top Results From Across the Web
TypeError: _() takes 2 positional arguments but 4 were given
The Column method contains can only take one value but you're passing 3. The function is defined as: def contains(self, item: Any) ->...
Read more >Predict() Takes 2 Positional Arguments But 3 Were Given
using this run command: newrelicadmin runprogram gunicorn w 4 k Issue running starlette: TypeError: runasgi2 takes 2 positional arguments ...
Read more >tiangolo/fastapi - Gitter
TypeError : call() missing 2 required positional arguments: 'receive' and 'send' INFO: ('127.0.0.1', 38604) - "GET /api/v1/docs HTTP/1.1" 500. Pouchain Rémy.
Read more >Error in ASGI app - Agents - New Relic Explorers Hub
TypeError : call() missing 2 required positional arguments: 'receive' and ... run-program gunicorn app.main:app -w 4 -k uvicorn.workers.
Read more >Starlette
Starlette is a lightweight ASGI framework/toolkit, which is ideal for building async web services in Python. It is production-ready, and gives you the ......
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
Why has this been marked as wontfix? We are having the same issue and even trying the alternative method (here: https://docs.newrelic.com/docs/apm/agents/python-agent/installation/python-agent-advanced-integration/#manual-integration ) we have exactly the same error. Basically we have no way to use New Relic in our application because we are also using Sentry.
This is still an issue for us with similar circumstances.