#1089105 Broken chroot after an upgrade

#1089105#5
Date:
2024-12-05 16:17:14 UTC
From:
To:
I updated my chroot two hours ago ; then I couldn't use it anymore, so
I tried to update it again :

$ sbuild-update --chroot-mode=unshare --update --dist-upgrade --
autoremove -d unstable
Use of uninitialized value $dist in pattern match (m//) at
/usr/share/perl5/Sbuild/ChrootUnshare.pm line 168.
Use of uninitialized value $dist in pattern match (m//) at
/usr/share/perl5/Sbuild/ChrootUnshare.pm line 168.
Use of uninitialized value $dist in concatenation (.) or string at
/usr/share/perl5/Sbuild/ChrootUnshare.pm line 188.
I: Unpacking /home/jpuydt/.cache/sbuild/unstable-amd64.tar.zst to
/tmp/tmp.sbuild.PlufuvF3vB...
zstd: /*stdin*\: unsupported format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
bad exit status (2): /usr/libexec/sbuild-usernsexec u:0:100000:65536
 g:0:100000:65536
 -- tar --exclude=./dev/urandom --exclude=./dev/random --
exclude=./dev/full --exclude=./dev/null --exclude=./dev/console --
exclude=./dev/zero --exclude=./dev/tty --exclude=./dev/ptmx --directory
/tmp/tmp.sbuild.PlufuvF3vB --extract --zstd
Error setting up unstable chroot
Chroot setup failed at /usr/bin/sbuild-update line 145.

From the error message, I would say something isn't a valid zstd file
but:
$ file /home/jpuydt/.cache/sbuild/unstable-amd64.tar.zst
/home/jpuydt/.cache/sbuild/unstable-amd64.tar.zst: Zstandard compressed
data (v0.8+), Dictionary ID: None


So I'm a bit at loss as to why things are broken.

Cheers,

J.Puydt

#1089105#10
Date:
2024-12-05 16:30:22 UTC
From:
To:
Hi Julien,

* Julien Puydt <julien.puydt@gmail.com> [2024-12-05 17:17]:

Please use mmdebstrap to create a new chroot and not sbuild-update, as
written in the wiki:

https://wiki.debian.org/sbuild#Updating_chroot_manually_.28with_unshare.29

(Leave it open in case josch want's to dig into it.)

Cheers Jochen

#1089105#15
Date:
2024-12-05 16:40:56 UTC
From:
To:
Le jeudi 05 décembre 2024 à 17:30 +0100, Jochen Sprickerhof a écrit :


I created that chroot/tarball a few days ago using that same wiki page,
and used it successfully to build a few packages in the following days.

Until today, when I updated it with sbuild-update. I quoted the line,
and it looks pretty much like what you point to... I just don't use --
upgrade (should I? I don't think it's related to the breakage at hand).

You seem to think I created the chroot with the wrong tool, but I don't
think that's the case.

Cheers,

J.Puydt

#1089105#20
Date:
2024-12-05 17:18:00 UTC
From:
To:
* Julien Puydt <julien.puydt@gmail.com> [2024-12-05 17:40]:

My point is that you should not use sbuild-update but just mmdebstrap to
create a new chroot.

Cheers Jochen

#1089105#25
Date:
2024-12-05 17:52:43 UTC
From:
To:
Hi

Le jeu. 5 déc. 2024, 18:18, Jochen Sprickerhof <jspricke@debian.org> a
écrit :

And my point is that I created it with mmdebstrap as per the wiki
instructions and updated it with sbuild-update as per the wiki
instructions, so I don't see why you keep on insisting that I shouldn't
create the new chroot with sbuild-update, as that was never ever on the
table...

J.Puydt

#1089105#30
Date:
2024-12-05 18:09:57 UTC
From:
To:
* Julien Puydt <julien.puydt@gmail.com> [2024-12-05 18:52]:

To quote the wiki:

"To keep the chroot updated it is recommended to simply delete it and
recreate it by re-running the mmdebstrap command (see above): this is
fast and makes sure the build environment remains clean."

Fine with me.

Cheers Jochen

#1089105#35
Date:
2024-12-06 07:57:03 UTC
From:
To:
Le jeudi 05 décembre 2024 à 19:09 +0100, Jochen Sprickerhof a écrit :
"If you really want to update an old chroot you can call:
   sbuild-update --chroot-mode=unshare --update --upgrade --dist-
upgrade --autoremove unstable"

so I suggest:

Solution A.
  (1) changing the first paragraph to explain that's how it has to be
done (not just "recommends") ;
  (2) and dropping the second paragraph altogether.

Solution B.
  (1) fixing sbuild-update so it doesn't break the chroot.


I can implement the first solution (and I'll then close this report) ;
for the second I don't know anything (and that report can be kept
open).

Cheers,

J.Puydt

#1089105#40
Date:
2024-12-24 14:30:06 UTC
From:
To:
The second would be useful - i think at minimum sbuild-update should give
an error if chroot_mode is unshare: currently it updates chroots for other
backends without warning.

it would be even better if there was a way unpack the chroot, use unshare
to run a command in the unpacked directory and repack the tarball. If
repacking was optional it would aid debugging. (maybe sbuild doesnt need to
ship this as a wrapper, we could add it to the wiki)

#1089105#43
Date:
2024-12-25 07:06:13 UTC
From:
To:
Hi,

Quoting Julien Puydt (2024-12-05 17:17:14)

my hunch is this part of the zstd manual page:

Sbuild does not pass the --force parameter when it passes data to extract to
the zstd utility.

In your /usr/share/perl5/Sbuild/ChrootUnshare.pm, can you try applying this
patch:
--- a/usr/share/perl5/Sbuild/ChrootUnshare.pm +++ b/usr/share/perl5/Sbuild/ChrootUnshare.pm @@ -517,7 +517,7 @@ sub begin_session { } elsif ("\xFD7zXZ" eq substr $chunk, 0, 5) { @decompress = ('xz', '--decompress', '--stdout'); } elsif ("\x28\xB5\x2F\xFD" eq substr $chunk, 0, 4) { - @decompress = ('zstd', '--decompress', '--stdout'); + @decompress = ('zstd', '--decompress', '--stdout', '--force'); } elsif ("\x04\x22\x4d\x18" eq substr $chunk, 0, 4) { # tar does not seem to support lz4 magic, but we do @decompress = ('lz4', '--decompress', '--stdout'); Should that be the problem, we could add the --force flag and call it a day. But as its name implies, the --force flag is doing more things than just allow reading data from standard input (see above). Why does zstd need --force for such a task while all other compressors do not? Sounds like a bug? Thanks! cheers, josch
#1089105#48
Date:
2024-12-30 07:31:58 UTC
From:
To:
Hi,

Quoting Johannes Schauer Marin Rodrigues (2024-12-25 08:06:13)

while hunting down the zstd mess in #1091169 I came up with another solution
than using --force. Could you please update your sbuild installation to 0.88.1
from testing or unstable and then apply this patch:
--- /usr/share/perl5/Sbuild/ChrootUnshare.pm +++ /usr/share/perl5/Sbuild/ChrootUnshare.pm @@ -533,14 +533,15 @@ sub begin_session { my $pid_decompress = fork(); if ($pid_decompress == 0) { open(STDOUT, '>&', $decompress_writer); + open(STDIN, '<', $tarball); close $filter_reader; close $tar_reader; close $filter_writer; if ($self->get_conf('DEBUG')) { printf STDERR ( - "running $decompress[0] --decompress --stdout $tarball\n"); + "running $decompress[0] --decompress --stdout\n"); } - exec @decompress, $tarball; + exec @decompress; } my $pid_filter = fork(); if ($pid_filter == 0) { And then try to run the initial command again and post its output. Thanks! cheers, josch
#1089105#51
Date:
2025-01-06 17:24:42 UTC
From:
To:
Hi Julien,

Quoting Johannes Schauer Marin Rodrigues (2024-12-30 08:31:58)

I think this bug is the same as #1091169. Can you please confirm?

I want to do another subild upload soon and I need your feedback if you want
this issue to be addressed in it.

Thanks!

cheers, josch

#1089105#54
Date:
2025-01-07 10:01:24 UTC
From:
To:
Hello,

Bug #1089105 in sbuild reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/debian/sbuild/-/commit/5a5ff310c0bbe98d61035a3a096075df82f7db17
------------------------------------------------------------------------
sbuild-update: abort if chroot-mode=unshare

sbuild-update does not work with chroot-mode=unshare. Abort in that case
and print an error message, instead of doing the wrong thing.

This also makes sbuild-update read $chroot_mode from the sbuild
configuration file, instead of silently overriding it to schroot.

Closes: #1089105, #1091370
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1089105

#1089105#61
Date:
2025-01-16 07:05:13 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
sbuild, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1089105@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Johannes Schauer Marin Rodrigues <josch@debian.org> (supplier of updated sbuild package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 16 Jan 2025 07:46:28 +0100
Source: sbuild
Architecture: source
Version: 0.88.2
Distribution: unstable
Urgency: medium
Maintainer: sbuild maintainers <sbuild@packages.debian.org>
Changed-By: Johannes Schauer Marin Rodrigues <josch@debian.org>
Closes: 1089035 1089105 1090336 1090358 1091169 1091170 1091370 1092091 1092557
Changes:
 sbuild (0.88.2) unstable; urgency=medium
 .
   [ Johannes Schauer Marin Rodrigues ]
   * lib/Sbuild/Conf.pm:
      - fix examples for ENVIRONMENT_FILTER (Closes: #1090336)
      - do not ignore an empty DEB_BUILD_PROFILES environment variable
      - Add CHROOT_ALIASES configuration option, allowing one to look up chroots
        under a different name (Closes: #1089035)
   * lib/Sbuild/ConfBase.pm:
      - run check after setting all values
      - preserve order of configuration options
      - Set variables to their default values in ~/.config/sbuild/config.pl
        (Closes: #1090358)
   * lib/Sbuild/ChrootUnshare.pm:
      - check if mmdebstrap is installed only when needed
      - instead of passing the tarball path to the decompressor, let sbuild open
        it and feed it to the decompressor program via standard input (Closes:
        #1091169)
   * debian/tests/unshare:
      - install ca-certificates for https debci hosts. Thanks to Paul Gevers
      - run dpkg-deb with --root-owner-group (Closes: #1092091)
   * lib/Sbuild/Build.pm: fail if dpkg --print-foreign-architectures failed
   * lib/Sbuild/ResolverBase.pm: build metapackage with dpkg-deb
     --root-owner-group (Closes: #1092557)
   * Use dpkg-buildtree to figure out if fakeroot is required
   * die if exec fails because it cannot find the program
 .
   [ Simon McVittie ]
   * man: Cross-reference the --build-dir option in BUILD ARTIFACTS
   * man: Document how and where log files are saved
 .
   [ Guillem Jover ]
   * lib/Sbuild/Conf.pm: Do not use deprecated Dpkg::Build::Info module
 .
   [ Chris Hofstaedtler ]
   * Remove deborphan from Suggests:, package was removed
   * sbuild-update: abort if chroot-mode=unshare (Closes: #1089105, #1091370)
 .
   [ Santiago Ruano Rincón ]
   * Add Recommends on iproute2
   * Fix mmdebstrap+unshare setup-hook when handling *-security suites
 .
   [ Jakub Wilk ]
   * man: Remove stray quotation mark
 .
   [ Richard Lewis ]
   * man/sbuild.1.in: remove stray quotation mark
   * Document the need to retain package lists in the chroot if $apt_update is 0
     (Closes: #1091170)
 .
   [ Jochen Sprickerhof ]
   * unshare: Use $BUILD_USER as the default user
   * unshare: Use 'sbuild' as the default user
   * Use BUILD_USER for architecture and disk space check
Checksums-Sha1:
 0f0099edcbf367fae51ea461298ed81e97f28812 2643 sbuild_0.88.2.dsc
 7c8afb029abcb8524160a037aee55cf1ff601080 255988 sbuild_0.88.2.tar.xz
Checksums-Sha256:
 43147313e02531d784b5fed0b81ad45481bc89e0b17f13c89cdc268d91a3af47 2643 sbuild_0.88.2.dsc
 569736857d4e906faf50ce25baa3e10d45d4be983237b70ce4e1e00871557116 255988 sbuild_0.88.2.tar.xz
Files:
 47556984b7a862d35ab78354c7c3a68c 2643 devel optional sbuild_0.88.2.dsc
 1b63edbc9459af6f09986dfc82e34a74 255988 devel optional sbuild_0.88.2.tar.xz
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAmeIq2YACgkQ8sulx4+9
g+ESFQ//Y/wgtNcLRqfw/sIWtUd1OC1a/o2U26BHY9KZjW5Rqp01B4FepDwoH3c/
r+brucA3j2/0nvx6BpcF2EupcMlgPpY4J4EYmisyZrHgYBPlHyc8LyKVm2gDEnPV
LapflaCbdTWprYQoijxdjQ9lGJiz1XQCS+xhwI8EcIK+KXxx18pbB3i3DSLhEkX/
Ud5qHb0Y/tnj+xtdKVZED+Z6AmlGiT0+GEjWw1N7bC+uLy2J8IbdUB37ANopvVtE
l3u54HIh8M/+hDW7B4X/QeB+houFPXzRNZx+QlccWJvf19MiPPKpbOa213ieG5IH
raijuMEwNzH2PevH8nBKA1REcIAyYXlcdk4OaLm3rsiXLk2rPtXaVbFazxMiqP8m
3UyOMPmBfZSjOMjkbVtYHiw6YuA7uYCejyW5h//jW1v4NNBVQZKbHAddLjp4m6+A
oBSbuGLVamTvqcUJG+n94V+U1pRHCtvvvtYHi4h991k4Cph/klzYF3zHmZsxcET6
WBaOv4erPMP1BJkD7B2O5oxGr8tJ/jprEKtbJa1LsNakjDu7pBYumL+mmj4OKlhO
oIjw3ujGfVkXE+9Glmtj5WRTZTzRJ+cYz6zTQfwJRZ3WJxLtmJCUazK+uXi/VL01
M3bNHlwwCAyLDZ9yGm45YwneY7EiMfZytL6S8czYs+FTwXRC8og=
=H3Yw
-----END PGP SIGNATURE-----