fix(bugreport): collect the install log from the live, and the crash traceback
A report sent from the live medium carried the system summary and the journal, and nothing else. That is exactly what came back from a real installer crash on RST hardware, and it was not enough to diagnose anything. Two gaps, both of which made an installer failure unreportable. The install log was only looked for at /var/log/fws-post.log, which exists on the installed system. During an installation it is the %post --nochroot that copies it into the live's /tmp, because the target disk is unmounted by the time anyone needs to read it. Both paths are searched now. This is the log that says whether the disk will boot. /tmp/anaconda-tb-* was never collected at all. When the installer crashes, the dialog shows only the dasbus wrapper frames and the real exception lives in that file alone. The live runs in tmpfs, so it dies with the next reboot: without it in the report, a crash cannot be looked at afterwards by anyone. Verified on four situations: installed system, live without a crash, live with one, and neither file present, which adds no empty section. Signed-off-by: nocode <suzuku295@gmail.com>
This commit is contained in:
1 parent
90167c54b6
commit
9529a653be
1 file changed
+44
-3
@@ -306,13 +306,54 @@ def _journal_excerpt(max_lines=200):
|
||||
return True, "\n".join(lines)
|
||||
|
||||
|
||||
def _anaconda_traceback():
|
||||
"""Le fichier /tmp/anaconda-tb-* le plus récent, s'il existe.
|
||||
|
||||
Quand l'installateur plante, la boîte de dialogue n'affiche que les cadres
|
||||
d'appel de l'enveloppe dasbus : la véritable exception n'est QUE dans ce
|
||||
fichier. Sans lui, un plantage d'installation est indiagnosticable à
|
||||
distance — et comme le live tourne en tmpfs, tout disparaît au redémarrage.
|
||||
"""
|
||||
try:
|
||||
names = [os.path.join("/tmp", f) for f in os.listdir("/tmp")
|
||||
if f.startswith("anaconda-tb-")]
|
||||
except OSError:
|
||||
return ""
|
||||
newest, newest_mtime = "", -1.0
|
||||
for name in names:
|
||||
try:
|
||||
if not os.path.isfile(name):
|
||||
continue
|
||||
mtime = os.path.getmtime(name)
|
||||
except OSError:
|
||||
continue
|
||||
if mtime > newest_mtime:
|
||||
newest, newest_mtime = name, mtime
|
||||
return newest
|
||||
|
||||
|
||||
def _collect_diagnostics(osr):
|
||||
parts = ["===== Informations système =====", _system_summary(osr)]
|
||||
post_log = "/var/log/fws-post.log"
|
||||
if os.path.isfile(post_log):
|
||||
# Deux emplacements, et il FAUT les deux : sur le système installé le log
|
||||
# est dans /var/log, mais pendant l'installation c'est le %post --nochroot
|
||||
# qui le recopie dans le /tmp du live (le disque cible est démonté au moment
|
||||
# où on en a besoin). N'en chercher qu'un revenait à envoyer, depuis le live,
|
||||
# un rapport SANS le log qui dit si le disque va booter.
|
||||
for post_log in ("/var/log/fws-post.log", "/tmp/fws-post-chroot.log"):
|
||||
if not os.path.isfile(post_log):
|
||||
continue
|
||||
tail = _tail(post_log, 100)
|
||||
if tail:
|
||||
parts += ["", "===== Log d'installation FWS (fin) =====", tail]
|
||||
parts += ["", "===== Log d'installation FWS (%s, fin) =====" % post_log,
|
||||
tail]
|
||||
break
|
||||
|
||||
tb_path = _anaconda_traceback()
|
||||
if tb_path:
|
||||
tb = _tail(tb_path, 80)
|
||||
if tb:
|
||||
parts += ["", "===== Plantage de l'installateur (%s, fin) ====="
|
||||
% tb_path, tb]
|
||||
journal_ok, journal = _journal_excerpt()
|
||||
if journal:
|
||||
parts += ["", "===== Journal du dernier démarrage "
|
||||
|
||||
Reference in new issue
Block a user