Hey there! 
I recently updated to Web2py Version 
2.24.1-stable+timestamp.2023.03.23.05.07.17
It uses python 3.9.14, running in production serving around 60 requests per 
second, using resources efficiently and running really smoothly :D

Since the update, I'm seeing this error sporadically: 
*redis.exceptions.DataError: 
Invalid input of type: 'NoneType'. Convert to a bytes, string, int or float 
first.*
This is the traceback:

Traceback (most recent call last):
File "applications/eldia/compiled/models.db.py", line 113, in <module>
File "/var/www/medios/gluon/globals.py", line 979, in connect
row = table(record_id, unique_key=unique_key)
File "/var/www/medios/gluon/contrib/redis_session.py", line 134, in __call__
row = q.select()
File "/var/www/medios/gluon/contrib/redis_session.py", line 206, in select
rtn = {to_native(k): v for k, v in self.db.r_server.hgetall(key).items()}
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/commands/core.py",
 
line 4776, in hgetall
return self.execute_command("HGETALL", name)
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1238, in execute_command
return conn.retry.call_with_retry(
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/retry.py", line 
49, in call_with_retry
fail(error)
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1242, in <lambda>
lambda error: self._disconnect_raise(conn, error),
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1228, in _disconnect_raise
raise error
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/retry.py", line 
46, in call_with_retry
return do()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1239, in <lambda>
lambda: self._send_command_parse_response(
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1215, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1254, in parse_response
response = connection.read_response()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 824, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 318, in read_response
raw = self._buffer.readline()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 249, in readline
self._read_from_socket()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 195, in _read_from_socket
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
redis.exceptions.ConnectionError: Connection closed by server.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/www/medios/gluon/main.py", line 439, in wsgibase
serve_controller(request, response, session)
File "/var/www/medios/gluon/main.py", line 173, in serve_controller
run_models_in(environment)
File "/var/www/medios/gluon/compileapp.py", line 563, in run_models_in
restricted(ccode, environment, layer=model)
File "/var/www/medios/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "applications/eldia/compiled/models.db.py", line 116, in <module>
File "applications/eldia/compiled/models.db.py", line 47, in raise_error
gluon.http.HTTP: 500 INTERNAL SERVER ERROR

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/www/medios/gluon/main.py", line 455, in wsgibase
session._try_store_in_db(request, response)
File "/var/www/medios/gluon/globals.py", line 1254, in _try_store_in_db
record_id = table.insert(**dd)
File "/var/www/medios/gluon/contrib/redis_session.py", line 167, in insert
pipe.execute()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
2078, in execute
return conn.retry.call_with_retry(
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/retry.py", line 
46, in call_with_retry
return do()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
2079, in <lambda>
lambda: execute(conn, stack, raise_on_error),
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1922, in _execute_transaction
all_cmds = connection.pack_commands(
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 895, in pack_commands
for chunk in self.pack_command(*cmd):
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 858, in pack_command
for arg in map(self.encoder.encode, args):
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 108, in encode
raise DataError(
redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a 
bytes, string, int or float first.

It's not clear to me where or how the error happens. From what I see, I 
understand that the problem is with redis session, but I can't figure out 
where. 

I run python 3.9.14 with virtualenv and Redis 4.3.5.
Any point or suggestion will be much appreciated.
Thanks!

-- 
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/cd864b27-dd97-4507-96b7-d716494c6c96n%40googlegroups.com.

Reply via email to