Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File not found if using config file #198

Closed
poblabs opened this issue Dec 21, 2014 · 12 comments
Closed

File not found if using config file #198

poblabs opened this issue Dec 21, 2014 · 12 comments

Comments

@poblabs
Copy link

poblabs commented Dec 21, 2014

Hi there, I've installed goaccess using yum on CentOS 6.6.

I've defined a custom log format and log file using /etc/goaccess.conf. I get the error below when I just run goaccess. Here's my config:

/etc/goaccess.conf

date-format %d/%b/%Y
log-format %v %h %^[%d:%^] "%r" %s %b
log-file /var/log/httpd/all_sites-access_log

I get this error:

GoAccess - version 0.8.2 - Jul 25 2014 01:55:08

Fatal error has occurred
Error occured at: parser.c - parse_log - 1071
No such file or directory

The log file does exist. If I run goaccess -f /var/log/httpd/all_sites-access_log it works right away.

Any thoughts?

I also have a 2nd question on if it's possible to view which site is being accessed in real time based off the %v VirtualHost? Right now I see a lot of stats, which is great, but it's not displaying the %v VirtualHost anywhere, so it's a little tough to follow

Thanks!

@allinurl
Copy link
Owner

Sounds like your sysconfdir is pointing to a different directory. Have you tried running goaccess with -p? e.g.,:

goaccess -p /etc/goaccess.conf

At this point goaccess does not show stats based on the virtualhost, however, I've been working on this #23 and I hope to have an implementation soon.

@poblabs
Copy link
Author

poblabs commented Dec 21, 2014

Yes, when I specify the conf file with -p, I get the same problem below.

I am to believe the config file is being called because it pulls my custom log-format, it excludes a range of IPs. It's just not finding the log-file within.

goaccess -p /etc/goaccess.conf

GoAccess - version 0.8.2 - Jul 25 2014 01:55:08

Fatal error has occurred
Error occured at: parser.c - parse_log - 1071
No such file or directory

Thanks for the update on the VirtualHost. I'm looking forward to that.

@allinurl
Copy link
Owner

Interesting, if in fact the config file is being read, then perhaps it could be rights problem. Would you be able to run strace on it?, it will output all the system calls (yum install strace):

strace -Ff -tt goaccess

You should see an open call in there with the output of it. Thanks!

@poblabs
Copy link
Author

poblabs commented Dec 21, 2014

Here's the open when trying to open the logfile. Looks like it doesn't like the formatting from the config file? (since it should be all_sites-access_log)

[pid 11669] 14:41:37.209167 open("/var/log/httpd/all-sites-access-log", O_RDONLY <unfinished ...>

@poblabs
Copy link
Author

poblabs commented Dec 21, 2014

Also, just to double check, here's the output from the config file:

[root@energy html]# cat /etc/goaccess.conf | grep log-file
#log-file /var/log/apache2/access.log
log-file /var/log/httpd/all_sites-access_log

[root@energy html]# ls -al /var/log/httpd/all_sites-access_log
-rw-r--r-- 1 root root 414524 Dec 21 14:45 /var/log/httpd/all_sites-access_log

@allinurl
Copy link
Owner

Got it. When reading the config file, underscores are replaced by dashes (here) for backwards compatibility.

I'll have a fix for this, in the meantime, you will need to rename the log file or specify it with -f.

@allinurl
Copy link
Owner

This has been fixed. Feel free to build from dev. It will be pushed out on the upcoming version.

Thanks again for reporting it!

@poblabs
Copy link
Author

poblabs commented Dec 21, 2014

Glad you were able to figure it out. I might not play with dev since i installed from rpm.

Looking forward to both updates (VirtualHost and this fix)

@antonioreyna
Copy link

i have the same problem on mac

@allinurl
Copy link
Owner

@antonioreyna this should work fine on the latest release.

@Jason-mor
Copy link

the version 1.3_1, i have the same problem on mac.

@allinurl
Copy link
Owner

@Jason-mor Can you please attach your config file and would you be able to run it through strace and attach the output as well? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants