Bug 12898 - Bitbake does not print server errors when there is no TTY
Summary: Bitbake does not print server errors when there is no TTY
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 5.99
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.7 M1
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-08-23 21:25 UTC by Paul Eggleton
Modified: 2018-11-15 08:34 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2018-08-23 21:25:17 UTC
If the bitbake server fails to start (e.g. because of a sanity test failure when processing the configuration) and there is no TTY (e.g. when running inside Docker without -t) then the last 10 lines of bitbake-cookerdaemon.log will not be printed. This appears to be because the start marker that we need to figure out where the last server's messages start in the logfile does not get written to the file when there is no TTY.

Log when there is no TTY:
https://travis-ci.org/crops/poky-container/jobs/419770906

Log when there is a TTY:
https://travis-ci.org/rewitt1/poky-container/jobs/419847827

(FYI the reason there is no TTY set normally for this container is because if there is one then you get progress/timer cruft in the output).
Comment 1 Richard Purdie 2018-08-30 14:38:28 UTC
We've seen this on jenkins and on buildbot on our autobuilder too. Its confusing as the error doesn't show in the logs and the user gets confused.
Comment 2 Robert Yang 2018-11-13 03:03:36 UTC
I tried:

$ echo 'HOSTTOOLS += \"hello\"' >> conf/local.conf

$ nohup bitbake -p

It works as expected, there is a bitbake-cookerdaemon.log, and the last 10 logs printed.

I also tried docke run <image> without -t, it also worked as expected.

I suspect there is no bitbake-cookerdaemon.log when the error happened.

I need more info to go on this work:
* Do you still get the errors recently ?
* Would you please provide detailed steps on how to reproduce it?

I think that what can I do now is print an info when there is no bitbake-cookerdaemon.log
Comment 3 Randy Witt 2018-11-13 18:11:59 UTC
I just did a bisect and it looks like this issue was fixed with 74feaddda3b7cd5b3ab18d2f25bf5ef9581c9c47.
Comment 4 Robert Yang 2018-11-15 08:34:51 UTC
(In reply to comment #3)
> I just did a bisect and it looks like this issue was fixed with
> 74feaddda3b7cd5b3ab18d2f25bf5ef9581c9c47.

Great, thanks.

Fixed:

74feaddda3b7cd5b3ab18d2f25bf5ef9581c9c47