Re: [uWSGI] PyPy issue

2018-02-21 Thread Etienne Robillard

My patch sucks.

I found a much better solution for this problem is to disable 
|-D_FILE_OFFSET_BITS=64 in uwsgiconfig.py for 32-bit builds.


However I haven't tested yet to run pypy on a 64-bit system.

||Etienne|
||

Le 2018-02-12 à 05:35, Krzysztof Warzecha a écrit :

I'm glad you got that working. That's a 32-bit system, isn't it? Looks
like you got bit by this bug:
https://github.com/unbit/uwsgi/issues/1129

On 9 February 2018 at 13:44, Etienne Robillard  wrote:

OK. I got a working patch:

for i in range(0, iov.iov_len, 1):
   environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
iov[i+1].iov_len)

if not 'SERVER_NAME' in environ:
 environ['SERVER_NAME'] = uwsgi.hostname
if not 'SERVER_PORT' in environ:
  environ['SERVER_PORT'] = 80

It's ugly but it works! :-)

As a side-effect, i needed to add my hostname to ALLOWED_HOSTS.

Not really sure why SERVER_NAME and SERVER_PORT are not included in the
environ dict.

What do you think?

Etienne


Le 2018-02-09 à 06:40, Etienne Robillard a écrit :

Hi,

I confirm nginx is really sending the REQUEST_METHOD header with
nginx/uwsgi:

04:33:37.008721 read(6,
"\0\274\1\0\f\0QUERY_STRING\0\0\16\0REQUEST_METHOD\3\0GET\f\0CONTENT_TYPE\0\0\16\0CONTENT_LENGTH\0\0\v\0REQUEST_URI\v\0/benchmark/\t\0PATH_INFO\v\0/benchmark/\r\0DOCUMENT_ROOT!\0/home/erob/www/isotopesoftware.ca\17\0SERVER_PROTOCOL\10\0HTTP/1.1\v\0REMOTE_ADDR\t\000127.0.0.1\v\0REMOTE_PORT\5\00041286\v\0SERVER_PORT\2\00080\v\0SERVER_NAME\t\0localhost\v\0REMOTE_USER\0\0\v\0SCRIPT_NAME\0\0\7\0HTTP_TE\22\0deflate,gzip;q=0.3\17\0HTTP_CONNECTION\t\0TE,
close\t\0HTTP_HOST\t\0localhost\17\0HTTP_USER_AGENT!\0lwp-request/6.15
libwww-perl/6.15", 4100) = 448

So I tried to hack pypy_setup.py by using iov.iov_len as a replacement for
wsgi_req.var_cnt and here's the result:

  environ = {}
  iov = wsgi_req.hvec
  for i in range(0, iov.iov_len, 2):

 environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
iov[i+1].iov_len)

Now the traceback is somewhat different. Progress! :-)

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: PYTHONHOME=/usr

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

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:

Re: [uWSGI] PyPy issue

2018-02-12 Thread Etienne Robillard

Hi Kryzsztof,

Thank you for your kind reply. Yes, i'm running a 32-bit machine for 
development purpose.


My patch is working for my simple use-case but i believe it is far from 
being perfect.


However, i'm not exactly sure how to implement the proposed workaround.

Any chances this is going to be fixed in a future uWSGI release ?


Best regards,

Etienne

Le 2018-02-12 à 05:35, Krzysztof Warzecha a écrit :

I'm glad you got that working. That's a 32-bit system, isn't it? Looks
like you got bit by this bug:
https://github.com/unbit/uwsgi/issues/1129

On 9 February 2018 at 13:44, Etienne Robillard  wrote:

OK. I got a working patch:

for i in range(0, iov.iov_len, 1):
   environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
iov[i+1].iov_len)

if not 'SERVER_NAME' in environ:
 environ['SERVER_NAME'] = uwsgi.hostname
if not 'SERVER_PORT' in environ:
  environ['SERVER_PORT'] = 80

It's ugly but it works! :-)

As a side-effect, i needed to add my hostname to ALLOWED_HOSTS.

Not really sure why SERVER_NAME and SERVER_PORT are not included in the
environ dict.

What do you think?

Etienne


Le 2018-02-09 à 06:40, Etienne Robillard a écrit :

Hi,

I confirm nginx is really sending the REQUEST_METHOD header with
nginx/uwsgi:

