xavier-hernandez / goaccess-for-nginxproxymanager

GoAccess Docker Image for Nginx Proxy Manager and more...
https://hub.docker.com/r/xavierh/goaccess-for-nginxproxymanager
MIT License
544 stars 40 forks source link

Parsing Errors - Token '502,' doesn't match specifier '%s' #107

Closed pvd-nerd closed 1 year ago

pvd-nerd commented 2 years ago

Getting the following error when adding the container to an existing NPM deployment. Everything looks right on the compose file, here is the goaccess portion:

######################################### goaccess: image: xavierh/goaccess-for-nginxproxymanager:latest container_name: goaccess restart: always environment: TZ: America/New_York LOG_TYPE: NPM
ports:

The NPM container data is mounted to: /mnt/dockerdata/npm/app

Container Startup: ######################################### GOAN v1.1.8

NGINX SETUP...

NGINX BASIC AUTH

None

NPM INSTANCE SETTING UP...

LOADING NPM PROXY LOGS

Adding proxy logs...
 Filename: /opt/log/proxy-host-28_access.log | Read = yes
 Filename: /opt/log/proxy-host-26_access.log | Read = yes
 Filename: /opt/log/proxy-host-9_access.log | Read = yes
 Filename: /opt/log/proxy-host-1_access.log | Read = yes
 Filename: /opt/log/proxy-host-4_access.log | Read = yes
 Filename: /opt/log/proxy-host-10_access.log | Read = yes
 Filename: /opt/log/proxy-host-18_access.log | Read = yes
 Filename: /opt/log/proxy-host-14_access.log | Read = yes
 Filename: /opt/log/proxy-host-15_access.log | Read = yes
 Filename: /opt/log/proxy-host-25_access.log | Read = yes
 Filename: /opt/log/proxy-host-7_access.log | Read = yes
 Filename: /opt/log/proxy-host-11_access.log | Read = yes
 Filename: /opt/log/proxy-host-30_access.log | Read = yes
 Filename: /opt/log/proxy-host-2_access.log | Read = yes
 Filename: /opt/log/proxy-host-22_access.log | Read = yes
 Filename: /opt/log/proxy-host-19_access.log | Read = yes
 Filename: /opt/log/proxy-host-17_access.log | Read = yes
 Filename: /opt/log/proxy-host-27_access.log | Read = yes
 Filename: /opt/log/proxy-host-29_access.log | Read = yes
 Filename: /opt/log/proxy-host-16_access.log | Read = yes
 Filename: /opt/log/proxy-host-21_access.log | Read = yes
 Filename: /opt/log/proxy-host-3_access.log | Read = yes
 Filename: /opt/log/proxy-host-12_access.log | Read = yes
 Filename: /opt/log/proxy-host-5_access.log | Read = yes
 Filename: /opt/log/proxy-host-31_access.log | Read = yes
 Filename: /opt/log/proxy-host-13_access.log | Read = yes
 Filename: /opt/log/proxy-host-8_access.log | Read = yes
 Filename: /opt/log/proxy-host-24_access.log | Read = yes
 Filename: /opt/log/proxy-host-20_access.log | Read = yes
 Filename: /opt/log/proxy-host-6_access.log | Read = yes
 Filename: /opt/log/proxy-host-23_access.log | Read = yes
Found (31) proxy logs...

SKIP ARCHIVED LOGS
-------------------------------
FALSE

