2

I'm getting this error from AWStats 7.2 cron job (on Ubuntu 14.04, using stock awstats package) when reading an icecast log via a pipe to filter out one vhost:

Error while processing /etc/awstats/awstats.mysite.conf
Create/Update database for config "/etc/awstats/awstats.mysite.conf" by AWStats version 7.2 (build 1.992)
From data in log file "grep '\/mysite' < /var/log/icecast2/access.log |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Error: Command for pipe 'grep '\/mysite' < /var/log/icecast2/access.log |' failed
Setup ('/etc/awstats/awstats.mysite.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

At face value, this looks like a simple permissions problem, but both the config and log files are readable by the www-data user this runs under. If I shell into that user account, I can read both files without a problem.

#sudo -u www-data ls -al /etc/awstats/awstats.mysite.conf /var/log/icecast2/access.log
-rw-r--r-- 1 www-data www-data 444 May 13 11:23 /etc/awstats/awstats.mysite.conf
-rw-r--r-- 1 icecast2 icecast    0 Jun  8 05:29 /var/log/icecast2/access.log

If I run the grep command under the same user, that works fine too.

To avoid spurious issues, I've disabled all plugins - I'm only using geoip anyway, so the setup is pretty vanilla. If I run the awstats command manually with full --debug=6 output it looks like it's not having any trouble reading the file - the error is thrown when the file is closed. As it happens, this log file is currently empty so there is nothing to analyse, but surely that should not generate a permissions error?

Sat Jun 13 20:33:21 2015 - DEBUG 1 - Start Update process (lastprocesseddate=201505)
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Open log file "grep '\/mysite' < /var/log/icecast2/access.log |"
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  _host_p:0 _host_h:0 _host_k:0 _host_l:0 _host_s:0 _host_u:0

Sat Jun 13 20:33:21 2015 - DEBUG 1 -  _url_p:0 _url_k:0 _url_e:0 _url_x:0

Sat Jun 13 20:33:21 2015 - DEBUG 1 -  _waithost_e:0 _waithost_l:0 _waithost_s:0 _waithost_u:0

Sat Jun 13 20:33:21 2015 - DEBUG 1 - End of processing log file (AWStats memory cache is TmpDNSLookup=0 TmpBrowser=0 TmpOS=0 T
mpRefererServer=0 TmpRobot=0)
....(lots of stuff that seems related to successful processing and output deleted)
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update offset of section sider_404=10022 in file at offset 1381
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthVisits=290 in file at offset 2140
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthUnique=168 in file at offset 2173
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthHostsKnown=0 in file at offset 2210
Sat Jun 13 20:33:21 2015 - DEBUG 1 -  Update MonthHostsUnknown=182 in file at offset 2249
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Call to Init_HashArray
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Close log file "grep '\/mysite' < /var/log/icecast2/access.log |"
Sat Jun 13 20:33:21 2015 - DEBUG 1 - Command for pipe 'grep '\/mysite' < /var/log/icecast2/access.log |' failed

What have I missed?

Synchro
  • 2,983
  • 5
  • 25
  • 35

0 Answers0