'ERROR: YoctoProject - core-image-sato: do_populate_sdk

I'm a beginner in Yoctoproject. I'm trying to buil the image for Beaglebone Black Board with command-line: bitbake core-image-sato -c populate_sdk. And I had an error (the detail in the below) in last task.

Enviroment build: Ubuntu 16.04 LTS, using Bash Shell instead of Dash Shell. I tried to build again many times but same this error. Can you help me fix this error?

In the log file:

NOTE: Executing create_sdk_files ...
DEBUG: Executing shell function create_sdk_files
DEBUG: Shell function create_sdk_files finished
NOTE: Executing check_sdk_sysroots ...
DEBUG: Executing python function check_sdk_sysroots
DEBUG: Python function check_sdk_sysroots finished
NOTE: Executing archive_sdk ...
DEBUG: Executing shell function archive_sdk
/home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/temp/run.archive_sdk.4392: line 106: 11617 Broken pipe             tar --owner=root --group=root -cf - .
     11618 Killed                  | xz -T 0 -9 > /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/x86_64-deploy-core-image-sato-populate-sdk/poky-glibc-x86_64-core-image-sato-armv7at2hf-neon-beaglebone-toolchain-3.0.tar.xz
WARNING: /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/temp/run.archive_sdk.4392:1 exit 137 from 'xz -T 0 -9 > /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/x86_64-deploy-core-image-sato-populate-sdk/poky-glibc-x86_64-core-image-sato-armv7at2hf-neon-beaglebone-toolchain-3.0.tar.xz'
ERROR: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_populate_sdk(d)
     0003:
File: '/home/huongnguyen/Desktop/poky/openembedded-core/meta/classes/populate_sdk_base.bbclass', lineno: 169, function: do_populate_sdk
     0165:
     0166:    populate_sdk(d)
     0167:
     0168:fakeroot python do_populate_sdk() {
 *** 0169:    populate_sdk_common(d)
     0170:}
     0171:SSTATETASKS += "do_populate_sdk"
     0172:SSTATE_SKIP_CREATION_task-populate-sdk = '1'
     0173:do_populate_sdk[cleandirs] = "${SDKDEPLOYDIR}"
File: '/home/huongnguyen/Desktop/poky/openembedded-core/meta/classes/populate_sdk_base.bbclass', lineno: 166, function: populate_sdk_common
     0162:                    manifest_type=Manifest.MANIFEST_TYPE_SDK_HOST)
     0163:    create_manifest(d, manifest_dir=d.getVar('SDK_DIR'),
     0164:                    manifest_type=Manifest.MANIFEST_TYPE_SDK_TARGET)
     0165:
 *** 0166:    populate_sdk(d)
     0167:
     0168:fakeroot python do_populate_sdk() {
     0169:    populate_sdk_common(d)
     0170:}
File: '/home/huongnguyen/Desktop/poky/openembedded-core/meta/lib/oe/sdk.py', lineno: 413, function: populate_sdk
     0409:    env_bkp = os.environ.copy()
     0410:
     0411:    img_type = d.getVar('IMAGE_PKGTYPE')
     0412:    if img_type == "rpm":
 *** 0413:        RpmSdk(d, manifest_dir).populate()
     0414:    elif img_type == "ipk":
     0415:        OpkgSdk(d, manifest_dir).populate()
     0416:    elif img_type == "deb":
     0417:        DpkgSdk(d, manifest_dir).populate()
File: '/home/huongnguyen/Desktop/poky/openembedded-core/meta/lib/oe/sdk.py', lineno: 60, function: populate
     0056:                                 self.sysconfdir, "ld.so.cache")
     0057:        self.mkdirhier(os.path.dirname(link_name))
     0058:        os.symlink("/etc/ld.so.cache", link_name)
     0059:
 *** 0060:        execute_pre_post_process(self.d, self.d.getVar('SDK_POSTPROCESS_COMMAND'))
     0061:
     0062:    def movefile(self, sourcefile, destdir):
     0063:        try:
     0064:            # FIXME: this check of movefile's return code to None should be
File: '/home/huongnguyen/Desktop/poky/openembedded-core/meta/lib/oe/utils.py', lineno: 260, function: execute_pre_post_process
     0256:    for cmd in cmds.strip().split(';'):
     0257:        cmd = cmd.strip()
     0258:        if cmd != '':
     0259:            bb.note("Executing %s ..." % cmd)
 *** 0260:            bb.build.exec_func(cmd, d)
     0261:
     0262:# For each item in items, call the function 'target' with item as the first
     0263:# argument, extraargs as the other arguments and handle any exceptions in the
     0264:# parent thread
