Bug 27376 - Listener: Exception wird falschem Modul zugeordnet
Listener: Exception wird falschem Modul zugeordnet
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 3.0
All Linux
: P5 normal (vote)
: UCS 3.1
Assigned To: Philipp Hahn
Stefan Gohmann
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-31 10:17 CEST by Philipp Hahn
Modified: 2012-12-12 21:11 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Troubleshooting
Max CVSS v3 score:


Attachments
Error handling when loading modules (7.61 KB, patch)
2012-05-31 12:32 CEST, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2012-05-31 10:17:17 CEST
Beim Schreiben eines Listener-Moduls wurde plötzlich im 'pkgdb-watch'-Listener ein Fehler gemeldet, obwohl der völlig korrekt war.
Eigentlicher Verursacher war aber das vorhergehende Modul, in diesem Fall das neue Modul:

> LISTENER (INFO ) importing handler /usr/lib/univention-directory-listener/system/multi-master-push.py
> LISTENER (INFO ) Load file /usr/lib/univention-directory-listener/system/multi-master-push.py
> LISTENER (ALL  ) Parse file /usr/lib/univention-directory-listener/system/multi-master-push.py
> LISTENER (ALL  ) pyNode compile /usr/lib/univention-directory-listener/system/multi-master-push.py
> LISTENER (ALL  ) execCodeModuleEx /usr/lib/univention-directory-listener/system/multi-master-push.py
> LISTENER (ALL  ) mmp.init()
> LISTENER (ALL  ) Module done /usr/lib/univention-directory-listener/system/multi-master-push.py

Hier müsste jetzt eigentlichd die Fehlermeldung stehen,

> LISTENER (INFO ) importing handler /usr/lib/univention-directory-listener/system/pkgdb-watch.py
> LISTENER (INFO ) Load file /usr/lib/univention-directory-listener/system/pkgdb-watch.py
> LISTENER (ALL  ) Parse file /usr/lib/univention-directory-listener/system/pkgdb-watch.py
> LISTENER (ALL  ) pyNode compile /usr/lib/univention-directory-listener/system/pkgdb-watch.py
> LISTENER (ERROR) import of filename=/usr/lib/univention-directory-listener/system/pkgdb-watch.py failed
> AttributeError: 'module' object has no attribute 'filter'

sie kommt aber erst hier.

> LISTENER (ERROR) import of filename=/usr/lib/univention-directory-listener/system/pkgdb-watch.py failed
> TypeError: argument must be string, not bool

Nach ein paar Anpassungen am eigenen mmp-Modul hatte ich dann diese Meldung.

Hier sollte die Fehlerbehandlung in handler_import() in src/handlers.c:191 überprüft und korrigietr werden.
Comment 1 Philipp Hahn univentionstaff 2012-05-31 12:32:59 CEST
Created attachment 4422 [details]
Error handling when loading modules

Der Patch hat mit jetzt erlaubt zu erkennen, das "modrdn" eine Zeichenkette sein muß (und kein bool'scher Wert sein darf)

Neben der Fehlerbehandlung der Python-Fehler korrigiert der Patch auch Speicherlecks im Fehlerfall.
Comment 2 Philipp Hahn univentionstaff 2012-09-05 11:56:02 CEST
Patch wurde übernommen.

svn35237, univention-directory-listener_7.0.1-1.156.201209051131

ChangeLog: svn14594
\item The reporting of errors in Python Listener modules has been improved (\ucsBug{27376}).
Comment 3 Stefan Gohmann univentionstaff 2012-09-11 09:19:12 CEST
Im Fehlerfall sind die Hinweise jetzt deutlich ausführlicher und das passende Modul wird angegeben.

Changelog: OK.
Comment 4 Stefan Gohmann univentionstaff 2012-12-12 21:11:08 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

If this error occurs again, please use "Clone This Bug".