Improve logging for execution failures in buildbox bot

Context

While attempting to trace down the cause of an error in BuildStream I found inconveniences within _app/bots/buildbox.py. The information logged was:

2019-08-07T13:48:57.549707821Z 
2019-08-07T13:48:57.549787118Z 2019-08-07 13:48:57,549:[        buildgrid._app.bots.buildbox][ INFO]: Execution finished with code: [1]
2019-08-07T13:48:57.549943195Z 2019-08-07 13:48:57,549:[        buildgrid._app.bots.buildbox][DEBUG]: Output root digest: [/0]
2019-08-07T13:48:57.550035504Z 2019-08-07 13:48:57,549:[        buildgrid._app.bots.buildbox][DEBUG]: metadata: b''
2019-08-07T13:48:57.550741723Z 2019-08-07 13:48:57,550:[                buildgrid.bot.tenant][ERROR]: b''

Further information should be logged from bgd bot to help users find their fault. Additonally more information should be returned to the remote execution client such as stderr, stdout.

The b'' seems to arise from the passing of stdout to BotError during error cases in https://gitlab.com/BuildGrid/buildgrid/blob/master/buildgrid/_app/bots/buildbox.py#L120. This is very confusing for the user and should be fixed.

Task Description

  • Additional log messages through buildbox bgd bot from the command execution.
  • Avoid sending b'' to remote execution clients.
Edited by Qinusty