#30067: 500 Internal Server Error!! - Issue in wsgi in django application 
migrating
from python2.7 to python3.6
-------------------------------------+-------------------------------------
               Reporter:  sindhujit  |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  1.11
  Uncategorized                      |       Keywords:  django wsgi nginx
               Severity:  Normal     |  python3
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I am getting 500 Internal Server Error when I migrated my django app from
 python2.7 to python3.6. I have created a new virtualenv, and created all
 the apps individually. The virtualenv is defined in uwsgi.ini file

 home    =       /home/netadc/.venvs1/netadc

 I have installed all the packages using pip3.6. I am not sure what I am
 missing. Every config in uwsgi is same as python2.7 when it was working.I
 am using uwsgi 2.0.13. I have restarted nginx as well. Is there a separate
 uwsgi for python3 which I cannot locate? The socket permissions are also
 same as before. Please help.

 The command to start wsgi is :- /home/netadc/.venvs1/netadc/bin/uwsgi
 --ini /home/netadc/apps/netadc/netadc/uwsgi/netadc_uwsgi.ini --enable-
 threads

 In wsgi logs, i see :- --- no python application found, check your startup
 logs for errors ---
 [pid: 13634|app: -1|req: -1/3] x.x.x.x () {42 vars in 1029 bytes} [Mon Dec
 17 09:04:40 2018] GET /netadc/home => generated 21 bytes in 0 msecs
 (HTTP/1.1 500)

 The access logs in nginx show :- x.x.x.x - - [17/Dec/2018:09:05:43 -0700]
 "GET /netadc/home HTTP/1.1" 500 32

 Nothing comes up in nginx error logs.

 When I do manage.py shell, I see :- ImportError: bad magic number in
 'lib': b'\x03\xf3\r\n'

 I removed all the .pyc files, but then sometimes manage.py shell hangs up
 and sometimes it opens fine. But again after sometime, I will get the
 magic number error as above.

 When I revert the virtualenv back to my previous virtualenv in the
 uwsgi.ini file which uses python2.7, I get some error logs on uwsgi.

 home    =       /home/netadc/.venvs/netadc Log :- File
 "./ivpn/rest_appviewx.py", line 29
  print('Server IP has NAT already. So no QIP update needed.', end=' ')
                                                                     ^
 SyntaxError: invalid syntax

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30067>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.058d98695859571411c8352142275556%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to