Projet

Général

Profil

Development #73238

Impossible de lancer une app avec uwsgi

Ajouté par Lauréline Guérin il y a plus d'un an. Mis à jour il y a plus d'un an.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
10 janvier 2023
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Avec un env à jour, fraîchement refait.

Dans supervisorctl, par exemple chrono:

supervisor> start uwsgi:chrono-uwsgi 
uwsgi:chrono-uwsgi: ERROR (spawn error)

Dans /var/log/chrono/stderr.log:

[uWSGI] getting INI configuration from /home/lguerin/.config/publik/settings/chrono/uwsgi.ini
*** Starting uWSGI 2.0.21-debian (64bit) on [Tue Jan 10 17:01:25 2023] ***
compiled with version: 12.2.0 on 05 January 2023 09:17:29
os: Linux-6.0.0-6-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.12-1 (2022-12-09)
nodename: lg
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /
detected binary path: /usr/bin/uwsgi-core
your processes number limit is 62437
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: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
[busyness] settings: min=20%, max=70%, overload=20, multiplier=10, respawn penalty=2
[busyness] backlog alert is set to 16 request(s), step is 2
[busyness] backlog non-zero alert is set to 60 second(s)
uwsgi socket 0 bound to TCP address :8040 fd 3
Python version: 3.11.1 (main, Dec 31 2022, 10:23:59) [GCC 12.2.0]
PEP 405 virtualenv detected: /home/lguerin/envs/publik-env-py3
Set PythonHome to /home/lguerin/envs/publik-env-py3
Python main interpreter initialized at 0x7fcbbb95f158
python threads support enabled
your server socket listen backlog is limited to 1024 connections
your mercy for graceful operations on workers is 60 seconds
mapped 50897592 bytes (49704 KB) for 500 cores
*** Operational MODE: preforking ***
ModuleNotFoundError: No module named 'chrono'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. GAME OVER ***
unlink(): No such file or directory [core/uwsgi.c line 1675]

Historique

#1

Mis à jour par Emmanuel Cazenave il y a plus d'un an

Je ne reproduis pas.

#2

Mis à jour par Emmanuel Cazenave il y a plus d'un an

Mais je suis en bullseye.

#3

Mis à jour par Thomas Noël il y a plus d'un an

Tu peux nous filer les lignes de lancement visibles dans /var/log/chrono/stderr.log ?

#4

Mis à jour par Emmanuel Cazenave il y a plus d'un an

[uWSGI] getting INI configuration from /home/cazino/.config/publik/settings/chrono/uwsgi.ini
[uWSGI] getting INI configuration from /home/cazino/.config/publik/settings/chrono/settings.d/uwsgi-local.ini
*** Starting uWSGI 2.0.19.1-debian (64bit) on [Tue Jan 10 17:14:05 2023] ***
compiled with version: 10.2.1 20210110 on 11 June 2021 09:08:33
os: Linux-5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13)
nodename: cazino-laptop
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /
detected binary path: /usr/bin/uwsgi-core
your processes number limit is 63427
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: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
[busyness] settings: min=20%, max=70%, overload=20, multiplier=10, respawn penalty=2
[busyness] backlog alert is set to 16 request(s), step is 2
[busyness] backlog non-zero alert is set to 60 second(s)
uwsgi socket 0 bound to TCP address :8040 fd 3
Python version: 3.9.2 (default, Feb 28 2021, 17:03:44)  [GCC 10.2.1 20210110]
PEP 405 virtualenv detected: /home/cazino/envs/publik-env-py3
Set PythonHome to /home/cazino/envs/publik-env-py3
Python main interpreter initialized at 0x564451fa6000
python threads support enabled
your server socket listen backlog is limited to 1024 connections
your mercy for graceful operations on workers is 60 seconds
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command cancel_events --all-tenants -v0" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command send_email_notifications --all-tenants -v0" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command update_event_recurrences --all-tenants -v0" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command clearsessions --all-tenants" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command send_booking_reminders --all-tenants" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command sync_desks_timeperiod_exceptions --all-tenants" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command anonymize_bookings --all-tenant" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command update_shared_custody_holiday_rules --all-tenant" registered as cron task
[uwsgi-cron] command "/usr/bin/chrono-manage tenant_command sync_desks_timeperiod_exceptions_from_settings --all-tenants -v0" registered as cron task
mapped 50905608 bytes (49712 KB) for 500 cores
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x564451fa6000 pid: 52335 (default app)
spawned uWSGI master process (pid: 52335)
spawned the uWSGI spooler on dir /var/lib/chrono/spooler with pid 52336
spawned the uWSGI spooler on dir /var/lib/chrono/spooler with pid 52337
spawned the uWSGI spooler on dir /var/lib/chrono/spooler with pid 52338
spawned uWSGI worker 1 (pid: 52339, cores: 1)
spawned uWSGI worker 2 (pid: 52340, cores: 1)
spawned uWSGI worker 3 (pid: 52345, cores: 1)
python tracebacker for worker 1 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.1
python tracebacker for worker 2 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.2
python tracebacker for worker 3 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.3
Python auto-reloader enabled
spawned uWSGI worker 4 (pid: 52348, cores: 1)
python tracebacker for worker 4 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.4
spawned uWSGI worker 5 (pid: 52351, cores: 1)
python tracebacker for worker 5 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.5
spawned uWSGI worker 6 (pid: 52354, cores: 1)
python tracebacker for worker 6 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.6
spawned uWSGI worker 7 (pid: 52357, cores: 1)
spawned uWSGI worker 8 (pid: 52359, cores: 1)
spawned uWSGI worker 9 (pid: 52363, cores: 1)
spawned uWSGI worker 10 (pid: 52366, cores: 1)
python tracebacker for worker 9 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.9
*** Stats server enabled on /home/cazino/envs/publik-env-py3/run/chrono/stats.sock fd: 1015 ***
python tracebacker for worker 7 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.7
python tracebacker for worker 8 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.8
python tracebacker for worker 10 available on /home/cazino/envs/publik-env-py3/run/chrono/py-tracebacker.sock.10
#5

