istSOS on debian 9.11 does not work (TypeError: the JSON object must be str, not 'bytes')

4 views
Skip to first unread message

Olivier Lobry

unread,
Feb 8, 2021, 4:40:02 AM2/8/21
to istSOS
Hi,

I'm trying to install istSOS 2.4.0-RC4-1 on a debian 9.11 with python 3.5.3
The installation worked fine and I am able to access the interface. 
But when I try to change any parameter (Service Provider, ...) or test the database connection, the application is stuck ("please wait" message) and I have this error in the apache log :

===
 Traceback (most recent call last):, referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/share/istsos/application_walib.py", line 96, in executeWa, referer: http://istsos.xxx.org/istsos/admin/
     op = factory.initResource(waEnviron), referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/share/istsos/walib/resourceFactory.py", line 58, in initResource, referer: http://istsos.xxx.org/istsos/admin/
     return istsos.waValidatedb(waEnviron), referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/share/istsos/walib/istsos/istsos.py", line 199, in __init__, referer: http://istsos.xxx.org/istsos/admin/
     waIstsos.__init__(self, waEnviron), referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/share/istsos/walib/istsos/istsos.py", line 32, in __init__, referer: http://istsos.xxx.org/istsos/admin/
     resource.waResourceAdmin.__init__(self, waEnviron), referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/share/istsos/walib/resource.py", line 160, in __init__, referer: http://istsos.xxx.org/istsos/admin/
     waResource.__init__(self, waEnviron, loadjson), referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/share/istsos/walib/resource.py", line 63, in __init__, referer: http://istsos.xxx.org/istsos/admin/
     self.json = ut.encodeobject(json.loads(waEnviron['wsgi_input'])), referer: http://istsos.xxx.org/istsos/admin/
   File "/usr/lib/python3.5/json/__init__.py", line 312, in loads, referer: http://istsos.xxx.org/istsos/admin/
     s.__class__.__name__)), referer: http://istsos.xxx.org/istsos/admin/
 TypeError: the JSON object must be str, not 'bytes', referer: http://istsos.xxx.org/istsos/admin/
===


Looks like in the executeWa function (/usr/share/istsos/application_walib.py), wsgi_input is equal to 'None', meaning the application cannot read HTTP input (?) 
        "wsgi_input" : environ['wsgi.input'].read(int(environ["CONTENT_LENGTH"])) if environ.get("CONTENT_LENGTH") else None,

That leads latter to a bug in /usr/share/istsos/walib/resource.py :
     self.json = ut.encodeobject(json.loads(waEnviron['wsgi_input']))
=>  TypeError: the JSON object must be str, not 'bytes'


Did anyone managed to install the application on a debian 9.11 or has an idea of the problem ?

Best regards

Olivier



Reply all
Reply to author
Forward
0 new messages