sys4 / savacli

Avira SAVAPI command line client
GNU General Public License v3.0
7 stars 6 forks source link

get an exception, when ReportFormat is set to json #6

Open dbloms opened 1 year ago

dbloms commented 1 year ago

I use the savacli 0.4.1 on debian bullseye. When I use the following configfile (I replaced the ProductID with XXXXX):

root@savapi:/# cat /etc/savacli.cfg 
[savacli]
ProductId = XXXXX
Socket = unix:/socket/savapi/savapi/socket
LogClasses = clean infected error
Local = yes
ReportFormat = json
ReportHeader = yes
ReportSummary = no
LogFile = /tmp/out.log

I get the following error:

root@savapi:/# /tmp/savacli --config /etc/savacli.cfg --input /etc/resolv.conf 
Traceback (most recent call last):
  File "/tmp/savacli", line 891, in <module>
    exit_code = main()
  File "/tmp/savacli", line 885, in main
    print(json.dumps(out))
  File "/usr/lib/python3.9/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

when I set ReportFormat to plain, the scan works fine:

root@savapi:/# /tmp/savacli --config /etc/savacli.cfg --input /etc/resolv.conf 
Global information:
-------------------
date: Fri, 10 Mar 2023 15:02:29 +0100
product version: 4.15.15.58
engine version: 8.3.66.52
VDF version: 8.19.36.74
VDF signature count: 5915454
license expire: 2024-03-01

it would be nice to get the output in json format, so we can use it in further steps

cstrotm commented 1 year ago

I would like to fix this issue, but I don't have access to the AVIRA scanner anymore (none of my clients are using it, I have neither the current code nor a license)

@croessner Do you still have AVIRA to be able to work on a fix?

cstrotm commented 1 year ago

@CNMan I will only use a proper license that is licensed to me. Alternatively someone with a license can give me access via SSH to one of their development systems (please not a production system).