Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing uwsgi #60

Closed
Resinderate opened this issue May 12, 2022 · 2 comments
Closed

Error installing uwsgi #60

Resinderate opened this issue May 12, 2022 · 2 comments

Comments

@Resinderate
Copy link

Thanks for all the great work so far!

Was interested in testing this out with a webapp I work on that uses uwsgi, but looks like it runs into an error when installing the latest version. Should this work?

Minimal reproduction with docker build .:

# Dockerfile
FROM nogil/python
RUN pip install uwsgi==2.0.20

Error:

#5 12.94     plugins/python/profiler.c: In function ‘uwsgi_python_profiler_call’:
#5 12.94     plugins/python/profiler.c:40:91: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_stacksize’; did you mean ‘co_framesize’?
#5 12.94        40 |     PyString_AsString(frame->f_code->co_name), frame->f_code->co_argcount, frame->f_code->co_stacksize);
#5 12.94           |                                                                                           ^~~~~~~~~~~~
#5 12.94           |                                                                                           co_framesize
#5 12.94     plugins/python/profiler.c:50:73: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_stacksize’; did you mean ‘co_framesize’?
#5 12.94        50 |     PyEval_GetFuncName(arg), frame->f_code->co_argcount, frame->f_code->co_stacksize);
#5 12.94           |                                                                         ^~~~~~~~~~~~
#5 12.94           |                                                                         co_framesize
#5 12.94     ----------------------------------------
Full error
λ docker build --file Dockerfile2 .
[+] Building 13.7s (5/5) FINISHED
 => [internal] load build definition from Dockerfile2                                                          0.0s
 => => transferring dockerfile: 92B                                                                            0.0s
 => [internal] load .dockerignore                                                                              0.0s
 => => transferring context: 35B                                                                               0.0s
 => [internal] load metadata for docker.io/nogil/python:latest                                                 0.0s
 => CACHED [1/2] FROM docker.io/nogil/python                                                                   0.0s
 => ERROR [2/2] RUN pip install uwsgi==2.0.20                                                                 13.6s
------
 > [2/2] RUN pip install uwsgi==2.0.20:
