E: Method gave invalid 400 URI Failure message: Could not switch saved
set-user-ID
E: Method http has died unexpectedly!
E: Sub-process http returned an error code (112)
This seems to be the problem and related to apt. For some reason, apt is not
able to
switch its user id to "_apt". I'm not sure yet why.
So... next attempt with pbuilder and strace:
sudo strace -f pbuilder create --loglevel D --debootstrapopts
--arch=sparc64 --debootstrapopts
--keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg
--buildplace pbuilder/sid-sparc64.cow --mirror
http://ftp.ports.debian.org/debian-ports/ --distribution sid --no-targz
2>pbuilder.strace
What I can gather from the 600MB trace:
[pid 102267] execve("/usr/lib/apt/methods/http",
["/usr/lib/apt/methods/http"], 0x2674910 /* 28 vars */ <unfinished ...>
...
[pid 102267] write(1, "400 URI Failure\nMessage: Could n"..., 76) = 76
...
[pid 102267] exit_group(112) = ?
...
[pid 102267] +++ exited with 112 +++
So the failing binary is most likely: /usr/lib/apt/methods/http
Exit code: 112
Last thing it was processing before failing:
/var/lib/apt/lists/partial/ftp.ports.debian.org_debian-ports_dists_sid_InRelease
Interestingly, it doesn't seem to have any issue setting the uid and
euid to _apt:
[pid 102267] setgroups(1, [0] <unfinished ...>
[pid 102267] <... setgroups resumed>) = 0
...
[pid 102267] setresgid(65534, 65534, 65534) = 0
[pid 102267] setresuid(42, 42, 42) = 0
[pid 102267] getgid() = 65534
[pid 102267] getegid() = 65534
[pid 102267] getuid() = 42
[pid 102267] geteuid() = 42
[pid 102267] getresuid([42], [42], [42]) = 0
[pid 102267] write(1, "400 URI Failure\nMessage: Could n"..., 76) = 76
42 and 65534 are in fact the uid and gid of the _apt user, according to
pbuilder/sid-sparc64.cow/etc/passwd . Maybe it expects something else
instead? But why it call setresuid(_apt, _apt, _apt) then...
This could be a red herring, though. Maybe there is really an issue with
the Release file or an HTTP error, but it's not detected/reported
correctly. Fun fact: /usr/lib/apt/methods/http seems to be
multi-threaded. Doesn't make it easier to trace...