Hello to all.
The script import_logs.py does not work.
There is an HTTP 405 error and I don’t understand where the problem comes from.
Does anyone have an idea of the problem?
Thanks in advance.
Here is the terminal output:
sudo python3 /opt/matomo/matomo-log-analytics/import_logs.py --config /var/www/html/matomo/config/config.ini.php --enable-http-errors --enable-http-redirects --enable-static --idsite 1 --url="matomo.ignace72.eu" /var/log/nginx/access.log
2023-04-10 03:31:52,270: [INFO] Error when connecting to Matomo: HTTP Error 405: Not Allowed
2023-04-10 03:31:52,271: [INFO] Retrying request, attempt number 2
2023-04-10 03:32:02,310: [INFO] Error when connecting to Matomo: HTTP Error 405: Not Allowed
2023-04-10 03:32:02,311: [INFO] Retrying request, attempt number 3
2023-04-10 03:32:12,348: [INFO] Error when connecting to Matomo: HTTP Error 405: Not Allowed
2023-04-10 03:32:12,348: [INFO] Max number of attempts reached, server is unreachable!
Traceback (most recent call last):
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1599, in _call_wrapper
response = func(*args, **kwargs)
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1585, in _call_api
res = self._call('/', final_args, url=url)
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1537, in _call
response = opener.open(request, timeout = timeout)
File "/usr/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/usr/lib/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 405: Not Allowed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 2688, in <module>
resolver = config.get_resolver()
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1131, in get_resolver
return StaticResolver(self.options.site_id)
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1663, in __init__
site = matomo.call_api(
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1647, in call_api
return self._call_wrapper(self._call_api, None, None, method, **kwargs)
File "/opt/matomo/matomo-log-analytics/import_logs.py", line 1636, in _call_wrapper
raise MatomoHttpBase.Error(message, code)
__main__.Error: HTTP Error 405 Not Allowed, response: <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx</center>
</body>
</html>