[web2py] Re: web2py 2.25.1

2023-10-18 Thread CarlosDB
Hello.
I believe this error is related to a thread I opened a few days ago:

" File Download Broken after Pull Request #2471 "
https://groups.google.com/g/web2py/c/ruhme28jvNo

Carlos.

El miércoles, 18 de octubre de 2023 a las 18:49:34 UTC+2, 
xgp.l...@gmail.com escribió:

> Hi,
>
> Modified the code to this:
>
>   for k, v in iteritems(headers):
> if isinstance(v, list):
> rheaders += [(k, str(item)) for item in v]
> else:
> rheaders.append((k, str(v)))
>
> This was the code from version 2.24.1
>
> Dont know if this is correct.
>
>
> Cheers,
>
> El miércoles, 18 de octubre de 2023 a las 11:37:30 UTC-5, 
> xgp.l...@gmail.com escribió:
>
>> Hi Massimo,
>>
>> Getting this redirecting from nginx to uwsgi_pass http port.
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/main.py", line 562, in wsgibase
>> return http_response.to(responder, env=env)
>>   File "/home/www-data/web2py/gluon/http.py", line 129, in to
>> responder(status, rheaders)
>> TypeError: http header value must be a string
>>
>>
>> Regards,
>>
>>
>> El lunes, 9 de octubre de 2023 a las 3:38:11 UTC-5, CarlosDB escribió:
>>
>>> A fantastic job.
>>> Thank you very much.
>>>
>>> Carlos.
>>>
>>> El domingo, 8 de octubre de 2023 a las 20:59:27 UTC+2, Massimo Di Pierro 
>>> escribió:
>>>
 Hello everybody,

 A new version of web2py, 2.25.1, is out. 

 It contains some bug fixes, #2468 #2468 #2236, http headers 
 sanitization, and fixes this vulenarbility 
 https://jvn.jp/en/jp/JVN80476432/ (to be published soon).

 The vulnerabily does not affect most users. It is only in the optional 
 MessageBoxHandler for logging when using Tkinter. I do know think anybody 
 is was using it.

 I am reviewing some old PRs and I may have another version out today 
 including those fixes as well. Sorry I have been slow but as you know, I 
 am 
 spending more time on py4web than web2py these days. 

 Massimo




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3a723138-4123-48c6-bd17-3496e897f9fcn%40googlegroups.com.


[web2py] Re: web2py 2.25.1

2023-10-18 Thread xgp.l...@gmail.com
Hi,

Modified the code to this:

  for k, v in iteritems(headers):
if isinstance(v, list):
rheaders += [(k, str(item)) for item in v]
else:
rheaders.append((k, str(v)))

This was the code from version 2.24.1

Dont know if this is correct.


Cheers,

El miércoles, 18 de octubre de 2023 a las 11:37:30 UTC-5, 
xgp.l...@gmail.com escribió:

> Hi Massimo,
>
> Getting this redirecting from nginx to uwsgi_pass http port.
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/main.py", line 562, in wsgibase
> return http_response.to(responder, env=env)
>   File "/home/www-data/web2py/gluon/http.py", line 129, in to
> responder(status, rheaders)
> TypeError: http header value must be a string
>
>
> Regards,
>
>
> El lunes, 9 de octubre de 2023 a las 3:38:11 UTC-5, CarlosDB escribió:
>
>> A fantastic job.
>> Thank you very much.
>>
>> Carlos.
>>
>> El domingo, 8 de octubre de 2023 a las 20:59:27 UTC+2, Massimo Di Pierro 
>> escribió:
>>
>>> Hello everybody,
>>>
>>> A new version of web2py, 2.25.1, is out. 
>>>
>>> It contains some bug fixes, #2468 #2468 #2236, http headers 
>>> sanitization, and fixes this vulenarbility 
>>> https://jvn.jp/en/jp/JVN80476432/ (to be published soon).
>>>
>>> The vulnerabily does not affect most users. It is only in the optional 
>>> MessageBoxHandler for logging when using Tkinter. I do know think anybody 
>>> is was using it.
>>>
>>> I am reviewing some old PRs and I may have another version out today 
>>> including those fixes as well. Sorry I have been slow but as you know, I am 
>>> spending more time on py4web than web2py these days. 
>>>
>>> Massimo
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2499d89f-f635-4e82-915c-15acbee3550bn%40googlegroups.com.


[web2py] Re: web2py 2.25.1

2023-10-18 Thread xgp.l...@gmail.com
Hi Massimo,

Getting this redirecting from nginx to uwsgi_pass http port.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/main.py", line 562, in wsgibase
return http_response.to(responder, env=env)
  File "/home/www-data/web2py/gluon/http.py", line 129, in to
responder(status, rheaders)
TypeError: http header value must be a string


Regards,


El lunes, 9 de octubre de 2023 a las 3:38:11 UTC-5, CarlosDB escribió:

