Hello !
I migrated my matomo to a new server with python 3.9. I cannot import anymore the logs when it was working fine with python 3.7
python3 mymatomopath/httpdocs//misc/log-analytics/import_logs.py --url=https://mymatomo.com/ --idsite=48 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots var/log//apache2/myweb48.com/access_log.processed
result is
Traceback (most recent call last):
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 1588, in _call_api
return json.loads(res)
File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 2688, in <module>
resolver = config.get_resolver()
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 1131, in get_resolver
return StaticResolver(self.options.site_id)
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 1663, in __init__
site = matomo.call_api(
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 1647, in call_api
return self._call_wrapper(self._call_api, None, None, method, **kwargs)
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 1599, in _call_wrapper
response = func(*args, **kwargs)
File "mymatomopath/httpdocs//misc/log-analytics/import_logs.py", line 1590, in _call_api
raise urllib.error.URLError('Matomo returned an invalid response: ' + res.decode("utf-8") )
AttributeError: 'str' object has no attribute 'decode'```
Any idea about this problem ?! Do I have to downgrade python ?
1 post - 1 participant