04:33:37.008721 read(6,
"\0\274\1\0\f\0QUERY_STRING\0\0\16\0REQUEST_METHOD\3\0GET\f\0CONTENT_TYPE\0\0\16\0CONTENT_LENGTH\0\0\v\0REQUEST_URI\v\0/benchmark/\t\0PATH_INFO\v\0/benchmark/\r\0DOCUMENT_ROOT!\0/home/erob/www/isotopesoftware.ca\17\0SERVER_PROTOCOL\10\0HTTP/1.1\v\0REMOTE_ADDR\t\000127.0.0.1\v\0REMOTE_PORT\5\00041286\v\0SERVER_PORT\2\00080\v\0SERVER_NAME\t\0localhost\v\0REMOTE_USER\0\0\v\0SCRIPT_NAME\0\0\7\0HTTP_TE\22\0deflate,gzip;q=0.3\17\0HTTP_CONNECTION\t\0TE,
close\t\0HTTP_HOST\t\0localhost\17\0HTTP_USER_AGENT!\0lwp-request/6.15
libwww-perl/6.15", 4100) = 448

So I tried to hack pypy_setup.py by using iov.iov_len as a replacement for
wsgi_req.var_cnt and here's the result:

  environ = {}
  iov = wsgi_req.hvec
  for i in range(0, iov.iov_len, 2):

 environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
iov[i+1].iov_len)

Now the traceback is somewhat different. Progress! :-)

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: PYTHONHOME=/usr

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

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: 

Re: [uWSGI] PyPy issue

2018-02-12 Thread Krzysztof Warzecha
I'm glad you got that working. That's a 32-bit system, isn't it? Looks
like you got bit by this bug:
https://github.com/unbit/uwsgi/issues/1129

On 9 February 2018 at 13:44, Etienne Robillard  wrote:
> OK. I got a working patch:
>
> for i in range(0, iov.iov_len, 1):
>   environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
> iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
> iov[i+1].iov_len)
>
> if not 'SERVER_NAME' in environ:
> environ['SERVER_NAME'] = uwsgi.hostname
> if not 'SERVER_PORT' in environ:
>  environ['SERVER_PORT'] = 80
>
> It's ugly but it works! :-)
>
> As a side-effect, i needed to add my hostname to ALLOWED_HOSTS.
>
> Not really sure why SERVER_NAME and SERVER_PORT are not included in the
> environ dict.
>
> What do you think?
>
> Etienne
>
>
> Le 2018-02-09 à 06:40, Etienne Robillard a écrit :
>
> Hi,
>
> I confirm nginx is really sending the REQUEST_METHOD header with
> nginx/uwsgi:
>
> 04:33:37.008721 read(6,
> "\0\274\1\0\f\0QUERY_STRING\0\0\16\0REQUEST_METHOD\3\0GET\f\0CONTENT_TYPE\0\0\16\0CONTENT_LENGTH\0\0\v\0REQUEST_URI\v\0/benchmark/\t\0PATH_INFO\v\0/benchmark/\r\0DOCUMENT_ROOT!\0/home/erob/www/isotopesoftware.ca\17\0SERVER_PROTOCOL\10\0HTTP/1.1\v\0REMOTE_ADDR\t\000127.0.0.1\v\0REMOTE_PORT\5\00041286\v\0SERVER_PORT\2\00080\v\0SERVER_NAME\t\0localhost\v\0REMOTE_USER\0\0\v\0SCRIPT_NAME\0\0\7\0HTTP_TE\22\0deflate,gzip;q=0.3\17\0HTTP_CONNECTION\t\0TE,
> close\t\0HTTP_HOST\t\0localhost\17\0HTTP_USER_AGENT!\0lwp-request/6.15
> libwww-perl/6.15", 4100) = 448
>
> So I tried to hack pypy_setup.py by using iov.iov_len as a replacement for
> wsgi_req.var_cnt and here's the result:
>
>  environ = {}
>  iov = wsgi_req.hvec
>  for i in range(0, iov.iov_len, 2):
>
> environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
> iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
> iov[i+1].iov_len)
>
> Now the traceback is somewhat different. Progress! :-)
>
> 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: PYTHONHOME=/usr
>
> 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
>
> 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: 

Re: [uWSGI] PyPy issue

2018-02-09 Thread Etienne Robillard

OK. I got a working patch:

for i in range(0, iov.iov_len, 1):
  environ[ffi.string(ffi.cast("char*", iov[i].iov_base), 
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base), 
iov[i+1].iov_len)


if not 'SERVER_NAME' in environ:
    environ['SERVER_NAME'] = uwsgi.hostname
if not 'SERVER_PORT' in environ:
 environ['SERVER_PORT'] = 80

It's ugly but it works! :-)

As a side-effect, i needed to add my hostname to ALLOWED_HOSTS.

Not really sure why SERVER_NAME and SERVER_PORT are not included in the 
environ dict.


What do you think?

Etienne

Le 2018-02-09 à 06:40, Etienne Robillard a écrit :


Hi,

I confirm nginx is really sending the REQUEST_METHOD header with 
nginx/uwsgi:


