Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail and retry on "Some index files failed to download" #911

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 19, 2024

  1. Fail and retry on "Some index files failed to download"

    APT doesn't error out even in the following case since it's a warning
    instead of an error. And it allows charms to move on without having a
    proper APT index and let them install unwanted versions of software for
    example. The apt_update part should fail if it's marked as fatal in such
    cases so that it can be retried or charm can raise it as an error to
    users appropriately.
    
    "--error-on=any" is supported for >= bionic.
    https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1693900
    
    Closes: juju#910
    
    [w/o "--error-on=any"]
    ```
    $ sudo apt-get update; echo $?
    
    ...
    
    Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
      Could not connect to squid-deb-proxy.lxd:8000 (10.0.8.2).
        - connect (113: No route to host)
    Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
      Could not connect to squid-deb-proxy.lxd:8000 (10.0.8.2).
        - connect (113: No route to host)
    Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
      Unable to connect to squid-deb-proxy.lxd:8000:
    Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
      Unable to connect to squid-deb-proxy.lxd:8000:
    Reading package lists... Done
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease
      Could not connect to squid-deb-proxy.lxd:8000 (10.0.8.2).
        - connect (113: No route to host)
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease
      Unable to connect to squid-deb-proxy.lxd:8000:
    
    ...
    
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    ```
    -> 0
    
    [w/ "--error-on=any"]
    ```
    $ sudo apt-get --error-on=any update; echo $?
    
    ...
    
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    ```
    -> 100
    nobuto-m committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    c75ea8b View commit details
    Browse the repository at this point in the history