[pypy-issue] Issue #2415: uwsgi_pypy_wsgi_handler TypeError: 'NoneType' object is not callable / pypy + uwsgi + django + nginx (pypy/pypy)

Guido issues-reply at bitbucket.org
Wed Oct 12 15:48:23 EDT 2016


New issue 2415: uwsgi_pypy_wsgi_handler TypeError: 'NoneType' object is not callable / pypy + uwsgi + django + nginx
https://bitbucket.org/pypy/pypy/issues/2415/uwsgi_pypy_wsgi_handler-typeerror-nonetype

Guido:

Hi guy, i bulid a virtualenv from https://bitbucket.org/pypy/pypy/downloads/pypy3.3-v5.5.0-alpha-linux64.tar.bz2
binary on ubuntu Ubuntu 14.04.5 LTS
 
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty
 
(virtenvPyPy) qp at QPwebNginx218:~/virtenvPyPy$ pypy -V
Python 2.7.10 (c95650101a99, Sep 06 2016, 11:10:29)
[PyPy 5.4.1 with GCC 4.8.2]
 
(virtenvPyPy) qp at QPwebNginx218:~/virtenvPyPy$ pip list
attrs (16.2.0)
braintree (3.27.0)
cffi (1.8.1)
cryptography (1.4)
cssselect (0.9.2)
Django (1.9.7)
django-countries (3.4.1)
django-debug-toolbar (1.5)
django-ipware (1.1.5)
django-localflavor (1.3)
django-modeltranslation (0.11)
django-multiupload (0.5.1)
django-payments (0.9.4)
django-wkhtmltopdf (3.0.0)
enum34 (1.1.6)
greenlet (0.4.10)
idna (2.1)
ipaddress (1.0.16)
lxml (3.6.4)
MySQL-python (1.2.5)
ndg-httpsclient (0.4.1)
parsel (1.0.3)
Pillow (3.2.0)
pip (8.1.2)
pyasn1 (0.1.9)
pyasn1-modules (0.0.8)
pycparser (2.14)
PyDispatcher (2.0.5)
PyJWT (1.4.0)
pyOpenSSL (16.0.0)
queuelib (1.4.2)
readline (6.2.4.1)
requests (2.10.0)
Scrapy (1.1.3)
scrapy-djangoitem (1.1.1)
service-identity (16.0.0)
setuptools (28.3.0)
six (1.10.0)
sqlparse (0.2.1)
stripe (1.35.0)
suds-jurko (0.6)
Twisted (16.4.1)
uWSGI (2.0.13.1)
w3lib (1.15.0)
wheel (0.30.0a0)
wkhtmltopdf (0.2)
xmltodict (0.10.2)
zope.interface (4.3.2)
 
(virtenvPyPy) qpshop2016 at QPwebNginx218:~/virtenvPyPy/calcshop$ uwsgi --ini qp_uwsgi.ini
[uWSGI] getting INI configuration from qp_uwsgi.ini
*** Starting uWSGI 2.0.13.1 (64bit) on [Wed Oct 12 19:37:52 2016] ***
compiled with version: 4.8.4 on 12 October 2016 16:17:00
os: Linux-3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016
nodename: QPwebNginx218
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /var/www/virtenvPyPy/calcshop
detected binary path: /var/www/virtenvPyPy/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /var/www/virtenvPyPy/calcshop/
your processes number limit is 63713
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /var/www/virtenvPyPy/qpshop2016.sock fd 3
Initialized PyPy with Python 2.7.10 (c95650101a99, Sep 06 2016, 11:10:29)
[PyPy 5.4.1 with GCC 4.8.2]
PyPy Home: /var/www/virtenvPyPy
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 800448 bytes (781 KB) for 10 cores
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 10828)
spawned uWSGI worker 1 (pid: 10829, cores: 1)
spawned uWSGI worker 2 (pid: 10830, cores: 1)
spawned uWSGI worker 3 (pid: 10831, cores: 1)
spawned uWSGI worker 4 (pid: 10832, cores: 1)
spawned uWSGI worker 5 (pid: 10833, cores: 1)
spawned uWSGI worker 6 (pid: 10834, cores: 1)
spawned uWSGI worker 7 (pid: 10835, cores: 1)
spawned uWSGI worker 8 (pid: 10836, cores: 1)
spawned uWSGI worker 9 (pid: 10837, cores: 1)
spawned uWSGI worker 10 (pid: 10838, cores: 1)
 
 
If i try to go trough NGINX than i get following error:
---------------------------
[pid: 10829|app: -1|req: -1/3] 127.16.200.11 () {46 vars in 1103 bytes} [Wed Oct 12 19:39:41 2016] GET / => generated 0 bytes in 1 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
>From cffi callback <function uwsgi_pypy_wsgi_handler at 0x00007f8579a87b50>:
Traceback (most recent call last):
  File "c callback", line 472, in uwsgi_pypy_wsgi_handler
TypeError: 'NoneType' object is not callable
[pid: 10835|app: -1|req: -1/4] 127.16.200.11 () {48 vars in 1086 bytes} [Wed Oct 12 19:39:41 2016] GET /favicon.ico => generated 0 bytes in 7 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
 
 
my qp_uwsgi.ini looks like:
---------------------------
# mysite_uwsgi.ini file
[uwsgi]
 
# Django-related settings
# the base directory (full path)
chdir           = /var/www/virtenvPyPy/calcshop/
# Django's wsgi file
module          = calcshop.wsgi
# the virtualenv (full path)
home            = /var/www/virtenvPyPy
 
# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 10
# the socket (use the full path to be safe
socket          = /var/www/virtenvPyPy/qp.sock
# ... with appropriate permissions - may be needed
chmod-socket    = 664
# clear environment on exit
vacuum          = true





More information about the pypy-issue mailing list