File: '/home/huongnguyen/Desktop/poky/bitbake/lib/bb/build.py', lineno: 249, function: exec_func
     0245:    with bb.utils.fileslocked(lockfiles):
     0246:        if ispython:
     0247:            exec_func_python(func, d, runfile, cwd=adir)
     0248:        else:
 *** 0249:            exec_func_shell(func, d, runfile, cwd=adir)
     0250:
     0251:    try:
     0252:        curcwd = os.getcwd()
     0253:    except:
File: '/usr/lib/python3.5/contextlib.py', lineno: 77, function: __exit__
     0073:                # Need to force instantiation so we can reliably
     0074:                # tell if we get the same exception back
     0075:                value = type()
     0076:            try:
 *** 0077:                self.gen.throw(type, value, traceback)
     0078:                raise RuntimeError("generator didn't stop after throw()")
     0079:            except StopIteration as exc:
     0080:                # Suppress StopIteration *unless* it's the same exception that
     0081:                # was passed to throw().  This prevents a StopIteration
File: '/home/huongnguyen/Desktop/poky/bitbake/lib/bb/utils.py', lineno: 431, function: fileslocked
     0427:    if files:
     0428:        for lockfile in files:
     0429:            locks.append(bb.utils.lockfile(lockfile))
     0430:
 *** 0431:    yield
     0432:
     0433:    for lock in locks:
     0434:        bb.utils.unlockfile(lock)
     0435:
File: '/home/huongnguyen/Desktop/poky/bitbake/lib/bb/build.py', lineno: 249, function: exec_func
     0245:    with bb.utils.fileslocked(lockfiles):
     0246:        if ispython:
     0247:            exec_func_python(func, d, runfile, cwd=adir)
     0248:        else:
 *** 0249:            exec_func_shell(func, d, runfile, cwd=adir)
     0250:
     0251:    try:
     0252:        curcwd = os.getcwd()
     0253:    except:
File: '/home/huongnguyen/Desktop/poky/bitbake/lib/bb/build.py', lineno: 450, function: exec_func_shell
     0446:    with open(fifopath, 'r+b', buffering=0) as fifo:
     0447:        try:
     0448:            bb.debug(2, "Executing shell function %s" % func)
     0449:            with open(os.devnull, 'r+') as stdin, logfile:
 *** 0450:                bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
     0451:        finally:
     0452:            os.unlink(fifopath)
     0453:
     0454:    bb.debug(2, "Shell function %s finished" % func)
File: '/home/huongnguyen/Desktop/poky/bitbake/lib/bb/process.py', lineno: 182, function: run
     0178:        if not stderr is None:
     0179:            stderr = stderr.decode("utf-8")
     0180:
     0181:    if pipe.returncode != 0:
 *** 0182:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0183:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of '/home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/temp/run.archive_sdk.4392' failed with exit code 137:
/home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/temp/run.archive_sdk.4392: line 106: 11617 Broken pipe             tar --owner=root --group=root -cf - .
     11618 Killed                  | xz -T 0 -9 > /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/x86_64-deploy-core-image-sato-populate-sdk/poky-glibc-x86_64-core-image-sato-armv7at2hf-neon-beaglebone-toolchain-3.0.tar.xz
WARNING: /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/temp/run.archive_sdk.4392:1 exit 137 from 'xz -T 0 -9 > /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/x86_64-deploy-core-image-sato-populate-sdk/poky-glibc-x86_64-core-image-sato-armv7at2hf-neon-beaglebone-toolchain-3.0.tar.xz'


ERROR: Logfile of failure stored in: /home/huongnguyen/Desktop/poky/build/tmp/work/beaglebone-poky-linux-gnueabi/core-image-sato/1.0-r0/temp/log.do_populate_sdk.4392
ERROR: Task (/home/huongnguyen/Desktop/poky/openembedded-core/meta/recipes-sato/images/core-image-sato.bb:do_populate_sdk) failed with exit code '1'



Solution 1:[1]

Exit code 137 means something killed xz during the build. You may be running out of memory: check dmesg after this happens, there might be a log line about out-of-memory killer.

Solution 2:[2]

Had the same problem and could make it go away with XZ_MEMLIMIT="75%" bitbake image-name -c do_populate_sdk. The bitbake.conf in my version of Yocto defaults XZ_MEMLIMIT to 50%.

Solution 3:[3]

Had the same problem and none of the usual methods, like, deleting hidden repo file worked.

I then clean the build using bitbake -c clean mybuildname and then again made the build and it worked flawlessly, I hope it helps someone.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Multisync
Solution 3 ZBT248