[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#959518: apt-transport-http: Repeatable 'Undetermined Error' during package download from snapshot.debian.org



On Wed, Aug 05, 2020 at 12:12:18AM +0100, James Addison wrote:
> Package: apt,snapshot.debian.org
> Followup-For: Bug #959518
> X-Debbugs-Cc: jay@jp-hosting.net
> 
> FWIW, the series of steps in use for repro are:
> 
> # prereq: install apt compile-time dependencies
> # prereq: add apt deb sources, keys as per docs at http://snapshot.debian.org/
> $ git clone "https://salsa.debian.org/apt-team/apt.git";
> $ cd apt
> $ git checkout 1.8.2.z
> $ git cherry-pick -m 1 7d222636954ec95382149e31b314e9828ba05a2e

You also need the commit before that. This fixed the undetermined error
on top of the previous fixes, which probably moved the error into a different
code path :)

Especially

commit cb743d117bcc666dab4c5948b1227ed2edbd0578
Author: Julian Andres Klode <julian.klode@canonical.com>
Date:   Mon Jun 29 11:45:45 2020 +0200

    http: Only return false for EOF if we actually did not read anything
    
    This should avoid the need to Flush the buffer in Die(), because
    if we read anything, we are returning true, and not entering Die()
    at that point.
    
    Also Write() does not have a concept of EOF, so get rid of code
    handling that there. Was that copied from Read()?

But probably the entire merge. These all act badly individually.

Really, just try the master branch instead of going cherry-picking individual
commits.

> $ cmake -DCMAKE_INSTALL_PREFIX=/ .
> $ make
> $ cmdline/apt -o Acquire::Check-Valid-Until=false update
> $ cmdline/apt install -y openjdk-11-jdk

This is wrong, as David already pointed out - it's missing -o Dir::Bin::Methods

I'd also build using dpkg-buildpackage so you get all the right flags. I can never
remember them all, but there's also stuff like libexec and so on that it passes.

> 
> And the error manifests as:
> 
> Get:159 http://snapshot.debian.org/archive/debian-security/20200801T030228Z buster/updates/main amd64 openjdk-11-jdk-headless amd64 11.0.8+10-1~deb10u1 [215 MB]
> Err:159 http://snapshot.debian.org/archive/debian-security/20200801T030228Z buster/updates/main amd64 openjdk-11-jdk-headless amd64 11.0.8+10-1~deb10u1
>   Undetermined Error [IP: 193.62.202.27 80]
> 
> If time allows it might be possible to prepare a self-contained Dockerfile
> with the repro steps if that'd be useful for further debug/investigation.

No, that's not useful at all. You just put a sources.list and a trusted.gpg.d
in a directory (e.g. $PWD/x) with the other files, and then do

apt -o Dir=$PWD/x update
apt -o Dir=$PWD/x download openjdk-11-jdk-headless

I have attached x.tar for convenience.

And that reproduces the issue. Well at least it did early yesterday. Which
is why I could debug it and come up with a fix for it. Though, now i can't
reproduce the undetermined error without the fix either, I just get weird
other errors...

apt -o Dir=$PWD/x install openjdk-11-jdk -y -d

certainly did.

And then you can run this from a source tree like this (at least I do):

dpkg-buildpackage -b
./obj-x86_64-linux-gnu/cmdline/apt -o Dir=$PWD/x -o Dir::Bin::Methods=$PWD/obj-x86_64-linux-gnu/methods update
./obj-x86_64-linux-gnu/cmdline/apt -o Dir=$PWD/x -o Dir::Bin::Methods=$PWD/obj-x86_64-linux-gnu/methods update

You also want to pin snapshot.debian.org to the failing IP I think, as 
the two servers are vastly different.


It's not super reproducible:

jak@jak-t480s:~/Projects/Debian/apt:pu/http-fixes$ lxc exec bu apt download openjdk-11-jdk-headless
Get:1 http://snapshot.debian.org/archive/debian-security/20200502T085134Z buster/updates/main amd64 openjdk-11-jdk-headless amd64 11.0.7+10-3~deb10u1 [215 MB]
Err:1 http://snapshot.debian.org/archive/debian-security/20200502T085134Z buster/updates/main amd64 openjdk-11-jdk-headless amd64 11.0.7+10-3~deb10u1
  Undetermined Error [IP: 2001:1af8:4020:b030:deb::185 80]
W: Download is performed unsandboxed as root as file '/root/openjdk-11-jdk-headless_11.0.7+10-3~deb10u1_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
E: Failed to fetch http://snapshot.debian.org/archive/debian-security/20200502T085134Z/pool/updates/main/o/openjdk-11/openjdk-11-jdk-headless_11.0.7+10-3~deb10u1_amd64.deb  Undetermined Error [IP: 2001:1af8:4020:b030:deb::185 80]
jak@jak-t480s:~/Projects/Debian/apt:pu/http-fixes$ lxc exec bu apt download openjdk-11-jdk-headless
Get:1 http://snapshot.debian.org/archive/debian-security/20200502T085134Z buster/updates/main amd64 openjdk-11-jdk-headless amd64 11.0.7+10-3~deb10u1 [215 MB]
Fetched 215 MB in 20s (10.9 MB/s)                                                                                                                                                                                                                                                          
W: Download is performed unsandboxed as root as file '/root/openjdk-11-jdk-headless_11.0.7+10-3~deb10u1_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

Despite having pinned the IP in /etc/hosts.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

Attachment: x.tar
Description: Unix tar archive


Reply to: