Public bug reported:

When an apt-get update fails, for instance due to a mismatch between the
Release and Packages.gz due to a mirror sync/index update, it leaves
files in the /var/lib/apt/lists/partial for the distribution:

15466565     16 -rw-r--r--   1 root     root        13860 Oct 22 12:50 
/var/lib/apt/lists/partial/ourhost_internal_repo_dists_main_Release
 15466663      4 -rw-r--r--   1 root     root          475 Oct 22 12:50 
/var/lib/apt/lists/partial/ourhost_internal_repo_dists_main_Release.gpg
 15471150      0 -rw-r--r--   1 root     root            0 Oct 22 12:52 
/var/lib/apt/lists/partial/ourhost_internal_repo_dists_main_main_binary-amd64_Packages.gz.FAILED

In this case both Release and Release.gpg were complete, however when
running apt-get update again it issues the revalidation requests for
these resources with Range headers that are the length of the file
resulting in '416 Requested Range Not Satisfiable':

GET .../Release HTTP/1.1
Cache-Control: max-age=0
Accept: text/*
Range: bytes=13860-
If-Range: Tue, 22 Oct 2019 12:50:05 GMT
User-Agent: Debian APT-HTTP/1.3 (1.6.12)

HTTP/1.1 416 Requested Range Not Satisfiable

It appears:

- There's no way for apt-get to know if the file is complete so this logic will 
always be hit if the file exists 
https://github.com/Debian/apt/blob/master/methods/http.cc#L956-L962
- The logic for determining whether a server supports range requests is only 
entered if an Accept-Range header exists, however an absence of this header 
means support is not available - 
https://github.com/Debian/apt/blob/master/methods/basehttp.cc#L251

** Affects: apt (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1849368

Title:
  apt-get update issues invalid range requests for previously completed
  downloads

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1849368/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to