Adding proxy archive logs...
 Filename: /opt/log/proxy-host-2_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-27_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-5_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-29_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-27_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-13_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-14_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-24_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-18_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-3_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-26_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-5_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-1_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-13_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-16_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-3_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-10_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-18_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-11_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-17_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-5_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-28_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-16_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-1_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-11_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-8_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-2_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-30_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-20_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-27_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-12_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-4_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-28_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-6_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-26_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-11_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-9_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-31_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-21_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-22_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-9_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-25_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-10_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-31_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-12_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-23_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-6_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-4_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-15_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-9_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-18_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-8_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-15_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-22_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-1_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-22_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-27_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-24_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-2_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-2_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-25_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-18_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-7_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-3_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-14_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-17_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-8_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-23_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-4_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-31_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-6_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-15_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-14_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-16_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-21_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-31_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-19_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-21_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-28_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-14_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-12_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-5_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-13_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-23_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-15_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-17_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-24_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-25_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-24_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-3_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-19_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-11_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-12_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-26_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-22_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-23_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-21_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-16_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-20_access.log.2.gz | Read = yes
 Filename: /opt/log/proxy-host-4_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-13_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-9_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-26_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-8_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-28_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-1_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-6_access.log.1.gz | Read = yes
 Filename: /opt/log/proxy-host-25_access.log.4.gz | Read = yes
 Filename: /opt/log/proxy-host-17_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-10_access.log.3.gz | Read = yes
 Filename: /opt/log/proxy-host-10_access.log.1.gz | Read = yes
Added (111) proxy archived logs from /opt/log...

EXCLUDE IPS

None

Setting GeoIP Database

DEFAULT

DEBUG

OFF #########################################

Error: ######################################### RUN NPM GOACCESS [SETTING UP STORAGE /opt/log/proxy-host-23_access.log] {0} @ {0/s} Cleaning up resources... ==141== GoAccess - version 1.6.3 - Sep 28 2022 02:28:46 ==141== Config file: /goaccess-config/goaccess.conf ==141== https://goaccess.io - hello@goaccess.io ==141== Released under the MIT License. ==141== ==141== FILE: /goaccess-config/archive.log ==141== Parsed 10 lines producing the following errors: ==141== ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== Token '502,' doesn't match specifier '%s' ==141== ==141== Format Errors - Verify your log/date/time format #########################################

I checked that file in /opt/log/ and the format looks correct. I'm not sure what file is unable to parse, is it the /goaccess-config/archive.log? It doesn't look like a permission issue since it can read all the files. I see it mounting a temp volume to /opt/custom but I don't think I need that since I'm doing NPM.

xavier-hernandez commented 2 years ago

@pvd-nerd can you set SKIP_ARCHIVED_LOGS=True and see if it still runs across that error? If it doesn't then maybe one of the archives is corrupted or different.

pvd-nerd commented 2 years ago

@xavier-hernandez Changed to skip archived logs, looks like I'm getting the correct file now but still getting the error.

==25== FILE: /opt/log/proxy-host-10_access.log ==25== Parsed 3 lines producing the following errors: ==25== ==25== Token '502,' doesn't match specifier '%s' ==25== Token '502,' doesn't match specifier '%s' ==25== Token '502,' doesn't match specifier '%s' ==25== GoAccess - version 1.6.3 - Sep 28 2022 02:28:46 ==25== Config file: /goaccess-config/goaccess.conf ==25== https://goaccess.io - hello@goaccess.io ==25== Released under the MIT License. ==25==

I checked that /opt/log/proxy-host-10_access.log file and confirmed it is my jacket container which is currently off, NPM always reports a 502 if the container does not respond. Is it just unable to parse anything other than a 200?

[09/Oct/2022:12:55:18 +0000] - 502, 502, 502, 502, 502, 502, 502, 502 502 - GET https jackett.domain.me "/" [Client 172.16.xx.xx] [Length 154] [Gzip -] [Sent-to docker.domain.me] "Uptime-Kuma/1.18.0" "-"

Side note: tested with a brand new compose file with a different volume mount. Works fine, definitely seems like it is just unable to handle the 502 error. If that's the case, ill just remove the non-working hosts.

xavier-hernandez commented 2 years ago

@pvd-nerd yeah that log file doesn't seem to be in the right format. I'm not sure why it's putting in all those 502 errors. The sample logs I use, for example below, to test my image works for 502 and other HTTP error codes. You might want to open a ticket for NPM. Does the file have other lines like that or is it just a 1-time thing?

[27/Jun/2022:23:43:56 -0400] - 502 502 - GET https test.domain.com [30/Jun/2022:05:24:52 -0400] - 404 404 - GET https test.domain.com [30/Jun/2022:05:25:03 -0400] - - 301 - GET http test.domain.com

xavier-hernandez commented 1 year ago

Closing this for now... open again if you want me to work on it.