> A fantastic job.
> Thank you very much.
>
> Carlos.
>
> El domingo, 8 de octubre de 2023 a las 20:59:27 UTC+2, Massimo Di Pierro 
> escribió:
>
>> Hello everybody,
>>
>> A new version of web2py, 2.25.1, is out. 
>>
>> It contains some bug fixes, #2468 #2468 #2236, http headers sanitization, 
>> and fixes this vulenarbility https://jvn.jp/en/jp/JVN80476432/ (to be 
>> published soon).
>>
>> The vulnerabily does not affect most users. It is only in the optional 
>> MessageBoxHandler for logging when using Tkinter. I do know think anybody 
>> is was using it.
>>
>> I am reviewing some old PRs and I may have another version out today 
>> including those fixes as well. Sorry I have been slow but as you know, I am 
>> spending more time on py4web than web2py these days. 
>>
>> Massimo
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/18c9bc90-183c-40a3-9640-6b9955e04463n%40googlegroups.com.


[web2py] Re: uwsgi with web2py hard crash/locking with nginx

2023-10-18 Thread lucas
yes, i think once the RAM was consumed the server ground to a halt where it 
appeared to crash.  so, i believe it was a soft crash instead of a hard 
crash.  i used "top" to monitor the memory and processes and the soft crash 
occurred when the RAM was exhausted.  so i created a swap file to extend 
the RAM using this series of CLI/sh commands:

df -h
free -m
swapon --show

fallocate -l 2G /swapfile
chmod 600 /swapfile 
mkswap /swapfile 
swapon /swapfile

#under /etc/fstab, add the line:
/swapfile swap swap defaults 0 0

swapon --show
free -m
df -h

which did the trick as i still watched under top.  therefore, creating the 
swap file did the trick.  i also updated my uwsgi initialization file to 
allow for more processes, or:

[uwsgi]
chdir = /opt/web2py_apps/web2py
module = wsgihandler:application

master = true
processes = 5
threads = 2
thread-stacksize = 512

uid = web2py
gid = web2py
socket = /run/uwsgi/web2py.sock
chown-socket = web2py:nginx
chmod-socket = 660
vacuum = true

thank you for your help.  lucas
On Tuesday, October 17, 2023 at 3:43:31 AM UTC-4 Tom Clerckx wrote:

> Maybe you should review the 'high calculation/high plotly' pages for 
> memory usage?
> As the 'OOM killer' kicked in, it looks like the process is using too much 
> memory.
>
> One thing to verify this is to monitor the VmRSS of the processes involved 
> (VmRSS is one of the fields in the output when you do 'cat 
> /proc//status') 
> VmRSS gives you an idea about the amount of RAM memory your process is 
> using.
>
> If it's growing out of proportion, you're claiming too much memory and the 
> process will be killed by the OOM-killer.
>
>
> On Monday, October 16, 2023 at 8:15:20 PM UTC+2 lucas wrote:
>
>> hello one and all,
>>
>> i'm using web2py 2.25.1 with uwsgi 2.0.22 which was downloaded and 
>> compiled using pip3 under python 3.10.12 under ubuntu 22.04.  the nginx is 
>> apt installed version 1.18.
>>
>> with that being said, if i install and run my high calculation / high 
>> plotly plot pages about 6 to 12 times, the whole damn system comes to a 
>> crash.  hard crash.  this also seems to be the case under redhat / amazon 
>> linux 2023 similar setup and config.
>>
>> so i tried crashing the system under just "python3 web2py.py -i 0.0.0.0 
>> -p 80 --no_gui" and also under "uwsgi --http :80 --chdir 
>> /opt/web2py_apps/web2py -w wsgihandler:application" but i could NOT get 
>> either to crash.  it is only when i nginx daemon it with uwsgi and web2py 
>> layered/socketed under nginx that it DOES crash hard.  i think i found 
>> under the systemctl logs for uwsgi a logging of the crash, or:
>>
>> Oct 16 13:48:30 iquanta.info systemd[1]: uwsgi.service: A process of 
>> this unit has been killed by the OOM killer.
>> Oct 16 13:48:30 iquanta.info uwsgi[1264]: [emperor] *** RAGNAROK EVOKED 
>> ***
>> Oct 16 13:48:30 iquanta.info uwsgi[1265]: SIGINT/SIGTERM 
>> received...killing workers...
>> Oct 16 13:48:30 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:30 2023 - 
>> [emperor] stop the uwsgi instance web2py.ini
>> Oct 16 13:48:30 iquanta.info uwsgi[1265]: Mon Oct 16 13:48:30 2023 - 
>> received message 0 from emperor
>> Oct 16 13:48:31 iquanta.info uwsgi[1265]: worker 5 buried after 1 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 1 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 2 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 3 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 4 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: goodbye to uWSGI.
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: VACUUM: unix socket 
>> /run/uwsgi/web2py.sock removed.
>> Oct 16 13:48:33 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:33 2023 - 
>> [emperor] removed uwsgi instance web2py.ini
>> Oct 16 13:48:34 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:34 2023 - The 
>> Emperor is buried.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Failed with 
>> result 'oom-kill'.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Consumed 10.241s 
>> CPU time.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Scheduled 
>> restart job, restart counter is at 1.
>> Oct 16 13:48:34 iquanta.info systemd[1]: Stopped uWSGI Emperor service.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Consumed 10.241s 
>> CPU time.
>>
>> with not much to say under the nginx logs.  so, does anyone know what i 
>> can be dealing with?  thank you in advance, lucas
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/ms