Virtual server restore - awstats error

During a virtual server restore the process got (I assume right to the end) and showed an awstats error (a tmp file was not found) everything else was successful. The virtual server restored correctly and is running fine however the awstats report is no longer available.

Now when I open the AWStats Report for that Virtual Server is is completely empty and shows the alert "Never updated (See 'Build/Update' on awstats_setup.html page)". So I go to the AWStats Configuration page leave everything as default and click the following error

Error - Perl execution failed

Undefined subroutine &virtual_server::get_domain_by called at /usr/libexec/webmin/virtualmin-awstats/generate.cgi line 11.

Any guidance on re-setting the awstats config would be appreciated.

Status: 
Closed (fixed)

Comments

I got the same error. I think it came after a theme update. I try to change the theme but still got the same error. I am suspecting one of the updated package if it is not coming from the theme.

Centos 7 Fully updated. It season atat automatic generation worked this morning. Manually giving the error.

Which version of the AWstats plugin are you running there? You can see it in the file /usr/libexec/webmin/virtualmin-awstats/module.info

I could not find the file you mentionned but from the report it seems that the version is: Advanced Web Statistics 7.2 (build 1.992). And as the previous poster mentioned the cron job updated the AWSTATS reports last night. I suspect a template/theme issue. It is only happening when you generate/update the reports manually.

Joe's picture
Submitted by Joe on Thu, 09/21/2017 - 00:07 Pro Licensee

You can also ask the package manager what version you have:

# rpm -q wbm-virtualmin-awstats

Same as Gratous , Advanced Web Statistics 7.2 (build 1.992)

rpm -q wbm-virtualmin-awstats--> wbm-virtualmin-awstats-5.5-1.noarch

//Mattias

Looks like we need a new 5.6 release that includes a fix for the original issue. Joe, I've updated the version to 5.6 in git, so you can roll it out.

wbm-virtualmin-awstats-5.5-1.noarch

If it helps at all, I just run the restore again and here is the output with the error at the end

Starting restore of 1 domains from local file /backup/atl2-21-09-2017/acmecorp.com.tar.gz ..

Extracting backup archive file ..
.. done

Restoring backup for virtual server acmecorp.com ..

    Restoring virtual server password, quota and other details ..
    .. done

    Updating administration password and quotas ..
    .. done

    Restoring Cron jobs ..
    .. done

    Extracting TAR file of home directory ..
    .. done

    Setting ownership of home directory ..
    .. done

    Restoring Apache virtual host configuration ..
    .. done

    Checking restored PHP execution mode ..
    .. mode FCGId OK for this system

    Updating home directory in PHP configuration ..
    .. done

    Restoring Apache log files ..
    .. done

    Restoring SSL Apache virtual host configuration and certificate ..
    .. done

    Restoring allowed MySQL hosts ..
    .. done

    Deleting old MySQL databases ..
    .. done

    Re-loading MySQL database acmecorp ..
        Creating MySQL database acmecorp ..
        .. done

    .. done

    Restoring Webmin ACL files ..
    .. done

    Restoring AWstats configuration file ..
    .. done

    Restore failed : Failed to open /home/acmecorp/public_html/cgi-bin/awstats.pl.webmintmp.1253 : No such file or directory
Joe's picture
Submitted by Joe on Thu, 09/21/2017 - 23:28 Pro Licensee

Status: Active » Fixed

I'm syncing the repos with the new version of the awstats module now. Should be available in a few minutes.

