Bug 1301953 - mock builds fail with nspawn, buildroot missing /bin/su
Summary: mock builds fail with nspawn, buildroot missing /bin/su
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: mock
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1468802
TreeView+ depends on / blocked
 
Reported: 2016-01-26 12:41 UTC by Matthew Gyurgyik
Modified: 2017-07-08 07:23 UTC (History)
9 users (show)

Fixed In Version: mock-1.2.17-1.fc22 mock-1.2.17-1.fc24 mock-1.2.17-1.el6 mock-1.2.17-1.el7 mock-1.2.17-1.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-31 01:53:55 UTC


Attachments (Terms of Use)
Verbose log of a build attempt (25.10 KB, text/plain)
2016-02-27 09:07 UTC, Ville Skyttä
no flags Details

Description Matthew Gyurgyik 2016-01-26 12:41:16 UTC
Description of problem:
The buildroot does not contain /bin/su.

Therefore `/usr/bin/systemd-nspawn -q -M 0100e5ddf07b4eab9ac259f76aa547f7 -D /var/lib/mock/epel-7-x86_64/root /bin/su -l mockbuild -c /bin/rpm -Uvh --nodeps /builddir/build/originals/repowatch-20150913git8566d2f-1.el7.src.rpm` fails.


Version-Release number of selected component (if applicable):
mock-1.2.14


Actual results:

Build fails due to missing su library

DEBUG util.py:474:  Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'eaa93d4df39e476fa924cdf3968a1ab8', '-D', '/var/lib/mock/epel-7-x86_64/root', '/bin/su', '-l', 'mockbuild', '-c', '/bin/rpm -Uvh --nodeps /builddir/build/originals/repowatch-20150913git8566d2f-1.el7.src.rpm'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\x1b]0;<mock-chroot>\x07<mock-chroot>"', 'HOME': '/builddir', 'CCACHE_DIR': '/tmp/ccache', 'CCACHE_UMASK': '002'} and shell False
DEBUG util.py:399:  Directory /var/lib/mock/epel-7-x86_64/root lacks the binary to execute or doesn't look like a binary tree. Refusing.

[build2 SPECS]$ sudo /usr/bin/systemd-nspawn -q -M eaa93d4df39e476fa924cdf3968a1ab8 -D /var/lib/mock/epel-7-x86_64/root /usr/bin/ls /bin/su
/usr/bin/ls: cannot access /bin/su: No such file or directory


Expected results:

/bin/su should be installed inside the chroot and build should succeed


Additional info:

adding 'util-linux' to `config_opts['chroot_setup_cmd'] = 'install @buildsys-build'` solves the problem.

