Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P piuparts
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • DebianDebian
  • piuparts
  • Merge requests
  • !34

p: new option --update-retries <num> to re-run apt-get update

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Michael Prokop requested to merge mika/piuparts:mika/apt-retry into develop Feb 16, 2021
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 2

If the Packages file gets rewritten during apt-get update execution, then piupart might fail with a hashsum mismatch error, like:

| DEBUG: Starting command: ['chroot', '/var/cache/pbuilder/tmp.3l19K3MgeX_piuparts_tmp/tmp1m34xz', 'apt-get', 'update']
| DUMP:
| [...]
| Err:5 https://deb.example.com/autobuild gerrit_mika_foobar/main amd64 Packages
|   File has unexpected size (1338 != 1346). Mirror sync in progress? [IP: 10.10.42.42 443]
|   Hashes of expected file:
|    - Filesize:1346 [weak]
|    - SHA256:5af5db54c0d80e595a247a2070a1f8381468cbdacea1b62ead353d5bea074697
|    - SHA1:61962e3dcd01055a4baf3ab8e318c17832b6b0fd [weak]
|    - MD5Sum:92f602acb8051cfd90b3e33900a29932 [weak]
|   Release file created at: Tue, 16 Feb 2021 01:13:26 +0000
| [...]
| Reading package lists...
| E: Failed to fetch https://deb.example.com/autobuild/dists/gerrit_mika_foobar/main/binary-amd64/Packages.gz  File has unexpected size (1338 != 1346). Mirror sync in progress? [IP: 10.10.42.42 443]
|    Hashes of expected file:
|     - Filesize:1346 [weak]
|     - SHA256:5af5db54c0d80e595a247a2070a1f8381468cbdacea1b62ead353d5bea074697
|     - SHA1:61962e3dcd01055a4baf3ab8e318c17832b6b0fd [weak]
|     - MD5Sum:92f602acb8051cfd90b3e33900a29932 [weak]
|    Release file created at: Tue, 16 Feb 2021 01:13:26 +0000
| E: Some index files failed to download. They have been ignored, or old ones used instead.
| ERROR: Command failed (status=100): ['chroot', '/var/cache/pbuilder/tmp.3l19K3MgeX_piuparts_tmp/tmp1m34xz', 'apt-get', 'update']

By giving the user an option to retry the update procedure (up to times, as specified on the command line), we increase chances for a successful build. This is useful especially in busy continuous integration/delivery environments, lacking by-hash support (see https://www.chiark.greenend.org.uk/~cjwatson/blog/no-more-hash-sum-mismatch-errors.html), for example all repositories using reprepro, which doesn't support by-hash yet (see https://bugs.debian.org/820660).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: mika/apt-retry