I've digged the problem a little deeper.

My uwsgi.ini now looks like this:

[uwsgi]
plugins=pypy
chdir=/home/erob/src/django-hotsauce-0.9/tests/benchmarks/lib/pypy/django_sqlite
master=True
pidfile=/tmp/uwsgi-master.pid
vacuum=True
max-requests=5000
socket=127.0.0.1:8000
pypy-home=/usr/local/pypy
pypy-wsgi=benchmark.wsgi:application

Traceback:

ENVIRON: LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
ENVIRON: XDG_MENU_PREFIX=xfce-
ENVIRON: LANG=en_CA.utf8
ENVIRON: DISPLAY=:0.0
ENVIRON: OLDPWD=/home/erob/src/django-hotsauce-0.9/tests/benchmarks/lib/pypy/django_sqlite/benchmark
ENVIRON: COLORTERM=rxvt
ENVIRON: XDG_VTNR=7
ENVIRON: SSH_AUTH_SOCK=/tmp/ssh-sarMdiJdtI4D/agent.775
ENVIRON: GLADE_CATALOG_PATH=:
ENVIRON: XDG_SESSION_ID=2
ENVIRON: XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/erob
ENVIRON: USER=erob
ENVIRON: GLADE_MODULE_PATH=:
ENVIRON: DESKTOP_SESSION=lightdm-xsession
ENVIRON: PWD=/home/erob/src/django-hotsauce-0.9/tests/benchmarks/lib/pypy/django_sqlite
ENVIRON: HOME=/home/erob
ENVIRON: SSH_AGENT_PID=1042
ENVIRON: QT_ACCESSIBILITY=1
ENVIRON: XDG_SESSION_TYPE=x11
ENVIRON: XDG_DATA_DIRS=/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share
ENVIRON: XDG_SESSION_DESKTOP=lightdm-xsession
ENVIRON: GLADE_PIXMAP_PATH=:
ENVIRON: DESKTOP_STARTUP_ID=xfce4-panel/exo-open/1069-0-marina_TIME100892
ENVIRON: TERM=rxvt
ENVIRON: SHELL=/bin/bash
ENVIRON: XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
ENVIRON: XDG_CURRENT_DESKTOP=XFCE
ENVIRON: QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
ENVIRON: SHLVL=1
ENVIRON: COLORFGBG=0;15
ENVIRON: XDG_SEAT=seat0
ENVIRON: LANGUAGE=en_CA:en
ENVIRON: WINDOWID=44040194
ENVIRON: GDMSESSION=lightdm-xsession
ENVIRON: LOGNAME=erob
ENVIRON: DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-iOI2an0AiX,guid=b2939762a51bb6d7f7fca2a75a7c46b9
ENVIRON: XDG_RUNTIME_DIR=/run/user/1000
ENVIRON: QT_XCB_FORCE_SOFTWARE_OPENGL=1
ENVIRON: XAUTHORITY=/home/erob/.Xauthority
ENVIRON: XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
ENVIRON: XDG_CONFIG_DIRS=/etc/xdg
ENVIRON: PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
ENVIRON: SESSION_MANAGER=local/marina:@/tmp/.ICE-unix/1052,unix/marina:/tmp/.ICE-unix/1052
ENVIRON: _=/usr/local/pypy/bin/uwsgi
ENVIRON: UWSGI_RELOADS=0
max space for custom process name = 2925
[uwsgi-logger] registered "syslog"
[uwsgi-logger] registered "rsyslog"
[uwsgi-logger] registered "socket"
[uwsgi-logger] registered "redislog"
[uwsgi-logger] registered "mongodblog"
[uwsgi-logger] registered "file"
[uwsgi-logger] registered "fd"
[uwsgi-logger] registered "stdio"
[uwsgi-cheaper-algo] registered "busyness"
executable name: /usr/local/pypy/pypy2-v5.9.0-linux32/bin/uwsgi
tmp = /
[uWSGI] getting INI configuration from uwsgi.ini
[uWSGI DEBUG] loading plugin pypy
pypy plugin already available
optind:3 argc:3
[uwsgi-cheaper-algo] registered "spare"
[uwsgi-cheaper-algo] registered "backlog"
[uwsgi-cheaper-algo] registered "manual"
*** Starting uWSGI 2.0.15 (32bit) on [Thu Feb  8 14:30:22 2018] ***
***
*** You are running a DEBUG version of uWSGI, please disable debug in your build profile and recompile it ***
***
compiled with version: 6.3.0 20170516 on 08 February 2018 09:02:54
os: Linux-4.9.0-5-686-pae #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)
nodename: marina
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /home/erob/src/django-hotsauce-0.9/tests/benchmarks/lib/pypy/django_sqlite
writing pidfile to /tmp/uwsgi-master.pid
detected binary path: /usr/local/pypy/pypy2-v5.9.0-linux32/bin/uwsgi
chdir() to /home/erob/src/django-hotsauce-0.9/tests/benchmarks/lib/pypy/django_sqlite
your processes number limit is 11955
your memory page size is 4096 bytes
detected max file descriptor number: 1024
cores allocated...
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 3
Initialized PyPy with Python 2.7.13 (84a2f3e6a7f8, Oct 03 2017, 12:58:57)
[PyPy 5.9.0 with GCC 4.6.3]
PyPy Home: /usr/local/pypy/pypy2-v5.9.0-linux32
[uWSGI DEBUG] uwsgi socket 256 SO_RCVBUF size: 87380
[uWSGI DEBUG] uwsgi socket 256 SO_SNDBUF size: 16384
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 127976 bytes (124 KB) for 1 cores
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 7227)
spawned uWSGI worker 1 (pid: 7229, cores: 1)
adding 6 to signal poll
[uWSGI DEBUG] PATH_INFO=/benchmark/
[uWSGI DEBUG] SERVER_NAME=localhost
[uWSGI DEBUG] SCRIPT_NAME=
[uWSGI DEBUG] HTTP_HOST=localhost
From cffi callback <function uwsgi_pypy_wsgi_handler at 0xb386a3d0>:
Traceback (most recent call last):
  File "c callback", line 472, in uwsgi_pypy_wsgi_handler
  File "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/Django-1.11.7-py2.7.egg/django/core/handlers/wsgi.py", line 156, in __call__
    request = self.request_class(environ)
  File "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/Django-1.11.7-py2.7.egg/django/core/handlers/wsgi.py", line 97, in __init__
    self.method = environ['REQUEST_METHOD'].upper()
