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

Bug#720345: 'apt-get update' considers connection failures non-transient



Hi!

I was unable to find Debian squeeze to reproduce the problem with apt
0.8.16. Instead I have re-tested the issue with Debian trixie.




A. configuration of client machine

root@debian:~# grep CODENAME /etc/os-release
VERSION_CODENAME=trixie
root@debian:~#
root@debian:~# apt --version
apt 2.9.34 (amd64)
root@debian:~#
root@debian:~# ip --brief addr show ens3
ens3             UP             10.0.0.56/8
root@debian:~#
root@debian:~# cat /etc/apt/sources.list
deb http://deb.debian.org/debian/ sid main
deb [trusted=yes] http://10.0.0.237/sid sid main
root@debian:~#
root@debian:~# ls /etc/apt/preferences*
root@debian:~# ls /etc/apt/preferences.d/*
ls: cannot access '/etc/apt/preferences.d/*': No such file or directory
root@debian:~#

As you can see, sources.list includes a second mirror specified by an
IP. The mirror is available on a server, i.e. on a second host in my
10.0.0.0/8 network.




B. scenario with server machine being powered off

root@debian:~# apt-get update
Hit:1 http://deb.debian.org/debian sid InRelease
Ign:2 http://10.0.0.237/sid sid InRelease
Ign:2 http://10.0.0.237/sid sid InRelease
Ign:2 http://10.0.0.237/sid sid InRelease
Err:2 http://10.0.0.237/sid sid InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237). - connect (113: No route to host)
  Unable to connect to 10.0.0.237:http:
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/sid/dists/sid/InRelease  Unable to connect to 10.0.0.237:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.
N: Some sources can be modernized. Run 'apt modernize-sources' to do so.
root@debian:~# echo $?
0
root@debian:~#

apt behaves as expected by the reporter of the ticket.




C. scenario with server machine being powered on, but unavailable

I made sure that server's data is in client's arp table, but the server
won't reply to TCP SYN.

root@debian:~# apt-get update
Hit:1 http://deb.debian.org/debian sid InRelease
Ign:2 http://10.0.0.237/sid sid InRelease
Ign:2 http://10.0.0.237/sid sid InRelease
Ign:2 http://10.0.0.237/sid sid InRelease
Err:2 http://10.0.0.237/sid sid InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237), connection timed out
  Unable to connect to 10.0.0.237:http:
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/sid/dists/sid/InRelease  Unable to connect to 10.0.0.237:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.
N: Some sources can be modernized. Run 'apt modernize-sources' to do so.
root@debian:~# echo $?
0
root@debian:~#

apt behaves as expected by the reporter of the ticket.




D. scenario where server machine is powered on and responding at TCP
layer, but with http server being down (and thus not being able to
serve packages)

root@debian:~# apt-get update
Ign:1 http://10.0.0.237/sid sid InRelease
Hit:2 http://deb.debian.org/debian sid InRelease
Ign:1 http://10.0.0.237/sid sid InRelease
Ign:1 http://10.0.0.237/sid sid InRelease
Err:1 http://10.0.0.237/sid sid InRelease
  Could not connect to 10.0.0.237:80 (10.0.0.237). - connect (111: Connection refused)
  Unable to connect to 10.0.0.237:http:
Reading package lists... Done
W: Failed to fetch http://10.0.0.237/sid/dists/sid/InRelease  Unable to connect to 10.0.0.237:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.
N: Some sources can be modernized. Run 'apt modernize-sources' to do so.
root@debian:~# echo $?
0
root@debian:~#

apt behaves as expected by the reporter of the ticket.




To sum up: in situations that appear (to me) to be transient errors, apt
does the following:
 - logs message about "some index files failed to download" as warning,
   not as an error,
 - sets exit status to 0 (zero).

I didn't attempt to search for a commit that fixes this. The bug was
reported in 2013 and that would be a long bisect session. I believe
that my tests are sufficient to show that the behaviour is now as
expected.

Kamil


Reply to: