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

apt_update W: Some index files failed to download. They have been ignored, or old ones used instead shouldn't be ignored #910

Open
nobuto-m opened this issue Aug 19, 2024 · 0 comments · May be fixed by #911

Comments

@nobuto-m
Copy link
Contributor

For example in https://bugs.launchpad.net/charm-ovn-chassis/+bug/2070332/comments/19

The charm added an overlay repository to offer a newer version of the software on top of what Ubuntu archive offers (ovn 20.03 in Ubuntu focal vs 22.03 in Cloud Archive repository).

However, the following warnings were recorded but the charm-helper code allowed the charm to move o n and install the software with an old version using the default Ubuntu archive.

2024-08-17 03:38:04 WARNING unit.ovn-chassis-dpdk/0.install logger.go:60 W: Failed to fetch http://ubuntu-cloud.archive.canonical.com/ubuntu/dists/focal-updates/ovn-22.03/InRelease 503 Service Unavailable [IP: 192.168.11.12 8000]
2024-08-17 03:38:04 WARNING unit.ovn-chassis-dpdk/0.install logger.go:60 W: Some index files failed to download. They have been ignored, or old ones used instead.

The expected behavior is the code should error out there and let the helper or charm retry the operation or simply wait an error resolution with an human intervention.

@nobuto-m nobuto-m changed the title apt_install W: Some index files failed to download. They have been ignored, or old ones used instead shouldn't be ignored apt_update W: Some index files failed to download. They have been ignored, or old ones used instead shouldn't be ignored Aug 19, 2024
nobuto-m added a commit to nobuto-m/charm-helpers that referenced this issue Aug 19, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant