Univention Bugzilla – Bug 24760
improve debugging of univention updater
Last modified: 2020-07-02 00:54:41 CEST
Es kommt öfters vor, das im Updater-Prozeß Fehler gesucht werden müssen und in den /etc/apt/sources.list.d/* Dateien dann nur eine wenig aussagekräftige Exception steht. Bisher helfe ich mir dann immer damit, UniventionUpdater direkt aus einer interaktiven Shell heraus aufzurufen und darüber den Fehlerfall zu provozieren. Das ist zeitaufwändig und fehleranfällig. Hilfreich wäre hier eine Kommandozeilenoption oder UCR-Einstellung, über den man ausführliche Informationen dazu bekommt, was der Updater gerade wo macht. Wichtig wäre mir hier vorallem (Zwischen-)Informationen zum Prozeß als nur das Ergebnis am Ende, das "etwas" schiefgegangen ist. 1. Ausgabe der HTTP-Anfragen und deren Antworten: /usr/share/pyshared/univention/updater/tools.py:271 http_handler = urllib2.HTTPHandler(debuglevel=1) ... opener = urllib2.build_opener(http_handler, ...) from univention.updater import UniventionUpdater u = UniventionUpdater() print u.print_component_repositories()
Beim Updater funktioniert auch folgendes in einer interaktiven Python-Session: import univention.debug as ud from univention.updater.tools import UniventionUpdater ud.init('stderr', ud.NO_FLUSH, ud.NO_FUNCTION) ud.set_level(ud.NETWORK, ud.ALL) updater = UniventionUpdater() print updater.print_errata_repositories()
We should introduce an easy way to enable verbose debugging. Bug #36548 required some very deep hacking to get the right data for the analysis. See <https://hutten.knut.univention.de/mediawiki/index.php/Philipp_memo/debug#Univention_Updater> for my internal notes.
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4. If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
This issue has been filed against UCS 3.0. UCS 3.0 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.
This is still a problem with UCS-4.2: I get asked that very often, how to debug the updater. <https://hutten.knut.univention.de/mediawiki/index.php/Philipp_memo/debug#Univention_Updater> is a good start, but not for users or support.
ucs-3.0/ucs@34053 from 2012-07-10 introduced a bug in tools.py, which I can trigger with repository/online=no: > File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit > msg = self.format(record) > File "/usr/lib/python2.7/logging/__init__.py", line 734, in format > return fmt.format(record) > File "/usr/lib/python2.7/logging/__init__.py", line 465, in format > record.message = record.getMessage() > File "/usr/lib/python2.7/logging/__init__.py", line 329, in getMessage > msg = msg % self.args > ValueError: incomplete format > Logged from file tools.py, line 554 [4.3-0] a62e50db18 Bug #24760 up: Fix format string error
With Bug #47913 there is UCRV updater/debug/level, but that works only for "univention-updater" and not with any other tool. Initializing the Python logging system is still very useful for debugging.