KeyError: u'REQUEST_METHOD'
[pid: 7229|app: -1|req: -1/1] 127.0.0.1 () {36 vars in 444 bytes} [Thu Feb  8 19:30:34 2018] GET /benchmark/ => generated 0 bytes in 4 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
SIGINT/SIGQUIT received...killing workers...
worker 1 buried after 1 seconds
goodbye to uWSGI.
VACUUM: pidfile removed.

My python module looks like this:

import os
import django

#from django.core.wsgi import get_wsgi_application
from django.core.handlers.wsgi import WSGIHandler

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "benchmark.settings")
django.setup()

application = WSGIHandler()

Any ideas why the environ object doesn't have REQUEST_METHOD ?

Etienne

Le 2018-02-08 à 09:17, Etienne Robillard a écrit :
Hi,

I'm trying to run uWSGI 2.0.15 with PyPy 5.9 to bootstrap a native django app.

Here's my uwsgi.ini :

[uwsgi]
chdir=/home/erob/src/django-hotsauce-0.9/tests/benchmarks/lib/pypy/django_sqlite
module=benchmark.wsgi:application
master=True
pidfile=/tmp/uwsgi-master.pid
vacuum=True
max-requests=5000
daemonize=/var/log/uwsgi.log
socket=127.0.0.1:8000
pypy-home=/usr/local/pypy

Command line:

$ /usr/local/pypy/bin/uwsgi --ini uwsgi.ini

Traceback:

From cffi callback <function uwsgi_pypy_wsgi_handler at 0xb377d390>:
Traceback (most recent call last):
  File "c callback", line 472, in uwsgi_pypy_wsgi_handler
TypeError: 'NoneType' object is not callable
[pid: 5698|app: -1|req: -1/2] 127.0.0.1 () {36 vars in 444 bytes} [Thu Feb  8 09:11:04 2018] GET /benchmark/ => generated 0 bytes in 2 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)


Any ideas what I'm doing wrong? I compiled and installed uwsgi with pypy 5.9.


Thanks in advance,


Etienne


_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/


_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to