Comment 1 Miroslav Suchý 2016-02-25 17:13:48 UTC
Fixed in commit:
* 00ab711 (HEAD -> devel, origin/devel) do not call /bin/su and rather utilize --user of systemd-nspawn [RHBZ#1301953]

Comment 2 Ville Skyttä 2016-02-27 09:07:17 UTC
Created attachment 1131026 [details]
Verbose log of a build attempt

This change broke my local mock setup. I'm running mock upstream git master in place with this wrapper script in the mock dir:

#!/bin/sh
exec sudo $(dirname $0)/py/mock.py --configdir=/etc/mock "$@"

Verbose build log from a build attempt is attached. The srpm rebuild with "rpmbuild -bs" is the last thing done, according to the log it exits successfully with return code 0, but produces no other output and no srpm, and that's it.

Comment 3 Ville Skyttä 2016-02-27 09:08:59 UTC
(Forgot to note that I'm running mock on F-23)

Comment 4 Matthew Gyurgyik 2016-02-29 16:35:09 UTC
I think this changes breaks mocks for RHEL6 containers.

$ sudo /bin/systemd-nspawn -q -M rhel-6-x86_64 id jenkins
uid=10813(jenkins) gid=21373(jenkins) groups=21373(jenkins)

$ sudo /bin/systemd-nspawn --user=jenkins -M rhel-6-x86_64 id jenkins
Spawning container rhel-6-x86_64 on /var/lib/machines/rhel-6-x86_64.
Press ^] three times within 1s to kill container.
Container rhel-6-x86_64 failed with error code 1.

I think the above behavior is seen because getent initgroups is not supported by RHEL6.

On a mailing list thread back in 2014 Lennart stated:

"There's nspawn's --user= switch which relies on glibc's "getent"
binary to be available in the container, which it will use to resolve
the username in the container's context and then change to it."

"The getent binary has been part of glibc for a long time, but note
that we make use of "getent initgroups" which is a more recent
addition..."

http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/23419

Comment 5 Miroslav Suchý 2016-03-08 20:49:52 UTC
> I think this changes breaks mocks for RHEL6 containers.

Then I would say - lets not support it on RHEL6. :( Mock with nspawn backend still has too many reported and unfixed bugs that it cannot be called stable. I would love to make it stable on recent Fedoras and then go back and eventually make it work on older systems.

> The srpm rebuild with "rpmbuild -bs" is the last thing done, according to the log it exits successfully with return code 0, but produces no other output and no srpm, and that's it.

Fixed in commit:
* 8200ce4 define command that it works with old-chroot too [RHBZ#1301953]

Comment 6 Fedora Update System 2016-03-08 20:53:18 UTC
mock-1.2.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-66229b4649

Comment 7 Fedora Update System 2016-03-08 20:53:43 UTC
mock-1.2.16-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3405d4e45b

Comment 8 Fedora Update System 2016-03-08 20:54:17 UTC
mock-1.2.16-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a9958aa8eb

Comment 9 Fedora Update System 2016-03-08 20:54:34 UTC
mock-1.2.16-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-bbb4bfc16f

Comment 10 Fedora Update System 2016-03-08 20:54:53 UTC
mock-1.2.16-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-25ff2f1000

Comment 11 Fedora Update System 2016-03-09 21:23:28 UTC
mock-1.2.16-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-66229b4649

Comment 12 Fedora Update System 2016-03-09 22:55:27 UTC
mock-1.2.16-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a9958aa8eb

Comment 13 Fedora Update System 2016-03-09 23:18:27 UTC
mock-1.2.16-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-25ff2f1000

Comment 14 Fedora Update System 2016-03-09 23:20:57 UTC
mock-1.2.16-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3405d4e45b

Comment 15 Fedora Update System 2016-03-10 01:56:46 UTC
mock-1.2.16-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-bbb4bfc16f

Comment 16 Fedora Update System 2016-03-11 09:08:11 UTC
mock-1.2.17-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-bbb4bfc16f

Comment 17 Fedora Update System 2016-03-11 09:17:16 UTC
mock-1.2.17-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-66229b4649

Comment 18 Fedora Update System 2016-03-11 19:27:49 UTC
mock-1.2.17-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-bbb4bfc16f

Comment 19 Fedora Update System 2016-03-12 16:54:21 UTC
mock-1.2.17-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-66229b4649

Comment 20 Fedora Update System 2016-03-15 19:06:29 UTC
mock-1.2.17-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-23c93722c3

Comment 21 Fedora Update System 2016-03-15 19:06:52 UTC
mock-1.2.17-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-d4770f601d

Comment 22 Fedora Update System 2016-03-16 02:20:46 UTC
mock-1.2.17-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-d4770f601d

Comment 23 Fedora Update System 2016-03-16 02:51:02 UTC
mock-1.2.17-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-23c93722c3

Comment 24 Fedora Update System 2016-03-20 20:21:12 UTC
mock-1.2.17-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2016-03-26 18:17:56 UTC
mock-1.2.17-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2016-03-28 14:54:25 UTC
mock-1.2.16-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-a9958aa8eb

Comment 27 Fedora Update System 2016-03-28 20:49:44 UTC
mock-1.2.17-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-a9958aa8eb

Comment 28 Fedora Update System 2016-03-31 01:53:36 UTC
mock-1.2.17-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 29 Fedora Update System 2016-03-31 05:28:58 UTC
mock-1.2.17-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 30 Fedora Update System 2016-04-02 04:20:57 UTC
mock-1.2.17-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 31 Lukas Slebodnik 2017-06-05 16:12:42 UTC
(In reply to Matthew Gyurgyik from comment #4)
> I think this changes breaks mocks for RHEL6 containers.
> 
> $ sudo /bin/systemd-nspawn -q -M rhel-6-x86_64 id jenkins
> uid=10813(jenkins) gid=21373(jenkins) groups=21373(jenkins)
> 
> $ sudo /bin/systemd-nspawn --user=jenkins -M rhel-6-x86_64 id jenkins
> Spawning container rhel-6-x86_64 on /var/lib/machines/rhel-6-x86_64.
> Press ^] three times within 1s to kill container.
> Container rhel-6-x86_64 failed with error code 1.
> 
> I think the above behavior is seen because getent initgroups is not
> supported by RHEL6.
>
 
FYI If systemd want to be more compatible here in container world then they could use "id" for the same purpose which is available even in el5

sh$ getent initgroups test_user
test_user              20728 1070 5977
sh$ id -G test_user
20728 5977 1070

Comment 32 Steven Haigh 2017-07-08 07:23:39 UTC
I can confirm this update has broken all package building on EL7 hosts in an EL6 mock environment.

I've tagged BZ#1468802 as depending on this.


Note You need to log in before you can comment on or make changes to this bug.