Hello, I have a multiserver setup ispc3.2.7p1 I have exactly that same problem https://www.howtoforge.com/community/threads/awstats-not-working.85904/ Calling Code: php cron_debug.php --cronjob=150-awstats.inc.php returns with no delay and no error messages ("finished cron debug.") and no stats are written. There are no error messages in /var/log/syslog, /var/log/messages, /var/log/ispconfig/cron.log, /var/log/ispconfig/cron.log or /var/log/ispconfig/ispconfig.log. There are config files for the webhosts in /etc/awstats and when I run AWStats directly on its own with Code: /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=MYDOMAIN.COM -update -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/clients/clientXX/webXX/web/stats AWStats generates the reports. in 2020, there were a problem of webserver. I don't have any... Any idea where to look at ?
Did you do what was suggested on that other thread? Did you follow debugging instructions from https://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/ ? You migth start with https://www.howtoforge.com/community/threads/please-read-before-posting.58408/
Hello, That's true, awstats start to bug with upgrade to v3.2.7p1. So I checked what Jesse said : "You might check what server plugins are enabled, perhaps there's one for awstats that hasn't been enabled?". I looked system> server config > awstats. It seems to be configured correctly. I try `grep -r awstat /var/log/*` Empty answer. How can I check debug log in that particular case? I don't know how is managed awstat process... As I said, Code: /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=MYDOMAIN.COM -update -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/clients/clientXX/webXX/web/stats works It seems ispconfig manage it with a cron.d, but, more /etc/cron.d/awstats gives Code: #MAILTO=root # #*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh # ## Generate static reports: #10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh and grep -r awstats_buildstaticpages /etc/cron.d/* gives nothing... It seems to be in server/lib/classes/cron.d/150-awstats.inc.php But clearly above my php level...
Yes when I run Code: /usr/share/awstats/tools/awstats_buildstaticpages.pl -config=MYDOMAIN.COM -update -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir=/var/www/clients/clientXX/webXX/web/stats it builds 23 files... Can I move to webalizer and move back to awstats without killing everything ?
Is there another way to "reinstall" awstat ? Currently, I have no stats... May be I can copy files to keep datas ?
Unfortunately, I move to webalizer. Stay one day. But I have no webalizer results... In folder, still awstat results ! I set back awstats : I'll wait 24h more but I am not very optimistic ! Is there a way to reset, such as `rm /stats/ directory`
I did a lot of tests, restarts and so on. It still doesn't work. I am to the conclusion that something in not working on a daily basis. I run Code: php /usr/local/ispconfig/server/cron_debug.php --cronjob=150-awstats.inc.php It generates awstats results I turn server log to DEBUG and I see that Code: root@ns:/var/log/ispconfig# ls -lrt total 3472 drwxr-xr-x 5 root root 4096 Jul 1 2021 httpd -rw-r--r-- 1 root root 34 Mar 14 00:04 ispconfig.log.9.gz -rw-r--r-- 1 root root 4484 Mar 14 00:04 cron.log.9.gz -rw-r--r-- 1 root root 29 Mar 14 00:04 auth.log.9.gz -rw-r--r-- 1 root root 34 Mar 15 00:04 ispconfig.log.8.gz -rw-r--r-- 1 root root 4646 Mar 15 00:04 cron.log.8.gz -rw-r--r-- 1 root root 29 Mar 15 00:04 auth.log.8.gz -rw-r--r-- 1 root root 34 Mar 16 00:04 ispconfig.log.7.gz -rw-r--r-- 1 root root 4517 Mar 16 00:04 cron.log.7.gz -rw-r--r-- 1 root root 29 Mar 16 00:04 auth.log.7.gz -rw-r--r-- 1 root root 34 Mar 17 00:05 ispconfig.log.6.gz -rw-r--r-- 1 root root 4508 Mar 17 00:05 cron.log.6.gz -rw-r--r-- 1 root root 29 Mar 17 00:05 auth.log.6.gz -rw-r--r-- 1 root root 34 Mar 18 00:06 ispconfig.log.5.gz -rw-r--r-- 1 root root 4529 Mar 18 00:06 cron.log.5.gz -rw-r--r-- 1 root root 29 Mar 18 00:06 auth.log.5.gz -rw-r--r-- 1 root root 34 Mar 19 00:06 ispconfig.log.4.gz -rw-r--r-- 1 root root 4484 Mar 19 00:06 cron.log.4.gz -rw-r--r-- 1 root root 29 Mar 19 00:06 auth.log.4.gz -rw-r--r-- 1 root root 34 Mar 20 00:07 ispconfig.log.3.gz -rw-r--r-- 1 root root 4491 Mar 20 00:07 cron.log.3.gz -rw-r--r-- 1 root root 29 Mar 20 00:07 auth.log.3.gz -rw-r--r-- 1 root root 34 Mar 21 00:06 ispconfig.log.2.gz -rw-r--r-- 1 root root 4528 Mar 21 00:06 cron.log.2.gz -rw-r--r-- 1 root root 29 Mar 21 00:06 auth.log.2.gz -rw-r--r-- 1 root root 34 Mar 22 00:05 ispconfig.log.1.gz -rw-r--r-- 1 root root 4496 Mar 22 00:05 cron.log.1.gz -rw-r--r-- 1 root root 29 Mar 22 00:05 auth.log.1.gz -rw-rw---- 1 ispconfig ispconfig 0 Mar 22 00:05 auth.log -rw------- 1 root root 688664 Apr 14 17:17 ispconfig.log -rw-rw---- 1 root root 2696797 Apr 14 17:17 cron.log You can see that there is no gzipped log from 22th of march (like my issue with awstats) ispconfig.log file contains several day of log... Digging cron.log, Code: grep -v finished server.php cron.log | grep -v ispconfig_lock | grep -v webserver_plugin | grep -v 'return code: 0' I found Code: cron.log:Tue 22 Mar 2022 02:01:11 AM CET W: Failed to fetch https://packaging.gitlab.io/janus/focal/dists/focal/InRelease Temporary failure resolving 'packaging.gitlab.io' cron.log:Tue 22 Mar 2022 02:01:11 AM CET W: Some index files failed to download. They have been ignored, or old ones used instead. cron.log:Tue 22 Mar 2022 03:00:27 AM CET Saving debug log to /var/log/letsencrypt/letsencrypt.log cron.log:Tue 22 Mar 2022 03:00:27 AM CET Cert not yet due for renewal cron.log:Tue 22 Mar 2022 03:00:27 AM CET Cert not yet due for renewal cron.log:Tue 22 Mar 2022 03:00:27 AM CET Cert not yet due for renewal cron.log:Sat 02 Apr 2022 05:24:01 PM CEST /usr/local/ispconfig/server/server.sh: line 22: 3721085 Segmentation fault /usr/bin/php -q -d disable_classes= -d disable_functions= -d open_basedir= /usr/local/ispconfig/server/server.php cron.log:Mon 04 Apr 2022 10:11:02 AM CEST /usr/local/ispconfig/server/server.sh: line 29: 30895 Segmentation fault /usr/bin/php -q -d disable_classes= -d disable_functions= -d open_basedir= /usr/local/ispconfig/security/check.php cron.log:Tue 05 Apr 2022 04:48:01 AM CEST /usr/bin/php: /lib/x86_64-linux-gnu/libicuuc.so.66: no version information available (required by /lib/x86_64-linux-gnu/libxml2.so.2) cron.log:Tue 05 Apr 2022 04:48:01 AM CEST /usr/bin/php: symbol lookup error: /lib/x86_64-linux-gnu/libxml2.so.2: undefined symbol: lzma_properties_decode, version XZ_5.0 cron.log:Wed 06 Apr 2022 07:25:01 PM CEST /usr/local/ispconfig/server/cron.sh: line 17: 746732 Segmentation fault $(which php) -q -d disable_classes= -d disable_functions= -d open_basedir= /usr/local/ispconfig/server/cron.php First failure is probably linked to an apt update. Nothing to do with ispconfig... janus is working properly (tested) Can you tell me how to test ispc daily cron if that exists... ?
You asked how to test the awstats cronjob and that's the command how to test it. So what does it mean that awstats don't get created nightly and don't get created when you run it manually? It shows you that the issue is not that the statistics cronjob is not executed. So if you want to get further into debugging this, you must look at the code, add some debug code like echo commands, to see which code segments and commands get run with which parameters inside the cronjob.
These php lines don't look healthy. What have you done to the base PHP version of the OS? OS Upgrade? PHP Upgrade?
@michelangelo I don't know because it is quite far from now and I didn't see it before today. What is sure is that, there is no ubuntu upgrade, nor php upgrade... (php7.4) @till Sorry for being confusing and for insisting so much on that. I was not clear. At the very beginning Code: php /usr/local/ispconfig/server/cron_debug.php --cronjob=150-awstats.inc.php doesn't work. But, after all the tests, cleaning (etc...) I did it works finally. This is to say, when running cron_debug.php, it creates data. What is not running is : during the night nothing happens... nor awstats update, nor ispconfig.log rotate and gzipped... What I did tonight is that I run Code: ispconfig_update.sh Let see tomorrow morning if something happens
ispconfig update had no effect. But, I found that : ps -aux | grep cron Code: root 300843 0.0 0.0 9492 3284 ? Ss Mar22 0:00 /bin/bash -c /usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done root 300848 0.0 0.0 9492 3208 ? S Mar22 0:00 /bin/bash /usr/local/ispconfig/server/cron.sh root 300849 0.0 0.0 9492 224 ? S Mar22 0:00 /bin/bash -c /usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done root 300855 99.8 0.4 641076 38044 ? R Mar22 34735:19 /bin/php -q -d disable_classes= -d disable_functions= -d open_basedir= /usr/local/ispconfig/server/cron.php root 1336448 0.0 0.0 9512 2964 ? Ss Apr08 0:29 /usr/sbin/cron -f root 1801159 0.0 0.0 9492 3300 ? Ss Feb18 0:00 /bin/bash -c /usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done root 1801165 0.0 0.0 9492 1904 ? S Feb18 0:00 /bin/bash -c /usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done root 3289955 0.0 0.0 9032 724 pts/0 S+ 08:00 0:00 grep --color=auto cron and grep -r WARNING /var/log/* Code: /var/log/ispconfig/cron.log:Thu 14 Apr 2022 01:41:01 AM CEST 14.04.2022-01:41 - WARNING - There is already a lockfile set, but no process running with this pid (2906709). Continuing. I kill all that processes. Let's see tomorrow...
That's a problem I get just today!! I got a solution but don't know why I have to do this, supposing all the system is unchanged since 6 month (only regular ubuntu updates) I rewrote the buildstatic.sh in /usr/share/awstats/tools and now there are no problems at all Code: #!/bin/sh ## ## buildstatic.sh, written by Sergey B Kirpichev <[email protected]> ## ## Build all static html reports from AWStats data (Debian specific) ## set -e DEFAULT=/etc/default/awstats AWSTATS=/usr/lib/cgi-bin/awstats.pl BUILDSTATICPAGES=/usr/share/awstats/tools/awstats_buildstaticpages.pl ERRFILE=`mktemp --tmpdir awstats.XXXXXXXXXX` YEAR=`date +%Y` MONTH=`date +%m` trap 'rm -f $ERRFILE' INT QUIT TERM EXIT [ -f $AWSTATS -a -f $BUILDSTATICPAGES ] || exit 1 # Set default AWSTATS_NICE=10 AWSTATS_ENABLE_BUILDSTATICPAGES="yes" AWSTATS_LANG="" [ ! -r "$DEFAULT" ] || . "$DEFAULT" # For compatibility: handle empty AWSTATS_ENABLE_CRONTABS as "yes": [ "${AWSTATS_ENABLE_CRONTABS:-yes}" = "yes" -a \ "$AWSTATS_ENABLE_BUILDSTATICPAGES" = "yes" ] || exit 0 cd /etc/awstats for c in `/bin/ls -1 awstats.*.conf 2>/dev/null | \ /bin/sed 's/^awstats\.\(.*\)\.conf/\1/'` \ `[ -f /etc/awstats/awstats.conf ] && echo awstats` do mkdir -p /var/www/$c/web/stats/$YEAR/$MONTH/ if ! nice -n $AWSTATS_NICE $BUILDSTATICPAGES \ -config=$c \ -year=$YEAR \ -month=$MONTH \ -lang=$AWSTATS_LANG \ -staticlinksext=html \ -dir=/var/www/$c/web/stats/$YEAR/$MONTH/ >$ERRFILE 2>&1 then cat $ERRFILE >&2 # an error occurred else ln -fs /var/www/$c/web/stats/$YEAR/$MONTH/awstats.$c.html \ /var/www/$c/web/stats/$YEAR/$MONTH/awsindex.html fi USER=$(stat -c '%U' /var/www/$c/web/stats) GROUP=$(stat -c '%G' /var/www/$c/web/stats) chown -R $USER:$GROUP /var/www/$c/web/stats done