Goaccess: Error occurred at: src/parser.c - read_log - 2728

Created on 5 Jun 2019  ·  13Comments  ·  Source: allinurl/goaccess

Hi,

I am getting the following error trying to parse nginx error.log with goaccess:

# goaccess -f /var/log/nginx/error.log -p /etc/goaccess.conf

GoAccess - version 1.3 - Jun  5 2019 09:31:27
Config file: /etc/goaccess.conf

Fatal error has occurred
Error occurred at: src/parser.c - read_log - 2728
Unable to open the specified log file. No such file or directory

But the file definitely exists in the location:

# ls -al /var/log/nginx/error.log
-rw-r----- 1 nginx adm 20313 Jun  5 07:45 /var/log/nginx/error.log

Just in case, here is the goaccess config file:

time-format %H:%M:%S
date-format %Y/%m/%d
log-format %d %t %^, client: %h, server: %^, request: "%r", host: "%v", referrer: "%R"
config-dialog false
color-scheme 1
hl-header true
html-report-title Nginx error log statistics
no-color false
no-column-names false
no-progress false
with-mouse true
no-csv-summary false
all-static-files false
log-processing

All 13 comments

日志路径不存在导致

Can you please try running goaccess without specifying the config file?

got the same with a big file and small one same just before analysis finished.

[fmillan@FMillanMacbookAir:access_log]$ goaccess intranet.log --log-format=VCOMBINED  --log-format="%v %h %^ %^[%d:%t %^] "%r " %s %b "%R" "%u" %^ %^ [%^/%D]" -e -d -q -a  -o uno.html --num-tests=0 -
Parsing... [1,174,758] [6,282/s]
GoAccess - version 1.3 - Jun 17 2019 02:48:47
Config file: No config file used

Fatal error has occurred
Error occurred at: src/parser.c - read_log - 2728
Unable to open the specified log file. No such file or directory

The file is there:
Permissions:

access_log]$ ll intranet.log
-rw-r--r-- 1 username staff 523108731 Jun 21 16:55 intranet.log

This seems like an isolated issue to your machine. Are you able to try reading the log on a different machine? Also, please make sure that you are using the right log format AND make sure you have access to write the file uno.html

I try in another server same problem same line
the server was Centos 7
local OSX Mojave
and got the same results in both
I'll try it on another laptop

same with another OS, but, when i try custom on console it works OK

~$ goaccess -f Desktop/intranet.log   --log-format=VCOMBINED --log-format="%v %h %^ %^[%d:%t %^] "%r " %s %b "%R" "%u" %^ %^ [%^/%D]" -e -d -q -a -o uno.html --num-tests=0 -c
Parsing... [1,175,137] [3,329/s]
GoAccess - version 1.2 - Jun 19 2017 12:55:29
Config file: /etc/goaccess.conf

Fatal error has occurred
Error occured at: src/parser.c - read_log - 2669
Unable to open the specified log file. No such file or directory

see screenshot with console after it analize:
Screenshot from 2019-06-22 15-31-19

I did another test on squid logs and worked ok with a similar log-format
nginx custom:

caseworkpractice.intranet.facs.nsw.gov.au 172.26.72.26 - p_xie [21/Jun/2019:03:12:02 +1000] "GET /__data/assets/file/0010/345709/Contract-foster-carer-assessment.docx HTTP/1.1" 200 641/78311 "-" "Mozilla/5.0 (compatible; Funnelback)" "f5qohqbvnnietorlmdj42c2ghfij9i3dhf7t03g064fdbvo9k2gtdg6lu3m56d4q58lb467jl4fniv29l3udq0j0cs5621el744g7a0" close [-/0.000]

log-format %v %h %^ %^[%d:%t %^] %m %U %H %s %b "%R" "%u" %^ %^ [%^/%D]'

squid custom:

housinghub.intranet.facs.nsw.gov.au 172.26.72.26 - - [09/Jun/2019:03:48:03 +1000] "GET https://housinghub.intranet.facs.nsw.gov.au/training-and-systems/homes-support/source/homes-reports/pre-homes-corporate-reports/pre-homes-corporate-reports-prior-to-november-2011/estates-and-rents-statistical-report HTTP/1.1" 200 121406 "-" "Mozilla/5.0 (compatible; Funnelback)" TCP_MISS:FIRST_UP_PARENT 1090

log-format %v %h %^ %^[%d:%t %^] "%r" %s %b "%R" "%u" %^

So is this working now?

when run the console it parse the file, but when i try to export to html does not work and failed at a few lines before the file ends

if it fails right before it writes to it, it is likely due to some sort of permissions on that folder. who owns the goaccess process and the destination folder? can you run it as root?

run it as root as well in Linux server, run it with sudo in the mac run it as root in the Linux that I sent the image as the error says it looks like goaccess can't read the source file (the log file)
I'll try to reinstall in the mac now and try again.

I came across this error today. I believe it was because I was omitting the > before the HTML file name example.log > example.html. Once I added it, I could get passed the parse error.

@thejimbirch Thanks for sharing that!

Closing this. Feel free to reopen it as needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

domainoverflow picture domainoverflow  ·  3Comments

Tassleh0ff picture Tassleh0ff  ·  4Comments

vivekkrish picture vivekkrish  ·  3Comments

securixhk picture securixhk  ·  3Comments

Gill-Bates picture Gill-Bates  ·  3Comments