04:33:37.008721 read(6, 
"\0\274\1\0\f\0QUERY_STRING\0\0\16\0REQUEST_METHOD\3\0GET\f\0CONTENT_TYPE\0\0\16\0CONTENT_LENGTH\0\0\v\0REQUEST_URI\v\0/benchmark/\t\0PATH_INFO\v\0/benchmark/\r\0DOCUMENT_ROOT!\0/home/erob/www/isotopesoftware.ca\17\0SERVER_PROTOCOL\10\0HTTP/1.1\v\0REMOTE_ADDR\t\000127.0.0.1\v\0REMOTE_PORT\5\00041286\v\0SERVER_PORT\2\00080\v\0SERVER_NAME\t\0localhost\v\0REMOTE_USER\0\0\v\0SCRIPT_NAME\0\0\7\0HTTP_TE\22\0deflate,gzip;q=0.3\17\0HTTP_CONNECTION\t\0TE,
 close\t\0HTTP_HOST\t\0localhost\17\0HTTP_USER_AGENT!\0lwp-request/6.15 
libwww-perl/6.15", 4100) = 448

So I tried to hack pypy_setup.py by using iov.iov_len as a replacement for 
wsgi_req.var_cnt and here's the result:
   
  environ = {}

  iov = wsgi_req.hvec
  for i in range(0, iov.iov_len, 2):

     environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
iov[i+1].iov_len)

Now the traceback is somewhat different. Progress! :-)

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: PYTHONHOME=/usr

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

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: 

Re: [uWSGI] PyPy issue

2018-02-09 Thread Etienne Robillard

Hi,

I confirm nginx is really sending the REQUEST_METHOD header with 
nginx/uwsgi:


04:33:37.008721 read(6, 
"\0\274\1\0\f\0QUERY_STRING\0\0\16\0REQUEST_METHOD\3\0GET\f\0CONTENT_TYPE\0\0\16\0CONTENT_LENGTH\0\0\v\0REQUEST_URI\v\0/benchmark/\t\0PATH_INFO\v\0/benchmark/\r\0DOCUMENT_ROOT!\0/home/erob/www/isotopesoftware.ca\17\0SERVER_PROTOCOL\10\0HTTP/1.1\v\0REMOTE_ADDR\t\000127.0.0.1\v\0REMOTE_PORT\5\00041286\v\0SERVER_PORT\2\00080\v\0SERVER_NAME\t\0localhost\v\0REMOTE_USER\0\0\v\0SCRIPT_NAME\0\0\7\0HTTP_TE\22\0deflate,gzip;q=0.3\17\0HTTP_CONNECTION\t\0TE,
 close\t\0HTTP_HOST\t\0localhost\17\0HTTP_USER_AGENT!\0lwp-request/6.15 
libwww-perl/6.15", 4100) = 448

So I tried to hack pypy_setup.py by using iov.iov_len as a replacement for 
wsgi_req.var_cnt and here's the result:
  
 environ = {}

 iov = wsgi_req.hvec
 for i in range(0, iov.iov_len, 2):

    environ[ffi.string(ffi.cast("char*", iov[i].iov_base),
iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base),
iov[i+1].iov_len)

Now the traceback is somewhat different. Progress! :-)

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: PYTHONHOME=/usr

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

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 = 2917

