Re: KeyError: 'getpwuid(): uid not found: 1000' in do_package phase

Marek Belisko

On Tue, Nov 17, 2020 at 2:19 PM Nicolas Jeker <n.jeker@...> wrote:

On Mon, 2020-11-16 at 23:27 +0100, Martin Jansa wrote:

is an example where it triggers this error, but doesn't trigger the
more common host-user-contaminated QA error (unless you happened to
use UID 1001 on host for the user running bitbake).

Similarly when the files are "installed" with e.g. "cp -a" for which
layers usually use "cp -R --no-dereference --preserve=mode,links -v".
On a related note, the do_install reference in the manual gives some
advice on how to use cp and tar without contaminating the build.

The relevant part:
Thanks all for valuable inputs. Issue solved +1

Safe methods for installing files include the following:
* The install utility. This utility is the preferred method.
* The cp command with the "--no-preserve=ownership" option.
* The tar command with the "--no-same-owner" option. See the
bin_package.bbclass file in the meta/classes directory of the
Source Directory for an example.

On Mon, Nov 16, 2020 at 10:10 PM Marek Belisko <
marek.belisko@...> wrote:
On Mon, Nov 16, 2020 at 9:52 PM Joshua Watt <jpewhacker@...>

On 11/16/20 2:38 PM, Marek Belisko wrote:


I'm bumping my project based on zeus to dunfell. I've update all
layers and in one of my recipes I'm seeing following issue (not
see on
zeus at all):
WARNING: cv-my-test-1.0-r0 do_package: KeyError in
ERROR: cv-my-test-1.0-r0 do_package: Error executing a python
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:
*** 0002:sstate_report_unihash(d)
File: '/home/ubuntu/projects/my-test-
lineno: 840, function: sstate_report_unihash
0836: report_unihash = getattr(bb.parse.siggen,
'report_unihash', None)
0838: if report_unihash:
0839: ss = sstate_state_fromvars(d)
*** 0840: report_unihash(os.getcwd(), ss['task'], d)
0844:# Shell function to decompress and prepare a package
for installation
File: '/home/ubuntu/projects/my-test-
lineno: 555, function: report_unihash
0552: if "." in self.method:
0553: (module, method) =
self.method.rsplit('.', 1)
0554: locs['method'] =
getattr(importlib.import_module(module), method)
*** 0555: outhash =
sigfile, task, d)', locs)
0556: else:
0557: outhash =
bb.utils.better_eval(self.method +
'(path, sigfile, task, d)', locs)
0559: try:
File: '/home/ubuntu/projects/my-test-
lineno: 420, function: better_eval
0416: if extraglobals:
0417: ctx = copy.copy(ctx)
0418: for g in extraglobals:
0419: ctx[g] = extraglobals[g]
*** 0420: return eval(source, ctx, locals)
0423:def fileslocked(files):
0424: """Context manager for locking and unlocking file
File: '<string>', lineno: 1, function: <module>
File "<string>", line 1, in <module>

File: '/home/ubuntu/projects/my-test-
lineno: 595, function: OEOuthashBasic
0591: process(root)
0592: for f in files:
0593: if f == 'fixmepath':
0594: continue
*** 0595: process(os.path.join(root, f))
0596: finally:
0597: os.chdir(prev_dir)
0599: return h.hexdigest()
File: '/home/ubuntu/projects/my-test-
lineno: 551, function: process
0547: add_perm(stat.S_IXOTH, 'x')
0549: if include_owners:
0550: try:
*** 0551: update_hash(" %10s" %
0552: update_hash(" %10s" %
0553: except KeyError:
0554: bb.warn("KeyError in %s" %
0555: raise
Exception: KeyError: 'getpwuid(): uid not found: 1000'

ERROR: Logfile of failure stored in:

Is this known issue or something related to my host setup?

This means the recipe is having host contamination (where the UID
of the user doing the build is leaking into the file system).
Some ideas what can be the source of that. This recipe is basically
just copying files from archive to final rootfs without any special
processing or so.

Thanks and BR,




Join to automatically receive all group messages.