#5 2.207 Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
#5 2.740 Collecting uwsgi==2.0.20
#5 2.888   Downloading uwsgi-2.0.20.tar.gz (804 kB)
#5 3.253   Preparing metadata (setup.py): started
#5 3.783   Preparing metadata (setup.py): finished with status 'done'
#5 3.785 Using legacy 'setup.py install' for uwsgi, since package 'wheel' is not installed.
#5 3.845 Installing collected packages: uwsgi
#5 3.847     Running setup.py install for uwsgi: started
#5 12.94     Running setup.py install for uwsgi: finished with status 'error'
#5 12.94     ERROR: Command errored out with exit status 1:
#5 12.94      command: /usr/local/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z3opkux3/uwsgi_7056e9a5299e4dd49f5d9bf0d7f1272d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z3opkux3/uwsgi_7056e9a5299e4dd49f5d9bf0d7f1272d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-i681v31u/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/uwsgi
#5 12.94          cwd: /tmp/pip-install-z3opkux3/uwsgi_7056e9a5299e4dd49f5d9bf0d7f1272d/
#5 12.94     Complete output (108 lines):
#5 12.94     /usr/local/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'descriptions'
#5 12.94       warnings.warn(msg)
#5 12.94     running install
#5 12.94     using profile: buildconf/default.ini
#5 12.94     detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/10/include', '/usr/local/include', '/usr/include/x86_64-linux-gnu', '/usr/include']
#5 12.94     Patching "bin_name" to properly install_scripts dir
#5 12.94     detected CPU cores: 4
#5 12.94     configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY  -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_UUID -DUWSGI_VERSION="\"2.0.20\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="20" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -I/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(ugreen);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(ugreen);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
#5 12.94     *** uWSGI compiling server core ***
#5 12.94     [thread 2][gcc -pthread] core/utils.o
#5 12.94     [thread 1][gcc -pthread] core/protocol.o
#5 12.94     [thread 3][gcc -pthread] core/socket.o
#5 12.94     [thread 0][gcc -pthread] core/logging.o
#5 12.94     [thread 1][gcc -pthread] core/master.o
#5 12.94     [thread 0][gcc -pthread] core/master_utils.o
#5 12.94     [thread 3][gcc -pthread] core/emperor.o
#5 12.94     [thread 1][gcc -pthread] core/notify.o
#5 12.94     [thread 1][gcc -pthread] core/mule.o
#5 12.94     [thread 2][gcc -pthread] core/subscription.o
#5 12.94     [thread 0][gcc -pthread] core/stats.o
#5 12.94     [thread 1][gcc -pthread] core/sendfile.o
#5 12.94     [thread 3][gcc -pthread] core/async.o
#5 12.94     [thread 1][gcc -pthread] core/master_checks.o
#5 12.94     [thread 0][gcc -pthread] core/fifo.o
#5 12.94     [thread 2][gcc -pthread] core/offload.o
#5 12.94     [thread 3][gcc -pthread] core/io.o
#5 12.94     [thread 0][gcc -pthread] core/static.o
#5 12.94     [thread 1][gcc -pthread] core/websockets.o
#5 12.94     [thread 2][gcc -pthread] core/spooler.o
#5 12.94     [thread 0][gcc -pthread] core/snmp.o
#5 12.94     [thread 1][gcc -pthread] core/exceptions.o
#5 12.94     [thread 3][gcc -pthread] core/config.o
#5 12.94     [thread 2][gcc -pthread] core/setup_utils.o
#5 12.94     [thread 0][gcc -pthread] core/clock.o
#5 12.94     [thread 1][gcc -pthread] core/init.o
#5 12.94     [thread 2][gcc -pthread] core/buffer.o
#5 12.94     [thread 0][gcc -pthread] core/reader.o
#5 12.94     [thread 3][gcc -pthread] core/writer.o
#5 12.94     [thread 1][gcc -pthread] core/alarm.o
#5 12.94     [thread 2][gcc -pthread] core/cron.o
#5 12.94     [thread 0][gcc -pthread] core/hooks.o
#5 12.94     [thread 1][gcc -pthread] core/plugins.o
#5 12.94     [thread 2][gcc -pthread] core/lock.o
#5 12.94     [thread 3][gcc -pthread] core/cache.o
#5 12.94     [thread 1][gcc -pthread] core/daemons.o
#5 12.94     [thread 0][gcc -pthread] core/errors.o
#5 12.94     [thread 2][gcc -pthread] core/hash.o
#5 12.94     [thread 0][gcc -pthread] core/master_events.o
#5 12.94     [thread 2][gcc -pthread] core/chunked.o
#5 12.94     [thread 1][gcc -pthread] core/queue.o
#5 12.94     [thread 0][gcc -pthread] core/event.o
#5 12.94     [thread 2][gcc -pthread] core/signal.o
#5 12.94     [thread 1][gcc -pthread] core/strings.o
#5 12.94     [thread 3][gcc -pthread] core/progress.o
#5 12.94     [thread 3][gcc -pthread] core/timebomb.o
#5 12.94     [thread 0][gcc -pthread] core/ini.o
#5 12.94     [thread 2][gcc -pthread] core/fsmon.o
#5 12.94     [thread 1][gcc -pthread] core/mount.o
#5 12.94     [thread 3][gcc -pthread] core/metrics.o
#5 12.94     [thread 0][gcc -pthread] core/plugins_builder.o
#5 12.94     [thread 2][gcc -pthread] core/sharedarea.o
#5 12.94     [thread 1][gcc -pthread] core/rpc.o
#5 12.94     [thread 0][gcc -pthread] core/gateway.o
#5 12.94     [thread 1][gcc -pthread] core/loop.o
#5 12.94     [thread 2][gcc -pthread] core/cookie.o
#5 12.94     [thread 0][gcc -pthread] core/querystring.o
#5 12.94     [thread 3][gcc -pthread] core/rb_timers.o
#5 12.94     [thread 1][gcc -pthread] core/transformations.o
#5 12.94     [thread 2][gcc -pthread] core/uwsgi.o
#5 12.94     [thread 0][gcc -pthread] proto/base.o
#5 12.94     [thread 3][gcc -pthread] proto/uwsgi.o
#5 12.94     [thread 1][gcc -pthread] proto/http.o
#5 12.94     [thread 0][gcc -pthread] proto/fastcgi.o
#5 12.94     [thread 3][gcc -pthread] proto/scgi.o
#5 12.94     [thread 3][gcc -pthread] proto/puwsgi.o
#5 12.94     [thread 1][gcc -pthread] lib/linux_ns.o
#5 12.94     [thread 0][gcc -pthread] core/zlib.o
#5 12.94     [thread 3][gcc -pthread] core/regexp.o
#5 12.94     [thread 0][gcc -pthread] core/routing.o
#5 12.94     [thread 1][gcc -pthread] core/yaml.o
#5 12.94     [thread 3][gcc -pthread] core/ssl.o
#5 12.94     [thread 1][gcc -pthread] core/legion.o
#5 12.94     [thread 3][gcc -pthread] core/xmlconf.o
#5 12.94     [thread 2][gcc -pthread] core/dot_h.o
#5 12.94     [thread 2][gcc -pthread] core/config_py.o
#5 12.94     *** uWSGI compiling embedded plugins ***
#5 12.94     [thread 2][gcc -pthread] plugins/python/python_plugin.o
#5 12.94     [thread 3][gcc -pthread] plugins/python/pyutils.o
#5 12.94     [thread 0][gcc -pthread] plugins/python/pyloader.o
#5 12.94     [thread 1][gcc -pthread] plugins/python/wsgi_handlers.o
#5 12.94     [thread 3][gcc -pthread] plugins/python/wsgi_headers.o
#5 12.94     [thread 1][gcc -pthread] plugins/python/wsgi_subhandler.o
#5 12.94     [thread 0][gcc -pthread] plugins/python/web3_subhandler.o
#5 12.94     [thread 2][gcc -pthread] plugins/python/pump_subhandler.o
#5 12.94     [thread 3][gcc -pthread] plugins/python/gil.o
#5 12.94     [thread 3][gcc -pthread] plugins/python/uwsgi_pymodule.o
#5 12.94     [thread 1][gcc -pthread] plugins/python/profiler.o
#5 12.94     [thread 0][gcc -pthread] plugins/python/symimporter.o
#5 12.94     [thread 2][gcc -pthread] plugins/python/tracebacker.o
#5 12.94     plugins/python/profiler.c: In function ‘uwsgi_python_profiler_call’:
#5 12.94     plugins/python/profiler.c:40:91: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_stacksize’; did you mean ‘co_framesize’?
#5 12.94        40 |     PyString_AsString(frame->f_code->co_name), frame->f_code->co_argcount, frame->f_code->co_stacksize);
#5 12.94           |                                                                                           ^~~~~~~~~~~~
#5 12.94           |                                                                                           co_framesize
#5 12.94     plugins/python/profiler.c:50:73: error: ‘PyCodeObject’ {aka ‘struct PyCodeObject’} has no member named ‘co_stacksize’; did you mean ‘co_framesize’?
#5 12.94        50 |     PyEval_GetFuncName(arg), frame->f_code->co_argcount, frame->f_code->co_stacksize);
#5 12.94           |                                                                         ^~~~~~~~~~~~
#5 12.94           |                                                                         co_framesize
#5 12.94     ----------------------------------------
#5 12.94 ERROR: Command errored out with exit status 1: /usr/local/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z3opkux3/uwsgi_7056e9a5299e4dd49f5d9bf0d7f1272d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z3opkux3/uwsgi_7056e9a5299e4dd49f5d9bf0d7f1272d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-i681v31u/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/uwsgi Check the logs for full command output.
------
executor failed running [/bin/sh -c pip install uwsgi==2.0.20]: exit code: 1
@colesbury
Copy link
Owner

Thanks for the bug report. I have a fix for the co_stacksize issue, but I'm not sure uwsgi will be thread-safe without the GIL. That will take a bit more time to investigate.

@colesbury
Copy link
Owner

I've fixed the issues and updated the Docker image. You may need to run docker pull nogil/python to get the latest image.

Alll of the uwsgi smoke tests pass, but uwsgi is complex and I'm not very familiar with the code so there may be lurking thread-safety issues. Please let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants