From 23b0b6bcaf2d18d3beedc2928bcce061b756b368 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Fri, 27 Aug 2021 08:05:28 +0200 Subject: [PATCH 1/2] Deploy build error log in case of an exception This happened with us.spotco.fennec_dos_2912000 where no build log was saved in the repo but the wiki has an error text. The error text was: "Command '['rsync', '--recursive', '--perms', '--links', '--quiet', '--rsh=ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=FATAL -o IdentitiesOnly=yes -o PasswordAuthentication=no -p 2222 -i /home/fbuild/.vagrant.d/boxes/buildserver/0/virtualbox/vagrant_private_key', 'build/srclib/MozFennec', 'vagrant@127.0.0.1:/home/vagrant/build/srclib']' returned non-zero exit status 255." Which is generated by the rsync subprocess call in build_server(). I assume that it threw an Exception (not an FdroidException, because the string "Build completed at" is not in the wiki site) that was caught in main(). --- fdroidserver/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index b507bb3a..48983556 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -1228,6 +1228,7 @@ def main(): common.force_exit(1) add_failed_builds_entry(failed_builds, appid, build, e) wikilog = e.get_wikitext() + common.deploy_build_log_with_rsync(appid, build.versionCode, str(e)) except Exception as e: logging.error("Could not build app %s due to unknown error: %s" % ( appid, traceback.format_exc())) @@ -1236,6 +1237,7 @@ def main(): common.force_exit(1) add_failed_builds_entry(failed_builds, appid, build, e) wikilog = str(e) + common.deploy_build_log_with_rsync(appid, build.versionCode, str(e)) if options.wiki and wikilog: try: From 72df2639a2902851f341c0f621be921f312046a8 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Fri, 27 Aug 2021 13:27:42 +0200 Subject: [PATCH 2/2] Log traceback with exception --- fdroidserver/build.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 48983556..37cc6989 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -1212,7 +1212,9 @@ def main(): common.force_exit(1) add_failed_builds_entry(failed_builds, appid, build, vcse) wikilog = str(vcse) - common.deploy_build_log_with_rsync(appid, build.versionCode, str(vcse)) + common.deploy_build_log_with_rsync( + appid, build.versionCode, "".join(traceback.format_exc()) + ) except FDroidException as e: with open(os.path.join(log_dir, appid + '.log'), 'a+') as f: f.write('\n\n============================================================\n') @@ -1228,7 +1230,9 @@ def main(): common.force_exit(1) add_failed_builds_entry(failed_builds, appid, build, e) wikilog = e.get_wikitext() - common.deploy_build_log_with_rsync(appid, build.versionCode, str(e)) + common.deploy_build_log_with_rsync( + appid, build.versionCode, "".join(traceback.format_exc()) + ) except Exception as e: logging.error("Could not build app %s due to unknown error: %s" % ( appid, traceback.format_exc())) @@ -1237,7 +1241,9 @@ def main(): common.force_exit(1) add_failed_builds_entry(failed_builds, appid, build, e) wikilog = str(e) - common.deploy_build_log_with_rsync(appid, build.versionCode, str(e)) + common.deploy_build_log_with_rsync( + appid, build.versionCode, "".join(traceback.format_exc()) + ) if options.wiki and wikilog: try: