Re: [Python] uwsgi in docker: come interpretare questi log?

2020-09-15 Per discussione Alessandro Dentella
On Tue, Sep 15, 2020 at 02:27:38PM +0200, Riccardo Magliocchetti wrote:
> > Poi mi rendo conto che non so come interpretare i log:
> > che significa "app: 0" o alternativamente "app: -1"?
> > ieri credevo che app: -1 fosse quando andava in errore, ma vedo che ho molte
> > richiestecon app: -1 che sono andate a buon fine.

Aggiungo questi log caldi caldi...

[pid: 7|app: -1|req: -1/502] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:21 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 6|app: 0|req: 66/503] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:28 2020] GET / => generated 19217 bytes in 252 msecs (HTTP/1.1 200) 8 
headers in 339 bytes (1 switches on core 0)
[pid: 7|app: -1|req: -1/504] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:28 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 6|app: 0|req: 67/505] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:28 2020] GET / => generated 19217 bytes in 36 msecs (HTTP/1.1 200) 7 
headers in 310 bytes (1 switches on core 0)
[pid: 7|app: -1|req: -1/506] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:28 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 7|app: -1|req: -1/507] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:29 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 6|app: 0|req: 68/508] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:29 2020] GET / => generated 19217 bytes in 90 msecs (HTTP/1.1 200) 7 
headers in 310 bytes (1 switches on core 0)
[pid: 7|app: -1|req: -1/509] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:29 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 7|app: -1|req: -1/510] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:29 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 7|app: -1|req: -1/511] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:29 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers 
in 83 bytes (0 switches on core 0)
[pid: 6|app: 0|req: 69/512] 172.24.0.5 () {42 vars in 562 bytes} [Tue Sep 15 
14:36:29 2020] GET / => generated 19217 bytes in 34 msecs (HTTP/1.1 200) 7 
headers in 310 bytes (1 switches on core 0)

Qui si vede chiaramente che a fronte della stessa richiesta il pid 7 va in
errore ed il pid 6 no. Quando la richiesta va in errore vedo "app: -1", ma in
altre circostanze non è così vanno a buon fine richieste che hanno "app: -1"


sandro
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] uwsgi in docker: come interpretare questi log?

2020-09-15 Per discussione Alessandro Dentella
On Tue, Sep 15, 2020 at 02:27:38PM +0200, Riccardo Magliocchetti wrote:
> On 15/09/20 13:08, Alessandro Dentella wrote:
> > Ma a me l'applicazione va per lungo tempo e poi comincia a darmi errore 
> > "dopo un
> > po'" cosa che non mi era mai successa quando usavo uwsgi fuori da docker.
> 
> eh senza configurazione è difficile aiutarti, se vedi quell'errore devi
> vedere le linee subito dopo al log e risolvere la questione.

Quando ho quell'errore non ho alcun altro log..

La conf di uwsgi è la seguente:


[uwsgi]

prj_dir = /code/
wsgi-file = %(prj_dir)/web/wsgi.py
env = PYTHONPATH=%(prj_dir)/apps

socket-timeout = 200
buffer-size = 1
processes = 2
threads = 1

http = :8000
master = true
http-keepalive = 1
lazy-apps = 1
wsgi-env-behavior = holy

req-logger = file:/var/log/uwsgi/access.log
logger = file:/var/log/uwsgi/errors.log
chmod-socket= 664

static-map = /static=/code/static
static-map = /media=/code/media
## dj collectstatics viene lanciato con --links per risparmiare spazio
## quindi uwsgi richiede che si dichiari che anche il target è sicuro
static-safe = /code/web/static
static-safe = /usr/local/lib/
static-expires-uri = 
"/static/.*\.[a-f0-9]{12,}\.(css|js|png|jpg|jpeg|gif|ico|woff|ttf|otf|svg|scss|map|txt)
 31536"


> > Poi i rendo conto che non so come interpretare i log:
> > che significa "app: 0" o alternativamente "app: -1"?
> > ieri credevo che app: -1 fosse quando andava in errore, ma vedo che ho molte
> > richiestecon app: -1 che sono andate a buon fine.
> 
> dipende da chi risponde alle richieste

Ok, ora capisco che app: 0 => django  app: -1: static-map
Poi però trovo:

[pid: 7|app: -1|req: -1/53] 172.18.0.2 () {42 vars in 564 bytes} [Mon Sep 14 
13:25:16 2020] GET /admin/ => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 
headers in 83 bytes (0 switches on core 0)


Che dovrebbe essere gestita da django ed ha "app: -1", quindi sono punto e a
capo.

