mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
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 <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d8d0db1701
commit
a07cf2e50c
@@ -108,7 +108,7 @@ class LocalhostBEController(BuildEnvironmentController):
|
|||||||
logger.debug("localhostbecontroller: running the listener at %s" % own_bitbake)
|
logger.debug("localhostbecontroller: running the listener at %s" % own_bitbake)
|
||||||
|
|
||||||
|
|
||||||
cmd = "bash -c \"source %s/oe-init-build-env %s && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir,
|
cmd = "bash -c \"source %s/oe-init-build-env %s && bitbake --read conf/toaster-pre.conf --postread conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 >toaster_server.log && DATABASE_URL=%s BBSERVER=0.0.0.0:-1 daemon -d -i -D %s -o toaster_ui.log -- %s --observe-only -u toasterui &\"" % (self.pokydirname, self.be.builddir,
|
||||||
self.dburl, self.be.builddir, own_bitbake)
|
self.dburl, self.be.builddir, own_bitbake)
|
||||||
port = "-1"
|
port = "-1"
|
||||||
cmdoutput = self._shellcmd(cmd)
|
cmdoutput = self._shellcmd(cmd)
|
||||||
@@ -290,6 +290,9 @@ class LocalhostBEController(BuildEnvironmentController):
|
|||||||
self.islayerset = True
|
self.islayerset = True
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def readServerLogFile(self):
|
||||||
|
return open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()
|
||||||
|
|
||||||
def release(self):
|
def release(self):
|
||||||
assert self.be.sourcedir and os.path.exists(self.be.builddir)
|
assert self.be.sourcedir and os.path.exists(self.be.builddir)
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
@@ -78,10 +78,16 @@ class Command(NoArgsCommand):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("runbuilds: Error executing shell command %s" % e)
|
logger.error("runbuilds: Error executing shell command %s" % e)
|
||||||
traceback.print_exc(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,
|
BRError.objects.create(req = br,
|
||||||
errtype = str(type(e)),
|
errtype = str(type(e)),
|
||||||
errmsg = str(e),
|
errmsg = errmsg,
|
||||||
traceback = traceback.format_exc(e))
|
traceback = traceback.format_exc(e))
|
||||||
br.state = BuildRequest.REQ_FAILED
|
br.state = BuildRequest.REQ_FAILED
|
||||||
br.save()
|
br.save()
|
||||||
bec.be.lock = BuildEnvironment.LOCK_FREE
|
bec.be.lock = BuildEnvironment.LOCK_FREE
|
||||||
|
|||||||
Reference in New Issue
Block a user