canonical / canonical/cloud-init
package_update fails on IPv6 only host: Could not resolve host: mirrors.rockylinux.org
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 22
Description
# Bug report
When an IPv6 only host is started up with cloud-init under libvirt, the package_update state fails as per the logs below.
After the machine finishes booting, and you log in, "dnf update" works without issue.
It looks like the package_update is being run before the network is ready.
## Steps to reproduce the problem
Pass a cloud-config file containing to the following to a libvirt deployed VM on an IPv6 only network:
```
package_update: true
package_upgrade: true
```
## Environment details
- Cloud-init version: cloud-init-22.1-10.el9_2.0.2.noarch
- Operating System Distribution: Rocky9
- Cloud provider, platform or installer type: libvirt on Rocky8
## cloud-init logs
```
Rocky Linux 9 - BaseOS 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'baseos':
- Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9 [Could not resolve host: mirrors.rockylinux.org]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9 [Could not resolve host: mirrors.rockylinux.org]
2023-11-09 09:53:42,717 - util.py[WARNING]: Package update failed
Rocky Linux 9 - BaseOS 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'baseos':
- Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9&countme=1 [Could not resolve host: mirrors.rockylinux.org]
- Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9 [Could not resolve host: mirrors.rockylinux.org]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9 [Could not resolve host: mirrors.rockylinux.org]
2023-11-09 09:53:43,229 - util.py[WARNING]: Package upgrade failed
Rocky Linux 9 - BaseOS 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'baseos':
- Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9 [Could not resolve host: mirrors.rockylinux.org]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9 [Could not resolve host: mirrors.rockylinux.org]
2023-11-09 09:53:43,581 - util.py[WARNING]: Failed to install packages: ['tcpdump', 'nmap']
2023-11-09 09:53:43,581 - cc_package_update_upgrade_install.py[WARNING]: 3 failed with exceptions, re-raising the last one
2023-11-09 09:53:43,582 - util.py[WARNING]: Running module package-update-upgrade-install () failed
```
Contributor guide
Research direction
Start with cloudinit.config.cc_package_update_upgrade_install and reproduce the package_update and package_upgrade failure on a Rocky Linux 9 IPv6-only libvirt VM. Compare the early boot behavior with a later manual dnf update and determine how network readiness affects repository access. Done means package operations no longer fail solely because the network is not ready.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100