Closed sandre35 closed 6 months ago
Thanks for reporting, what do you have in static_path
, just static?
@xrmx Yes, the content of static_path
variable is static
Do you have any pcre
related log when starting uwsgi?
Here is the log when lauching UWSGI. I find the mapping for static path. There is one line with pcre : pcre jit disabled
[uwsgi-static] added mapping for /static => /tmp/tmppruzuo8y/app.venv/lib/python3.10/site-packages/bluedj/staticassets
;uWSGI instance configuration
[uwsgi]
ini = /tmp/tmp1md5ahs9/root-fs/home/sys.cfg/uwsgi.ini
ini = :env
env = SHELL=/bin/bash
env = SESSION_MANAGER=local/sandre35-ThinkPad-T490s:@/tmp/.ICE-unix/5438,unix/sandre35-ThinkPad-T490s:/tmp/.ICE-unix/5438
env = QT_ACCESSIBILITY=1
env = COLORTERM=truecolor
env = XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
env = SSH_AGENT_LAUNCHER=gnome-keyring
env = NVM_INC=/home/sandre35/.nvm/versions/node/v11.15.0/include/node
env = XDG_MENU_PREFIX=gnome-
env = TERM_PROGRAM_VERSION=1.88.1
env = GNOME_DESKTOP_SESSION_ID=this-is-deprecated
env = PGPORT=5432
env = GNOME_SHELL_SESSION_MODE=ubuntu
env = SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
env = XMODIFIERS=@im=ibus
env = DESKTOP_SESSION=ubuntu
env = GTK_MODULES=gail:atk-bridge
env = PWD=/home/sandre35/dev_repo/grocker-bluedjango
env = XDG_SESSION_DESKTOP=ubuntu
env = LOGNAME=sandre35
env = XDG_SESSION_TYPE=wayland
env = SYSTEMD_EXEC_PID=5461
env = XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.GQZHM2
env = VSCODE_GIT_ASKPASS_NODE=/usr/share/code/code
env = IM_CONFIG_CHECK_ENV=1
env = GJS_DEBUG_TOPICS=JS ERROR;JS LOG
env = VIRTUALENVWRAPPER_SCRIPT=/usr/share/virtualenvwrapper/virtualenvwrapper.sh
env = HOME=/home/sandre35
env = USERNAME=sandre35
env = IM_CONFIG_PHASE=1
env = LANG=fr_FR.UTF-8
env = 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:*.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:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=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:*.webp=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:
env = _VIRTUALENVWRAPPER_API= mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv wipeenv allvirtualenv mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv wipeenv allvirtualenv
env = XDG_CURRENT_DESKTOP=Unity
env = VIRTUAL_ENV=/home/sandre35/.virtualenvs/grocker-bluedjango
env = WAYLAND_DISPLAY=wayland-0
env = VIRTUALENVWRAPPER_WORKON_CD=1
env = TMPDIR=/tmp
env = GIT_ASKPASS=/usr/share/code/resources/app/extensions/git/dist/askpass.sh
env = PGUSER=postgres
env = INVOCATION_ID=b2b58f92fec943f0ac2ff23c972c3976
env = MANAGERPID=5295
env = CHROME_DESKTOP=code-url-handler.desktop
env = GJS_DEBUG_OUTPUT=stderr
env = NVM_DIR=/home/sandre35/.nvm
env = VSCODE_GIT_ASKPASS_EXTRA_ARGS=
env = WORKON_HOME=/home/sandre35/.virtualenvs
env = GNOME_SETUP_DISPLAY=:1
env = LESSCLOSE=/usr/bin/lesspipe uwsgi.ini uwsgi.ini
env = XDG_SESSION_CLASS=user
env = TERM=xterm-256color
env = LESSOPEN=| /usr/bin/lesspipe uwsgi.ini
env = USER=sandre35
env = VSCODE_GIT_IPC_HANDLE=/run/user/1000/vscode-git-497b2790a4.sock
env = VIRTUALENVWRAPPER_PROJECT_FILENAME=.project
env = DISPLAY=:0
env = SHLVL=1
env = NVM_CD_FLAGS=
env = QT_IM_MODULE=ibus
env = VIRTUAL_ENV_PROMPT=(grocker-bluedjango)
env = XDG_RUNTIME_DIR=/run/user/1000
env = PS1=\[\](grocker-bluedjango) \[\]\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ \[\]\[\]
env = PGHOST=localhost
env = VSCODE_GIT_ASKPASS_MAIN=/usr/share/code/resources/app/extensions/git/dist/askpass-main.js
env = JOURNAL_STREAM=8:42152
env = XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
env = GDK_BACKEND=x11
env = PATH=/tmp/tmppruzuo8y/app.venv/bin:/home/sandre35/.virtualenvs/grocker-bluedjango/bin:/home/sandre35/.npm-packages/bin:/home/sandre35/.local/bin:/home/sandre35/bin:/home/sandre35/.npm-packages/bin:/home/sandre35/.nvm/versions/node/v11.15.0/bin:/home/sandre35/.local/bin:/home/sandre35/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/sandre35/bin:/home/sandre35/bin
env = VIRTUALENVWRAPPER_HOOK_DIR=/home/sandre35/.virtualenvs
env = GDMSESSION=ubuntu
env = ORIGINAL_XDG_CURRENT_DESKTOP=ubuntu:GNOME
env = DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
env = NVM_BIN=/home/sandre35/.nvm/versions/node/v11.15.0/bin
env = GIO_LAUNCHED_DESKTOP_FILE_PID=30107
env = GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/code.desktop
env = TERM_PROGRAM=vscode
env = _=/home/sandre35/.virtualenvs/grocker-bluedjango/bin/python
env = DJANGO_SETTINGS_MODULE=bluedj.settings
env = BLUEDJ_ENVIRONMENT=prod
env = BLUEDJ_DJANGO_SECRET_KEY=mocked
env = BLUEDJ_DB_HOST=localhost
env = BLUEDJ_DB_PORT=5432
env = BLUEDJ_DB_NAME=grocker-bluedjango
env = BLUEDJ_DB_USER=grocker-bluedjango
env = BLUEDJ_S3_BUCKET_NAME=grocker-bluedjango
env = BLUEDJ_S3_ENDPOINT_URL=http://127.0.0.1:8282
env = BLUEDJ_S3_ACCESS_KEY=accessKey1
env = BLUEDJ_S3_SECRET_KEY=verySecretKey1
env = BLUEDJ_SERVICES_URLS_FILE=/home/sandre35/.virtualenvs/grocker-bluedjango/lib/python3.10/site-packages/libservices/dev_urls.yml
env = GROCKER_APP=bluedj
env = GROCKER_HOME=/tmp/tmp1md5ahs9/root-fs/home
env = GROCKER_FS_ROOT=/tmp/tmp1md5ahs9/root-fs
env = BLUEDJ_LOGGING_FORCE_CONSOLE=1
env = BLUEDJANGO_UWSGI_HTTP_SOCKET=127.0.0.1:33287
env = BLUEDJANGO_UWSGI_STATS=127.0.0.1:60875
env = BLUEDJANGO_UWSGI_APP_MODULE=django.core.wsgi:get_wsgi_application
env = BLUEDJANGO_SYSLOG_HOST=
env = BLUEDJANGO_WARMUP_URL=/selftest/ping/
env = BLUEDJANGO_METRICS_ENABLED=false
env = BLUEDJ_CONFIG=ini:///tmp/tmp1md5ahs9/root-fs/config/app/*.ini
env = BLUEDJ_PROMETHEUS_METRICS_DIR=/tmp/tmp1md5ahs9/root-fs/tmp/prometheus_metrics
env = BLUEDJ_SERVICE=ops
ini = :app
chdir = /tmp/tmp1md5ahs9/root-fs/home
py-programname = /tmp/tmppruzuo8y/app.venv/bin/python3.10
need-app = true
module = bluedjango.wsgi_prefork:get_wsgi_application()
ini = :master
master = true
die-on-term = true
pidfile = /tmp/tmp1md5ahs9/root-fs/home/uwsgi.pid
post-buffering = true
single-interpreter = true
ini = :performances
tcp-nodelay = true
http-keepalive = 65
http-auto-gzip = true
ini = :log
show-config = true
log-x-forwarded-for = true
backtrace-depth = 64
log-ioerror = false
py-tracebacker = /tmp/tbsocket
ini = :authentication
route-if-not = empty:${HTTP_X_REMOTE_USER} setuser:${HTTP_X_REMOTE_USER}
ini = :https
route-if-not = empty:${HTTP_X_FORWARDED_PROTO} setscheme:${HTTP_X_FORWARDED_PROTO}
ini = :statics
static-expires-uri = /static/* 315360000
static-map = /static=/tmp/tmppruzuo8y/app.venv/lib/python3.10/site-packages/bluedj/staticassets
offload-threads = 4
ini = :tuning
http-socket = 127.0.0.1:33287
stats = 127.0.0.1:60875
workers = 10
buffer-size = 8192
harakiri = 60
max-requests = 5000
reload-on-as = 1024
reload-on-rss = 400
static-path = static
ini = :stats
stats-http = true
enable-metrics = true
;end of configuration
*** Starting uWSGI 2.0.24 (64bit) on [Fri Apr 26 10:45:57 2024] ***
compiled with version: 11.4.0 on 09 February 2024 15:50:33
os: Linux-6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2
nodename: sandre35-ThinkPad-T490s
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /home/sandre35/dev_repo/grocker-bluedjango
writing pidfile to /tmp/tmp1md5ahs9/root-fs/home/uwsgi.pid
detected binary path: /tmp/tmppruzuo8y/app.venv/bin/uwsgi
*** dumping internal routing table ***
[rule: 0] subject: ${HTTP_X_REMOTE_USER} func: !empty action: setuser:${HTTP_X_REMOTE_USER}
[rule: 1] subject: ${HTTP_X_FORWARDED_PROTO} func: !empty action: setscheme:${HTTP_X_FORWARDED_PROTO}
*** end of the internal routing table ***
chdir() to /tmp/tmp1md5ahs9/root-fs/home
your processes number limit is 126421
your memory page size is 4096 bytes
*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 8192
building mime-types dictionary from file /etc/mime.types...1516 entry found
lock engine: pthread robust mutexes
Seems like pcre2_match()
with no match_data
structure does not work. The following patch seems to fix the issue, I'll submit a PR later. Please note that /{{static_path}}/*
should be a regexp, maybe you mean ^/{{static_path}}/
.
--- a/core/regexp.c
+++ b/core/regexp.c
@@ -69,7 +69,7 @@ int uwsgi_regexp_build(char *re, uwsgi_pcre ** pattern) {
int uwsgi_regexp_match(uwsgi_pcre *pattern, const char *subject, int length) {
#ifdef UWSGI_PCRE2
- return pcre2_match(pattern, (const unsigned char *)subject, length, 0, 0, NULL, NULL);
+ return uwsgi_regexp_match_ovec(pattern, subject, length, NULL, 0);
#else
return pcre_exec((const pcre *) pattern->p, (const pcre_extra *) pattern->extra, subject, length, 0, 0, NULL, 0);
#endif
Hi there,
The issue happens since the release of uswgi 2.0.25 (using Python3.10). Here is the extract log of uwsgi installation below, using libpcre2:
I am using JinJa2 template to proide uswgi configuration:
In my tests, I am looking for
Expires
header in response.And the report of test failure, not finding
Expires
headerPining uwsgi to 2.0.24 solves the issue. The installation of uwsgi 2.0.24 uses libpcre3