I just loaded the latest update module and I still get the same error Undefined subroutine &virtual_server::get_domain_by called at /usr/share/webmin/virtualmin-awstats/generate.cgi line 11.

Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.netsite.dk * extras: mirror.netsite.dk * updates: mirrors.glesys.net Resolving Dependencies --> Running transaction check ---> Package wbm-virtualmin-awstats.noarch 2:5.5-1 will be updated ---> Package wbm-virtualmin-awstats.noarch 2:5.6-1 will be an update --> Processing Dependency: wbm-software for package: 2:wbm-virtualmin-awstats-5.6-1.noarch --> Processing Dependency: wbm-cron for package: 2:wbm-virtualmin-awstats-5.6-1.noarch --> Finished Dependency Resolution Error: Package: 2:wbm-virtualmin-awstats-5.6-1.noarch (virtualmin-universal) Requires: wbm-cron Error: Package: 2:wbm-virtualmin-awstats-5.6-1.noarch (virtualmin-universal) Requires: wbm-software You could try using --skip-broken to work around the problem ** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows: libmodule-10.0.0.1696-b10_0_0_1696.x86_64 has missing requires of libodbc.so.1()(64bit)

I am seeing this same issue as well.

[ERROR] Something went wrong. Exiting.
[ERROR] The last few log entries were:
Warning: Group virtualmin-lamp does not have any packages.
Installing dependencies and system packages: Success.
Spin pid is: 14952
Package perl-Log-Log4perl-1.30-1.el6.noarch already installed and latest version
Package 1:perl-parent-0.221-144.el6.x86_64 already installed and latest version
Package 1:perl-Module-Load-0.16-144.el6.x86_64 already installed and latest version
Error: Package: 2:wbm-virtualmin-awstats-5.6-1.noarch (virtualmin-universal)
           Requires: wbm-cron
Error: Package: 2:wbm-virtualmin-awstats-5.6-1.noarch (virtualmin-universal)
           Requires: wbm-software
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Installing Virtualmin and all related packages: [2017-09-22 08:46:32 UTC] [ERROR] Failed with error: 1
[2017-09-22 08:46:32 UTC] [ERROR] Something went wrong. Exiting.
[2017-09-22 08:46:32 UTC] [ERROR] The last few log entries were:
Joe's picture
Submitted by Joe on Fri, 09/22/2017 - 05:52 Pro Licensee

OK, packaging problem has been fixed in 5.6-2. Update and try again.

Not 100% sure what I was meant to do, so I just ran a yum update, followed by bash install.sh for virtualmin, and still getting the same output..

[ERROR] Something went wrong. Exiting.
[ERROR] The last few log entries were:
Installing dependencies and system packages: Success.
Spin pid is: 30634
Package perl-Log-Log4perl-1.30-1.el6.noarch already installed and latest version
Package 1:perl-parent-0.221-144.el6.x86_64 already installed and latest version
Package webmin-1.852-1.noarch already installed and latest version
Package 1:perl-Module-Load-0.16-144.el6.x86_64 already installed and latest version
Error: Package: 2:wbm-virtualmin-awstats-5.6-1.noarch (virtualmin-universal)
           Requires: wbm-cron
Error: Package: 2:wbm-virtualmin-awstats-5.6-1.noarch (virtualmin-universal)
           Requires: wbm-software
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Installing Virtualmin and all related packages: [2017-09-22 11:41:08 UTC] [ERROR] Failed with error: 1
[2017-09-22 11:41:08 UTC] [ERROR] Something went wrong. Exiting.
[2017-09-22 11:41:08 UTC] [ERROR] The last few log entries were:

You did run old broken update. Scan for new.

Joe's picture
Submitted by Joe on Fri, 09/22/2017 - 07:11 Pro Licensee

If doing from command line:

# yum clean all
# yum update

If in Virtualmin, click "Refresh available packages"

I had same issue on centos 7, yum clean all did not work, but
doing rm -rf /var/cache/yum followed by yum update fixed the issue

No longer get an errors running this script but it still does not produce a 100% functioning report as the AWStats Report screen for this domain still shows as below

Statistics for: localhost.localdomain

Last Update: Never updated (See 'Build/Update' on awstats_setup.html page)

When you click a month and refresh the report is shows some stats but having to do that every time you view the report is less than ideal?

This is only the case for the virtual server that was restored.

Works for me now. Thanks. Great job!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.