Add check for running traceback script and when the retry fails.
This also indicates something went wrong with the installation, exit when they are seen in the logs.
Also drop looking for WARNING in the regex errors, they will be errors after the syslog level name remap patch goes into anaconda. --- src/sbin/livemedia-creator | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index e5f4f77..378282f 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -143,9 +143,11 @@ class LogRequestHandler(SocketServer.BaseRequestHandler): simple_tests = ["Traceback (", "Out of memory:", "Call Trace:", - "insufficient disk space:"] - re_tests = [r"WARNING packaging: base repo .* not valid", - r"WARNING packaging: .* requires .*"] + "insufficient disk space:", + "error populating transaction after", + "traceback script(s) have been run"] + re_tests = [r"packaging: base repo .* not valid", + r"packaging: .* requires .*"] for t in simple_tests: if t in line: self.server.log_error = True
Sometimes it can be hard to tell exactly what triggered the error detection, so log the line that matched. --- src/sbin/livemedia-creator | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 378282f..1a18f3a 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -151,10 +151,12 @@ class LogRequestHandler(SocketServer.BaseRequestHandler): for t in simple_tests: if t in line: self.server.log_error = True + self.server.error_line = line return for t in re_tests: if re.search(t, line): self.server.log_error = True + self.server.error_line = line return
@@ -168,6 +170,7 @@ class LogServer(SocketServer.TCPServer): """ self.kill = False self.log_error = False + self.error_line = "" self.log_path = log_path SocketServer.TCPServer.__init__(self, *args, **kwargs)
@@ -750,7 +753,7 @@ def virt_install(opts, install_log, disk_img, disk_size): iso_mount.umount()
if log_monitor.server.log_check(): - raise InstallError("virt_install failed") + raise InstallError("virt_install failed on line: %s" % log_monitor.server.error_line)
if opts.make_fsimage: make_fsimage(diskimg_path, disk_img, disk_size, label=opts.fs_label)
This no longer seems to be needed, and causes images created without passing --vnc vnc to start up with a serial console. If you need a serial console you can pass it using --kernel-args --- src/sbin/livemedia-creator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 1a18f3a..0028bd4 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -345,7 +345,7 @@ class VirtualInstall(object):
extra_args = "ks=file:/{0}".format(os.path.basename(ks_paths[0])) if not vnc: - extra_args += " inst.cmdline console=ttyS0" + extra_args += " inst.cmdline" if kernel_args: extra_args += " "+kernel_args if iso.liveos:
This switches on the rc checking in execWithRedirect and logs the error it raises. --- src/sbin/livemedia-creator | 68 ++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 32 deletions(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 0028bd4..88ca723 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -366,9 +366,11 @@ class VirtualInstall(object): args.append("--arch") args.append(arch)
- rc = execWithRedirect("virt-install", args) - if rc: - raise InstallError("Problem starting virtual install") + log.info("Running virt-install.") + try: + execWithRedirect("virt-install", args, raise_err=True) + except subprocess.CalledProcessError as e: + raise InstallError("Problem starting virtual install: %s" % e)
conn = libvirt.openReadOnly(None) dom = conn.lookupByName(self.virt_name) @@ -646,35 +648,37 @@ def novirt_install(opts, disk_img, disk_size, repo_url): # Make sure anaconda has the right product and release os.environ["ANACONDA_PRODUCTNAME"] = opts.project os.environ["ANACONDA_PRODUCTVERSION"] = opts.releasever - rc = execWithRedirect("anaconda", args) - - # Move the anaconda logs over to a log directory - log_dir = os.path.abspath(os.path.dirname(opts.logfile)) - log_anaconda = joinpaths(log_dir, "anaconda") - if not os.path.isdir(log_anaconda): - os.mkdir(log_anaconda) - for l in ["anaconda.log", "ifcfg.log", "program.log", "storage.log", - "packaging.log", "yum.log"]: - if os.path.exists("/tmp/"+l): - shutil.copy2("/tmp/"+l, log_anaconda) - os.unlink("/tmp/"+l) - - if opts.make_iso or opts.make_fsimage: - umount(ROOT_PATH) - else: - # If anaconda failed the disk image may still be in use by dm - execWithRedirect("anaconda-cleanup", []) - dm_name = os.path.splitext(os.path.basename(disk_img))[0] - dm_path = "/dev/mapper/"+dm_name - if os.path.exists(dm_path): - dm_detach(dm_path) - loop_detach(get_loop_name(disk_img)) - - if selinux_enforcing: - selinux.security_setenforce(1) - - if rc: + log.info("Running anaconda.") + try: + execWithRedirect("anaconda", args, raise_err=True) + except subprocess.CalledProcessError as e: + log.error("Running anaconda failed: %s", e) raise InstallError("novirt_install failed") + finally: + # Move the anaconda logs over to a log directory + log_dir = os.path.abspath(os.path.dirname(opts.logfile)) + log_anaconda = joinpaths(log_dir, "anaconda") + if not os.path.isdir(log_anaconda): + os.mkdir(log_anaconda) + for l in ["anaconda.log", "ifcfg.log", "program.log", "storage.log", + "packaging.log", "yum.log"]: + if os.path.exists("/tmp/"+l): + shutil.copy2("/tmp/"+l, log_anaconda) + os.unlink("/tmp/"+l) + + if opts.make_iso or opts.make_fsimage: + umount(ROOT_PATH) + else: + # If anaconda failed the disk image may still be in use by dm + execWithRedirect("anaconda-cleanup", []) + dm_name = os.path.splitext(os.path.basename(disk_img))[0] + dm_path = "/dev/mapper/"+dm_name + if os.path.exists(dm_path): + dm_detach(dm_path) + loop_detach(get_loop_name(disk_img)) + + if selinux_enforcing: + selinux.security_setenforce(1)
if opts.qcow2: log.info("Converting %s to qcow2", disk_img) @@ -697,7 +701,7 @@ def novirt_install(opts, disk_img, disk_size, repo_url): shutil.rmtree(ROOT_PATH)
if rc: - raise InstallError("novirt_install failed") + raise InstallError("novirt_install mktar failed: rc=%s" % rc)
def virt_install(opts, install_log, disk_img, disk_size):
On Wed, 2014-07-02 at 15:17 -0700, Brian C. Lane wrote:
Add check for running traceback script and when the retry fails.
This also indicates something went wrong with the installation, exit when they are seen in the logs.
Also drop looking for WARNING in the regex errors, they will be errors after the syslog level name remap patch goes into anaconda.
src/sbin/livemedia-creator | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index e5f4f77..378282f 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -143,9 +143,11 @@ class LogRequestHandler(SocketServer.BaseRequestHandler): simple_tests = ["Traceback (", "Out of memory:", "Call Trace:",
"insufficient disk space:"]re_tests = [r"WARNING packaging: base repo .* not valid",r"WARNING packaging: .* requires .*"]
"insufficient disk space:","error populating transaction after","traceback script(s) have been run"]re_tests = [r"packaging: base repo .* not valid",r"packaging: .* requires .*"] for t in simple_tests: if t in line: self.server.log_error = True
These all look good to me.
anaconda-patches@lists.fedorahosted.org