Closed swar0g closed 4 years ago
日志路径不存在导致
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:
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.
just a small addition for those who struggle with this misleading error message. In my case it was because of a specified --db-path
which was missing on filesystem.
Generating an example report for the last 30d:
$ grep example.com /var/www/example/logs/access.log | goaccess - --restore --persist -o /var/www/example/public_html/stats/index.html --db-path /var/www/example/public_html/stats/db/ --keep-last=30
If in this case /var/www/example/public_html/stats/db
directory was missing, I run into above Unable to open the specified log file. No such file or directory error which was completely misleading as it referred to /etc/goaccess.conf
which was always accessible under that user. Creating the db directory fixed it.
@onlime Thanks for sharing that feedback. I've updated the error message to be more descriptive. It will be pushed out in the upcoming version. It reads now as:
Unable to open the specified db path/file '/tmp/test-path/'. No such file or directory
In my case this exact error got triggered by setting anonymize-ip yes
(instead of true
or false
) which caused goaccess
to look for a file named yes
, which did not exist. The patch above will make this clearer in the future. (It may also help to show an error if a boolean setting is set to an invalid value instead of regarding it as a filename.)
GoAccess - version 1.4 - Jul 23 2020 10:55:20
Config file: ./goaccess.conf
Fatal error has occurred
Error occurred at: src/parser.c - read_log - 2730
Unable to open the specified log file. No such file or directory
@vszakats Thanks for sharing that info. Makes sense to show that if a boolean setting is set to an invalid value. Let me look into that as well.
Hi,
I am getting the following error trying to parse nginx error.log with goaccess:
But the file definitely exists in the location:
Just in case, here is the goaccess config file: