question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ASGI callable returned without completing response & nginx redirect

See original GitHub issue

Hi, I am trying to figure out how to resolve this error and if I am doing something incorrectly. It is triggered when I use the X-Accel-Redirect feature of nginx. This view is working fine as far as I can tell, but after each request I get that exception logged.

My view looks like this:

def view(request):
    filename = "some_file"
    path = "/path/to/image.png"
    response = HttpResponse()
    response["Content-Disposition"] = "attachment; filename={}".format(filename)
    response["X-Accel-Redirect"] = "/protected/{}".format(path)
    return response

Example log:

INFO: / - "GET /app/image/35/ HTTP/1.0" 200
ERROR: ASGI callable returned without completing response.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
tomchristiecommented, Oct 4, 2018

Thanks for reporting this, and your time looking into it!

0reactions
tomchristiecommented, Oct 4, 2018

Okay, oughta now be resolved in 0.3.7. We also now have some really nice debug-level logging in place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASGI callable returned without starting response
My issue was caused by a customize middleware. I've been able to update the middleware and fix this issue.
Read more >
Redirects from Nginx reverse-proxyed Django ASGI server ...
It's adding directories, not dropping the /etesync/ directory like i've seen in other questions. (Going directly to dan9er.internal/etesync/ ...
Read more >
Configuration - NGINX Unit
The value is variable-interpolated; if it matches no configuration entities after interpolation, a 404 “Not Found” status code is returned.
Read more >
tiangolo/fastapi - Gitter
Team, when I add a middleware to my fastapi app, i end up with TypeError: 'NoneType' object is not callable related to URL...
Read more >
Using Starlette to migrate my blog across domains
So, how should I proceed in order not to break URL references, and retain the existing ranking on search engines? The answer was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found