Openembedded-core/meta/recipes-devtools/perl/perl_5.30.1.bb:do_package: host contamination error

If openembedded-core/meta/recipes-devtools/perl/perl_5.30.1.bb is build on a system with UID or GID != 1000 it fails with:

Exception: Exception: KeyError: 'getpwuid(): uid not found: 27732'
Path ./package is owned by uid 27732, gid 27732, which doesn't match any user/group on target. This may be due to host contamination.

ERROR: Logfile of failure stored in: /home/pokyuser/pelux/pelux/targets/colibri-imx6-mender/tmp/work/armv7at2hf-neon-peluxtdx-linux-gnueabi/perl/5.30.1-r0/temp/log.do_package.317
ERROR: Task (/home/pokyuser/pelux/pelux/targets/colibri-imx6-mender/../../../layers/openembedded-core/meta/recipes-devtools/perl/perl_5.30.1.bb:do_package) failed with exit code '1'

I am building in a custom docker container. The build is successful on our CI server, where UID and GID of host user are 1000. But it fails on my workstation where UID and GID differs.

I use volumes to keep data persistent. In order to prevent file permission issues I use fixuid. It changes the Docker container’s user/group and file permissions that were set at build time to the UID/GID that the container was started with at runtime.

My manifest is based on toradex-manifest.git - Repo manifest for Toradex Embedded Linux TorizonCore and BSP layer setup for Yocto Project/Openembedded with customizations.

The issue did not occur when my manifest was based on toradex-manifest.git - Repo manifest for Toradex Embedded Linux TorizonCore and BSP layer setup for Yocto Project/Openembedded.

Seems like it was a local caching issue.

I removed these directories:

sstate-cache
tmp/cache
tmp/deploy/

And still I had to:

bitbake perl -c clean; bitbake perl

However, there are still many other packages giving me trouble. I will clean and rebuild them and report back as soon as everything is working as expected.

Hello @lmoellendorf,

Thanks for the update! Let us know how it goes and also if you have more questions!

I ended up removing tmp/ completely to enforce a complete rebuild. There are still some issues with individual package(s) but nothing related to this topic.