[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

optind:3 argc:3

[uwsgi-cheaper-algo] registered "spare"

[uwsgi-cheaper-algo] 

Re: [uWSGI] PyPy issue

2018-02-09 Thread Krzysztof Warzecha
Hello,

On 9 February 2018 at 11:29, Etienne Robillard  wrote:
> Hi Krzysztof,
>
> I found something highly relevant to my issue:
> http://lists.unbit.it/pipermail/uwsgi/2014-June/007389.html
>
> So I followed Roberto's suggestion and removed my __pycache__ dir but the
> issue is persisting.
>
> What do you think? Should i attempt to patch pypy_setup.py ?

Yes, this looks like sensible next step.

But just to be sure, before you do that, confirm that your nginx is
correctly sending REQUEST_METHOD header to 127.0.0.1:8000.

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


Re: [uWSGI] PyPy issue

2018-02-09 Thread Etienne Robillard

Hi Krzysztof,

I found something highly relevant to my issue: 
http://lists.unbit.it/pipermail/uwsgi/2014-June/007389.html


So I followed Roberto's suggestion and removed my __pycache__ dir but 
the issue is persisting.


What do you think? Should i attempt to patch pypy_setup.py ?



Etienne


Le 2018-02-08 à 17:21, Krzysztof Warzecha a écrit :

OK then. I have few more debugging tips, but no solution yet. Let's
see what nginx is sending to uwsgi. Please configure uwsgi with:

[uwsgi]
socket=127.0.0.1:8000

And please use strace (strace -p $PID -p $PID_2 ... -p $PID_N -vvfftt
-o /tmp/strace -s 5000) or tcpdump to confirm if nginx is or is not
sending the REQUEST_METHOD header.

For the record, this is how the code for populating wsgi environ looks like:

https://github.com/unbit/uwsgi/blob/2.0.15/plugins/pypy/pypy_setup.py#L451-L472


Could you confirm that it works if you replace socket=... with
http-socket=... in the uwsgi config and uwsgi_pass with proxy_pass
(with appropriate include ...) in the nginx conf?


If you configure your uwsgi with cpython instead of pypy, does it work
with similar configuration?



--
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


Re: [uWSGI] PyPy issue

2018-02-08 Thread Krzysztof Warzecha
OK then. I have few more debugging tips, but no solution yet. Let's
see what nginx is sending to uwsgi. Please configure uwsgi with:

[uwsgi]
socket=127.0.0.1:8000

And please use strace (strace -p $PID -p $PID_2 ... -p $PID_N -vvfftt
-o /tmp/strace -s 5000) or tcpdump to confirm if nginx is or is not
sending the REQUEST_METHOD header.

For the record, this is how the code for populating wsgi environ looks like:

https://github.com/unbit/uwsgi/blob/2.0.15/plugins/pypy/pypy_setup.py#L451-L472


Could you confirm that it works if you replace socket=... with
http-socket=... in the uwsgi config and uwsgi_pass with proxy_pass
(with appropriate include ...) in the nginx conf?


If you configure your uwsgi with cpython instead of pypy, does it work
with similar configuration?

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


Re: [uWSGI] PyPy issue

2018-02-08 Thread Etienne Robillard

Hi Krzysztof,


Le 2018-02-08 à 15:28, Krzysztof Warzecha a écrit :

Hello,


[uwsgi]
...
socket=127.0.0.1:8000

Is there any web server in the front of the uwsgi? If this is nginx,
are you sure you are using "uwsgi_pass" instead of, for example,
"proxy_pass"?

Yes. I configured nginx like this:

 location / {
    include uwsgi_params;
        uwsgi_pass 127.0.0.1:8000;
    }

/etc/nginx/uwsgi_params:

uwsgi_param  QUERY_STRING   $query_string;
uwsgi_param  REQUEST_METHOD $request_method;
uwsgi_param  CONTENT_TYPE   $content_type;
uwsgi_param  CONTENT_LENGTH $content_length;

uwsgi_param  REQUEST_URI    $request_uri;
uwsgi_param  PATH_INFO  $document_uri;
uwsgi_param  DOCUMENT_ROOT  $document_root;
uwsgi_param  SERVER_PROTOCOL    $server_protocol;
uwsgi_param  HTTPS  $https if_not_empty;

uwsgi_param  REMOTE_ADDR    $remote_addr;
uwsgi_param  REMOTE_PORT    $remote_port;
uwsgi_param  SERVER_PORT    $server_port;
uwsgi_param  SERVER_NAME    $server_name;
uwsgi_param  REMOTE_USER    $remote_user;
uwsgi_param  SCRIPT_NAME    "";

uwsgi_cache_valid 200 302 10m;



Could you replace socket= with http-socket= and query it with curl, like that?

curl -v http://127.0.0.1:8000/benchmark

Thats interesting. When using the http-socket param, i get the following 
messages:


add uwsgi var: REQUEST_METHOD = GET
add uwsgi var: REQUEST_URI = /benchmark/
add uwsgi var: PATH_INFO = /benchmark/
add uwsgi var: QUERY_STRING =
add uwsgi var: SERVER_PROTOCOL = HTTP/1.1
add uwsgi var: SCRIPT_NAME =
add uwsgi var: SERVER_NAME = marina
add uwsgi var: SERVER_PORT = 8000
add uwsgi var: REMOTE_ADDR = 127.0.0.1

I suspect uWSGI doesn't properly pick up magic nginx variables when 
using PyPy.


Etienne

--
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


Re: [uWSGI] PyPy issue

2018-02-08 Thread Krzysztof Warzecha
Hello,

> [uwsgi]
> ...
> socket=127.0.0.1:8000

Is there any web server in the front of the uwsgi? If this is nginx,
are you sure you are using "uwsgi_pass" instead of, for example,
"proxy_pass"?


Could you replace socket= with http-socket= and query it with curl, like that?

curl -v http://127.0.0.1:8000/benchmark

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


Re: [uWSGI] PyPy issue

2018-02-08 Thread Etienne Robillard

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() 

[uWSGI] PyPy issue

2018-02-08 Thread Etienne Robillard

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 :
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