Mis à jour par Thomas Noël il y a plus d'un an

La quasi seule différence que je vois c'est Python 3.11 chez Laureline et moi, versus 3.9 chez toi... mais ça m'étonne.

Ceci étant, dans mon venv :

(publik-env-py3) thomas@zepo:~$ python3.11
Python 3.11.1 (main, Dec 31 2022, 10:23:59) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chrono
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'chrono'
>>> 
(publik-env-py3) thomas@zepo:~$ python3
Python 3.10.9 (main, Dec  7 2022, 13:47:07) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chrono
>>> 

Je me demande si uwsgi n'essaye pas de lancer python3.11 dans le venv, et se retrouve alors "hors venv" (parce que celui-ci est pour 3.10).

J'ai pas trouvé comment contourner le truc cependant.

#6

Mis à jour par Thomas Noël il y a plus d'un an

Donc c'est ça, un mix python3.10/python3.11 sur Debian testing actuellement, uwsgi attendu python3.11.

J'ai joué ainsi une réinstallation forcée en 3.11 de devinst :

diff --git a/ansible.cfg b/ansible.cfg
index 9a26b07..2dfbab3 100644
--- a/ansible.cfg
+++ b/ansible.cfg
@@ -1,3 +1,3 @@
 [defaults]
 remote_tmp = /tmp
-interpreter_python = /usr/bin/python3
+interpreter_python = /usr/bin/python3.11
diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml
index 6e19a94..d3d7f0e 100644
--- a/roles/base/tasks/main.yml
+++ b/roles/base/tasks/main.yml
@@ -58,7 +58,7 @@
     name: django
     version: "{{django_version}}" 
     virtualenv: "{{venv_py3}}" 
-    virtualenv_command: "python3 -m venv" 
+    virtualenv_command: "python3.11 -m venv" 

 - name: guess virtualenv python3 site-packages
   command: "{{venv_py3_python}} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'" 
@@ -117,7 +117,7 @@
     mode: "u=rwx,g=rx,o=rx" 
   vars:
     virtualenv_python: "{{venv_py3_python}}" 
-    system_python: "/usr/bin/python3" 
+    system_python: "/usr/bin/python3.11" 

 - name: execute getlasso
   command: "{{venv_py3_bin}}/getlasso.sh" 
@@ -154,7 +154,7 @@
     mode: "u=rwx,g=rx,o=rx" 
   vars:
     virtualenv_python: "{{venv_py3_python}}" 
-    system_python: "/usr/bin/python3" 
+    system_python: "/usr/bin/python3.11" 

 - name: execute get-uwsgidecorators
   command: "{{venv_py3_bin}}/get-uwsgidecorators.sh" 

et reinstallation et le venv est en python3.11 et ça roule.

Ca sera autocorrigé quand python3.11 sera devenu la version de Python par défaut dans Debian testing (très prochainement je pense).

#7

Mis à jour par Lauréline Guérin il y a plus d'un an

j'ai refait mon env avec du py3.11 partout, et ça tourne, merci

#8

Mis à jour par Thomas Noël il y a plus d'un an

  • Statut changé de Nouveau à Fermé

Je ferme simplement car je ne pense pas utile un patch de devinst, ça va s'auto-corriger dans Debian (selon moi) d'ici quelques jours.

#9

Mis à jour par Thomas Noël il y a plus d'un an

(et pour info, python 3.11 est désormais la version par défaut dans testing et tout va bien)

Formats disponibles : Atom PDF