1

I generate Image with Celery task in this code. this is the part of an ajax view function.

task_result = generate_result_image.apply((answer, combi.id, lang))
if task_result.state == "SUCCESS":
     response['ok'] = 'yes'
     return HttpResponse(json.dumps(response), content_type='application/json')

this is working locally perfectly, but in prod server, i am getting 502 bad gateway. this is the browser console msg:

enter image description here

what am I doing wrong? this is really mysterious..

this is the uwsgi log, the line where the cursor stands is the call I am doing. I seems, the worker is dying right after my call... no idea why..

enter image description here

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
doniyor
  • 36,596
  • 57
  • 175
  • 260
  • 1
    This is probably about your nginx + uwsgi configuration (if I remember correctly your setup). – alecxe Apr 04 '15 at 04:56
  • 1
    @alecxe hey alex, do I need setup something else in nginx+uwsgi conf for ajax ? – doniyor Apr 04 '15 at 04:57
  • 1
    Not sure it would help, but quick google search points to it: http://stackoverflow.com/questions/11529288/nginx-django-502-bad-gateway, http://stackoverflow.com/questions/17319896/502-bad-gateway-django, http://serverfault.com/questions/504901/nginx-502-bad-gateway-runing-django-in-uwsgi. – alecxe Apr 04 '15 at 04:59
  • @alecxe you are right, i think, please see my update, i posted the screenshot from uwsgi logs – doniyor Apr 04 '15 at 05:06
  • What a nice set of harakiris. – alecxe Apr 04 '15 at 05:07
  • @alecxe anything wrong with them? :( – doniyor Apr 04 '15 at 05:10

1 Answers1

0

problem solved - the bit was not my code, nor my settings but the remote server I was sending files to, to generate image. Many thanks to Alex for showing the right direction..

doniyor
  • 36,596
  • 57
  • 175
  • 260