Skip to contentSkip to conversation

Random Bitbake build failures

DISCUSSION Nair, Sandeep (Contractor) 2 participants 4 messages Jun 4, 2016 – Jun 14, 2016

lore
Share & tools
lore
#0 lore raw

Bitbake version : 1.22.0

We are facing random failures with Bitbake builds. Bitbake is returning an error even when the operation succeeded on the successful retry.

Eg:

ERROR: Error executing a python function in /mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/meta-rdk-comcast/recipes-extended/netzyn/netzyn_git.bb:
Exception: IOError: [Errno 116] Stale file handle

WARNING: Logfile for failed setscene task is /mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/build-pacexi3v2/tmp/work/mips32el-rdk-linux/netzyn/1.99+gitAUTOINC+c3752ca038_c7068967a1-r0/temp/log.do_package_setscene.8946
WARNING: Setscene task 1277 (/mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/meta-rdk-comcast/recipes-extended/netzyn/netzyn_git.bb, do_package_setscene) failed with exit code '1' - real task will be run instead

"Setscene" is a bb attempt to use sstate cache.

It says about real task will run instead. Does that mean it tried build locally (it should)?

In all stale cases it fails in this code:

File: '..../openembedded-core/bitbake/lib/bb/utils.py', lineno: 467, function: md5_file

     0463:        import md5
     0464:        m = md5.new()
     0465:
     0466:    with open(filename, "rb") as f:
*** 0467:        for line in f:
     0468:            m.update(line)
     0469:    return m.hexdigest()
     0470:

As can be seen it tries use handle it was given but the file is not valid on remote side already. So system lib returns stale handle.

How does Bitbake handle the unsuccessful set scene ? will it just go with regular local build or just fail immediately.

This causes us random failures in our builds. Could you please provide insight on whether there is a patch available to address this issue or is this issue is addressed in latest Bitbake versions

Thanks,
Sandeep

#1 lore raw
Quoted 61 lines · Sandeep (Contractor)

We are facing random failures with Bitbake builds. Bitbake is returning an error even when the operation succeeded on the successful retry.

Eg:

ERROR: Error executing a python function in /mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/meta-rdk-comcast/recipes-extended/netzyn/ netzyn_git.bb:

Exception: IOError: [Errno 116] Stale file handle

WARNING: Logfile for failed setscene task is /mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/build-pacexi3v2/tmp/work/mips32el-rdk-linux/netzyn/1.99+gitAUTOINC+c3752ca038_c7068967a1-r0/temp/log.do_package_setscene.8946

WARNING: Setscene task 1277 (/mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/meta-rdk-comcast/recipes-extended/netzyn/ netzyn_git.bb, do_package_setscene) failed with exit code '1' - real task will be run instead

“Setscene” is a bb attempt to use sstate cache.

It says about real task will run instead. Does that mean it tried build locally (it should)?

In all stale cases it fails in this code:

File: ‘…./openembedded-core/bitbake/lib/bb/utils.py', lineno: 467,
function: md5_file

     0463:        import md5

     0464:        m = md5.new()

     0465:

     0466:    with open(filename, "rb") as f:

*** 0467: for line in f:

     0468:            m.update(line)

     0469:    return m.hexdigest()

     0470:
Quoted 3 lines

As can be seen it tries use handle it was given but the file is not valid on remote side already. So system lib returns stale handle.

remote side? bitbake builds have never been supported on nfs. But yes, generally the real task runs if the setscene fails.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#2 lore raw

Hi Christopher,

Thanks for the details. Please find the additional details based on your feedback

Quoted 1 line
Quoted 1 line

remote side? bitbake builds have never been supported on nfs.

We mount remote folders and bitbake sees these as a regular folder. Since this can be treated as a regular folder, we may not need nfs support in bitbake.

Quoted 1 line
Quoted 1 line

But yes, generally the real task runs if the setscene fails.

We do the real task when sstate cache fetch fails and we are trying to identify the reason why bitbake returns 1 (which happens when error count != 0) even when real task succeeds. We see that Bitbake returns 1 in this case which causes random build failure even when the real task was performed successfully.

Thanks,
Sandeep

From: [email protected] [mailto:[email protected]] On Behalf Of Christopher Larson
Sent: Saturday, June 04, 2016 5:52 PM
To: Nair, Sandeep (Contractor) <[email protected]>
Cc: [email protected]
Subject: Re: [bitbake-devel] Random Bitbake build failures

On Sat, Jun 4, 2016 at 11:09 AM, Nair, Sandeep (Contractor) <[email protected]<mailto:[email protected]>> wrote:
We are facing random failures with Bitbake builds. Bitbake is returning an error even when the operation succeeded on the successful retry.

Eg:

ERROR: Error executing a python function in /mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/meta-rdk-comcast/recipes-extended/netzyn/netzyn_git.bb<http://netzyn_git.bb>:
Exception: IOError: [Errno 116] Stale file handle

WARNING: Logfile for failed setscene task is /mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/build-pacexi3v2/tmp/work/mips32el-rdk-linux/netzyn/1.99+gitAUTOINC+c3752ca038_c7068967a1-r0/temp/log.do_package_setscene.8946
WARNING: Setscene task 1277 (/mnt/jenkins/workspace/PACEXI3V2-Yocto-Build/meta-rdk-comcast/recipes-extended/netzyn/netzyn_git.bb<http://netzyn_git.bb>, do_package_setscene) failed with exit code '1' - real task will be run instead

“Setscene” is a bb attempt to use sstate cache.

It says about real task will run instead. Does that mean it tried build locally (it should)?

In all stale cases it fails in this code:

File: ‘…./openembedded-core/bitbake/lib/bb/utils.py', lineno: 467, function: md5_file

     0463:        import md5
     0464:        m = md5.new()
     0465:
     0466:    with open(filename, "rb") as f:
*** 0467:        for line in f:
     0468:            m.update(line)
     0469:    return m.hexdigest()
     0470:

As can be seen it tries use handle it was given but the file is not valid on remote side already. So system lib returns stale handle.

remote side? bitbake builds have never been supported on nfs. But yes, generally the real task runs if the setscene fails. --
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

#3 lore raw
Quoted 5 lines · Sandeep (Contractor)

Thanks for the details. Please find the additional details based on your feedback

Quoted 8 lines
Quoted 1 line
Quoted 1 line

remote side? bitbake builds have never been supported on nfs.

We mount remote folders and bitbake sees these as a regular folder. Since this can be treated as a regular folder, we may not need nfs support in bitbake.

That's not actually the case, because bitbake needs certain reliable features of the filesystem, particularly locking, which are problematic on nfs. It's not completely transparent. You can likely use nfs for SSTATE_DIR/DL_DIR, though, just not the tmp dir where builds occur.

Quoted 10 lines
Quoted 1 line

But yes, generally the real task runs if the setscene fails.

We do the real task when sstate cache fetch fails and we are trying to identify the reason why bitbake returns 1 (which happens when error count != 0) even when real task succeeds. We see that Bitbake returns 1 in this case which causes random build failure even when the real task was performed successfully.

If that's actually the case, I'd say it's a bug. sstate fetch failure shouldn't show error messages, the user doesn't care. I had a bug open for a similar case at https://bugzilla.yoctoproject.org/show_bug.cgi?id=4499.
I'd suggest setting ;downloadfilename=PATH on the replacement side of the sstate mirrors (this is automatic in very recent yocto, but wasn't in the past), as is mentioned in that issue.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics