matomo-org / matomo-log-analytics

Import any kind of server logs in Matomo for powerful log analytics. Universal log file parsing and reporting.
https://matomo.org/log-analytics/
GNU General Public License v3.0
226 stars 118 forks source link

Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10 #373

Open danie-dejager opened 5 months ago

danie-dejager commented 5 months ago

I am unable to import Apache logs from an ubuntu host running ubuntu 20.04.06 x86_64 with python 3.8. The output I get importing the log file is:

0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Parsing log /var/log/apache2/access_matomo.log...
2024-06-04 19:06:16,798: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:16,798: [INFO] Retrying request, attempt number 2
2024-06-04 19:06:17,063: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:17,063: [INFO] Retrying request, attempt number 2
2024-06-04 19:06:17,124: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:17,124: [INFO] Retrying request, attempt number 2
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2024-06-04 19:06:27,198: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:27,198: [INFO] Retrying request, attempt number 3
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2024-06-04 19:06:27,637: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:27,637: [INFO] Retrying request, attempt number 3
2024-06-04 19:06:27,753: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:27,753: [INFO] Retrying request, attempt number 3
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2400 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2024-06-04 19:06:37,517: [INFO] Error when connecting to Matomo: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte
2024-06-04 19:06:37,517: [INFO] Max number of attempts reached, server is unreachable!
Fatal error: 'utf-8' codec can't decode byte 0x80 in position 10: invalid start byte

If I import using the described Apache method my logs are imported.

matomo-log-analytics/import_logs.py is the latest version from git.