Could not read settings from webapp-config! (net-www/awstats-6.7-r2)

Der Installationsversuch des Weblog-Analyzers »awstats« auf einem Gentoo-Server schlug fehl, da angeblich die webapp-config Datei nicht gelesen werden. Die Prüfung dieser Datei im Verzeichnis /etc/vhosts/ zeigte aber keine auffälligen Hinweise auf einen Fehler hin. Bevor aber auf die Lösung eingegangen wird, hier die Fehlermeldung:

# emerge awstats
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) net-www/awstats-6.7-r2 to /
 * awstats-6.7.tar.gz RMD160 SHA1 SHA256 size ;-) ...                     [ ok ]
 * checking ebuild checksums ;-) ...                                      [ ok ]
 * checking auxfile checksums ;-) ...                                     [ ok ]
 * checking miscfile checksums ;-) ...                                    [ ok ]
 * checking awstats-6.7.tar.gz ;-) ...                                    [ ok ]
Traceback (most recent call last):
  File "/usr/sbin/webapp-config", line 27, in <module>
    from WebappConfig.config import Config
ImportError: No module named WebappConfig.config
 *
 * ERROR: net-www/awstats-6.7-r2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_setup
 *               ebuild.sh, line 1244:  Called webapp_pkg_setup
 *           webapp.eclass, line  378:  Called webapp_read_config
 *           webapp.eclass, line   60:  Called die
 * The specific snippet of code:
 *              ENVVAR=$(${WEBAPP_CONFIG} --query ${PN} ${PVR}) ||
* die "Could not read settings from webapp-config!"
 *  The die message:
 *   Could not read settings from webapp-config!
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-www/awstats-6.7-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-www/awstats-6.7-r2/temp/die.env'.
 *

 * Messages for package net-www/awstats-6.7-r2:

 *
 * ERROR: net-www/awstats-6.7-r2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_setup
 *               ebuild.sh, line 1244:  Called webapp_pkg_setup
 *           webapp.eclass, line  378:  Called webapp_read_config
 *           webapp.eclass, line   60:  Called die
 * The specific snippet of code:
 *              ENVVAR=$(${WEBAPP_CONFIG} --query ${PN} ${PVR}) || die "Could not read settings from webapp-config!"
 *  The die message:
 *   Could not read settings from webapp-config!
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-www/awstats-6.7-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-www/awstats-6.7-r2/temp/die.env'.
 *

Der wichtige Part dieses Auszugs ist folgende Fehlermeldung:

 *  The die message:
 *   Could not read settings from webapp-config!

Lösung: python-updater und Neuinstallation von webapp-config

Bei der Fehlersuche ist aufgefallen, dass zwar Python 2.5 auf dem System installiert ist, aber noch nicht "scharf geschaltet" war. Wenn Python noch nicht aktualisiert wurde, so sollte man dies mit folgendem Befehl tun:

# python-updater

Anschließend ist es erforderlich, das Paket webapp-config neu zu installieren:

# emerge webapp-config

Nach der Installation wird auch deutlich, warum awstats sich nicht installieren ließ:

* Messages for package app-admin/webapp-config-1.50.16-r1:

* Now that you have upgraded webapp-config, you **must** update your
* config files in /etc/vhosts/webapp-config before you emerge any
* packages that use webapp-config.
* GNU info directory index is up-to-date.
* IMPORTANT: 1 config files in '/etc' need updating.
* See the CONFIGURATION FILES section of the emerge
* man page to learn how to update config files.

Portage weist uns darauf hin, dass die Konfigurationsdatei von webapp-config aktualisiert werden muss, was uns in ähnlicher Form in der Emerge-Fehlermeldung von awstats angezeigt wurde. Wir müssen nun mit etc-update gefolgt von einem -3 und Y die Config-Datei aktualisieren:

# etc-update
Scanning Configuration files...
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/vhosts/webapp-config (1)
Please select a file to edit by entering the corresponding number.
(don't use -3, -5, -7 or -9 if you're unsure what to do)
(-1 to exit) (-3 to auto merge all remaining files)
(-5 to auto-merge AND not use 'mv -i')
(-7 to discard all updates)
(-9 to discard all updates AND not use 'rm -i'): -3

Replacing /etc/vhosts/webapp-config with /etc/vhosts/._cfg0000_webapp-config
mv: overwrite `/etc/vhosts/webapp-config'? Y

Exiting: Nothing left to do; exiting. :)

Danach kann awstats problemlos installiert werden.