Inoltre che è req: -1/53. In modo ingenuo pensavo che fosse l'incrementale delle
request ricevute dall'istanza e poi dal singolo processo. Ma -1 esce da questo
schema, quindi di nuovo sono al palo...


La cosa che mi perplime è che la stessa richiesta venga servita a volte con
errore a volte no, tipo 50% delle volte in un modo e 50% nell'altro.

Oggi però non riesco ad avere un errore neanche a piangere...

sandro
*:-)
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] uwsgi in docker: come interpretare questi log?

2020-09-15 Per discussione Riccardo Magliocchetti

On 15/09/20 13:08, Alessandro Dentella wrote:

On Tue, Sep 15, 2020 at 08:58:35AM +0200, Luca wrote:

Il giorno lun 14 set 2020 alle ore 23:42 Alessandro Dentella <
sandro.dente...@gmail.com> ha scritto:




   --- no python application found, check your startup logs for errors ---

.. 


A me si solito capita quando ho dimenticato di installare qualche modulo,
la pythonpath  o il virtualenv. e quindil'app o non parte o si pianta da
qualche parte.
in genere avviando a mano lo script un paio di volte trovo il punto.


Ma a me l'applicazione va per lungo tempo e poi comincia a darmi errore "dopo un
po'" cosa che non mi era mai successa quando usavo uwsgi fuori da docker.


eh senza configurazione è difficile aiutarti, se vedi quell'errore devi vedere 
le linee subito dopo al log e risolvere la questione.



Poi i rendo conto che non so come interpretare i log:
che significa "app: 0" o alternativamente "app: -1"?
ieri credevo che app: -1 fosse quando andava in errore, ma vedo che ho molte
richiestecon app: -1 che sono andate a buon fine.


dipende da chi risponde alle richieste



sandro

PS: esiste ancora una lista uwsgi? io non la trovo, ma in documentazione dicono
 di scrivere in lista uwsgi...


è andata :'(


--
Riccardo Magliocchetti
@rmistaken

http://menodizero.it
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] uwsgi in docker: come interpretare questi log?

2020-09-15 Per discussione Marco De Paoli
Il giorno mar 15 set 2020 alle ore 13:09 Alessandro Dentella <
sandro.dente...@gmail.com> ha scritto:

> PS: esiste ancora una lista uwsgi? io non la trovo, ma in documentazione
> dicono
> di scrivere in lista uwsgi...
>

uw...@lists.unbit.it non è più attiva

Roberto De Ioris in proposito dice:
"it has been deactivated months ago. You can open issues here or on
stackoverflow. We are evaluating a google group btw."
https://github.com/unbit/uwsgi/issues/2230
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] uwsgi in docker: come interpretare questi log?

2020-09-15 Per discussione Alessandro Dentella
On Tue, Sep 15, 2020 at 08:58:35AM +0200, Luca wrote:
> Il giorno lun 14 set 2020 alle ore 23:42 Alessandro Dentella <
> sandro.dente...@gmail.com> ha scritto:
> 
> > 
> >
> >   --- no python application found, check your startup logs for errors ---
> >
> > .. 
> >
> A me si solito capita quando ho dimenticato di installare qualche modulo,
> la pythonpath  o il virtualenv. e quindil'app o non parte o si pianta da
> qualche parte.
> in genere avviando a mano lo script un paio di volte trovo il punto.

Ma a me l'applicazione va per lungo tempo e poi comincia a darmi errore "dopo un
po'" cosa che non mi era mai successa quando usavo uwsgi fuori da docker.

Poi i rendo conto che non so come interpretare i log:
che significa "app: 0" o alternativamente "app: -1"? 
ieri credevo che app: -1 fosse quando andava in errore, ma vedo che ho molte
richiestecon app: -1 che sono andate a buon fine.


sandro

PS: esiste ancora una lista uwsgi? io non la trovo, ma in documentazione dicono
di scrivere in lista uwsgi...
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python


Re: [Python] uwsgi in docker: come interpretare questi log?

2020-09-14 Per discussione Luca
Il giorno lun 14 set 2020 alle ore 23:42 Alessandro Dentella <
sandro.dente...@gmail.com> ha scritto:

> 
>
>   --- no python application found, check your startup logs for errors ---
>
> .. 
>
A me si solito capita quando ho dimenticato di installare qualche modulo,
la pythonpath  o il virtualenv. e quindil'app o non parte o si pianta da
qualche parte.
in genere avviando a mano lo script un paio di volte trovo il punto.

-- 
Luca
___
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python