#962807 binfmt-support from Debian stable reports errors/warnings within lxc guests

Package:
binfmt-support
Source:
binfmt-support
Description:
Support for extra binary formats
Submitter:
Florian La Roche
Date:
2022-03-31 06:09:03 UTC
Severity:
normal
#962807#5
Date:
2020-06-14 11:55:45 UTC
From:
To:
Dear Maintainer,


Installing Debian stable within lxc gives warnings/errors for
binfmt-support. Expected and nothing unusual. Maybe you can detect lxc
and just not enable any access to /proc/sys/fs/binfmt_misc?
Thos only occurs with Debian stable (10), Debian testing seems to be ok
already.

If no easy solution can be found or this does not warrant a backport
from the current package into the stable release, feel free to just close this
bug-report.

best regards,

Florian La Roche



logmessages during installation of the deb package:

binfmt-support (2.2.0-2) wird eingerichtet ...
Created symlink /etc/systemd/system/multi-user.target.wants/binfmt-support.service → /lib/systemd/system/binfmt-support.service.
Job for binfmt-support.service failed because the control process exited with error code.
See "systemctl status binfmt-support.service" and "journalctl -xe" for details.
invoke-rc.d: initscript binfmt-support, action "start" failed.
● binfmt-support.service - Enable support for additional executable binary formats
   Loaded: loaded (/lib/systemd/system/binfmt-support.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2020-06-13 18:55:34 UTC; 4ms ago
     Docs: man:update-binfmts(8)
  Process: 22871 ExecStart=/usr/sbin/update-binfmts --enable (code=exited, status=2)
 Main PID: 22871 (code=exited, status=2)

Jun 13 18:55:34 debian01 systemd[1]: Starting Enable support for additional executable binary formats...
Jun 13 18:55:34 debian01 update-binfmts[22871]: update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/status for writing: Permission denied
Jun 13 18:55:34 debian01 update-binfmts[22871]: update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/status for writing: Permission denied
Jun 13 18:55:34 debian01 update-binfmts[22871]: update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/register for writing: Permission denied
Jun 13 18:55:34 debian01 update-binfmts[22871]: update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/status for writing: Permission denied
Jun 13 18:55:34 debian01 update-binfmts[22871]: update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/register for writing: Permission denied
Jun 13 18:55:34 debian01 update-binfmts[22871]: update-binfmts: exiting due to previous errors
Jun 13 18:55:34 debian01 systemd[1]: binfmt-support.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 13 18:55:34 debian01 systemd[1]: binfmt-support.service: Failed with result 'exit-code'.
Jun 13 18:55:34 debian01 systemd[1]: Failed to start Enable support for additional executable binary formats.

#962807#10
Date:
2020-06-25 13:36:35 UTC
From:
To:
Interesting; I haven't changed anything relevant between 2.2.0-2 and
2.2.1-1, so I don't see why stable should fail while testing works.
I replaced all my uses of lxc with lxd years ago, so I don't currently
remember how to set up a reproduction environment - could you give me a
recipe?

#962807#15
Date:
2020-06-25 14:18:41 UTC
From:
To:
Hello Colin Watson,

the following should work (either directory install or on LVM,
choosing buster or testing):

RELEASE="buster"
#RELEASE="testing"
#LVM="--bdev lvm --lvname lxc-debian05 --vgname debvg --fssize 30G"
sudo lxc-create -n debian05 $LVM -t debian -- -r $RELEASE
--enable-non-free --auth-key ~/.ssh/id_rsa.pub
sudo lxc-start -n debian05

I am then using the following line to configure the system with more software:
ssh -T root@$IPADRESSE "bash -s" < setup.sh

With setup.sh from:
https://github.com/laroche/arm-devel-infrastructure/blob/master/vmdb2-debian/setup.sh

(Sorry if the above is not broken down to a smaller deb package set. I
am away for two weeks, but can
help with further questions once I am back. Could be some qemu
additions from setup.sh instead of only
binfmt-support. I am only installing further qemu software, not adding
anything special to its configuration
beyond normal Debian package installs.)

This is using Debian testing to install a lxc guest. Kernel is 5.7.6.

best regards,

Florian La Roche





Output during package install:

udev (241-7~deb10u4) wird eingerichtet ...
binfmt-support (2.2.0-2) wird eingerichtet ...
Created symlink
/etc/systemd/system/multi-user.target.wants/binfmt-support.service →
/lib/systemd/system/binfmt-support.service.
Job for binfmt-support.service failed because the control process
exited with error code.
See "systemctl status binfmt-support.service" and "journalctl -xe" for details.
invoke-rc.d: initscript binfmt-support, action "start" failed.
● binfmt-support.service - Enable support for additional executable
binary formats
   Loaded: loaded (/lib/systemd/system/binfmt-support.service;
enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-06-25 16:01:29
CEST; 4ms ago
     Docs: man:update-binfmts(8)
  Process: 22343 ExecStart=/usr/sbin/update-binfmts --enable
(code=exited, status=2)
 Main PID: 22343 (code=exited, status=2)

Jun 25 16:01:29 debian03 systemd[1]: Starting Enable support for
additional executable binary formats...
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/status for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/register for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/status for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/register for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
exiting due to previous errors
Jun 25 16:01:29 debian03 systemd[1]: binfmt-support.service: Main
process exited, code=exited, status=2/INVALIDARGUMENT
Jun 25 16:01:29 debian03 systemd[1]: binfmt-support.service: Failed
with result 'exit-code'.
Jun 25 16:01:29 debian03 systemd[1]: Failed to start Enable support
for additional executable binary formats.
python3-requests-kerberos (0.11.0-2) wird eingerichtet ...
ieee-data (20180805.1) wird eingerichtet ...





# journalctl  | grep  binfmt
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/status for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/register for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/status for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
warning: unable to open /proc/sys/fs/binfmt_misc/register for writing:
Permission denied
Jun 25 16:01:29 debian03 update-binfmts[22343]: update-binfmts:
exiting due to previous errors
Jun 25 16:01:29 debian03 systemd[1]: binfmt-support.service: Main
process exited, code=exited, status=2/INVALIDARGUMENT
Jun 25 16:01:29 debian03 systemd[1]: binfmt-support.service: Failed
with result 'exit-code'.

#962807#20
Date:
2022-03-31 05:53:59 UTC
From:
To:
This situation causes a problem whenever trying to remove an old Python
version within an LXC container/guest.

E.g. after a dist-upgrade from Debian 10 to 11, running apt autoremove:

Removing python3.7 (3.7.3-2+deb10u3) ...
Removing libpython3.7-stdlib:amd64 (3.7.3-2+deb10u3) ...
Removing python3.7-minimal (3.7.3-2+deb10u3) ...
update-binfmts: warning: unable to open /proc/sys/fs/binfmt_misc/python3.7
for writing: Permission denied
update-binfmts: warning: unable to disable binary format python3.7
update-binfmts: exiting due to previous errors
dpkg: error processing package python3.7-minimal (--remove):
 installed python3.7-minimal package pre-removal script subprocess returned
error exit status 2
dpkg: too many errors, stopping
Errors were encountered while processing:
 python3.7-minimal
Processing was halted because there were too many errors.
E:Sub-process /usr/bin/dpkg returned an error code (1)

See also
https://bugs.launchpad.net/ubuntu/+source/binfmt-support/+bug/1862347

According to Stéphane Graber (one of the maintainers of LXC/LXD):
https://github.com/lxc/lxc/issues/388#issuecomment-71416534