From a07cf2e50c376ce1fdcc9ac77e291595489de3ce Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Tue, 10 Feb 2015 16:25:17 +0000 Subject: bitbake: toaster: properly detect failed server start This patch brings in reading the server log if the server fails to start. This is the first step in displaying the errors in a manner that is actionable by the user. [YOCTO #7285] (Bitbake rev: 7f47b67bccff55673a827dbcccc767af4459c933) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- .../lib/toaster/bldcontrol/management/commands/runbuilds.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py') diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index c4ab87bdc9..3de582cc86 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py @@ -78,10 +78,16 @@ class Command(NoArgsCommand): except Exception as e: logger.error("runbuilds: Error executing shell command %s" % e) traceback.print_exc(e) + if "[Errno 111] Connection refused" in str(e): + # Connection refused, read toaster_server.out + errmsg = bec.readServerLogFile() + else: + errmsg = str(e) + BRError.objects.create(req = br, - errtype = str(type(e)), - errmsg = str(e), - traceback = traceback.format_exc(e)) + errtype = str(type(e)), + errmsg = errmsg, + traceback = traceback.format_exc(e)) br.state = BuildRequest.REQ_FAILED br.save() bec.be.lock = BuildEnvironment.LOCK_FREE -- cgit v1.2.3-54-g00ecf