Platform9 Related Package Installation Failing Due To Apt Cache Corruption.

Problem

The host/node will remain Disconnected to Platform9 Management Plane. Within the node Platform9 services like hostagent, and comms will be in failed state due Platform9 related package installation failure.

In the hostagent logs, the errors related to package removal/installation can be observed as shown below:

2023-09-15 10:09:18,450 - pf9_app.py INFO - Removing pf9-comms.5.6.3-1090.bb20653
2023-09-15 10:09:18,615 - pf9_app.py INFO - Setting the desired service state
2023-09-15 10:09:18,616 - pf9_app.py INFO - Setting service state pf9-comms.5.6.3-1090.bb20653. Command: sudo systemctl stop pf9-comms
2023-09-15 10:09:23,644 - pf9_app_db.py ERROR - Erase command failed : sudo /opt/pf9/hostagent/bin/pf9-apt erase pf9-comms. Return code: 1, stdout: , stderr: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apt/cache.py", line 584, in update
pulse_interval)
apt_pkg.Error: E:Repository 'https://aquasecurity.github.io/trivy-repo/deb bionic InRelease' changed its 'Origin' value from 'knqyf263.github.io/trivy-repo/deb' to 'aquasecurity.github.io/trivy-repo/deb', E:Repository 'https://aquasecurit
y.github.io/trivy-repo/deb bionic InRelease' changed its 'Label' value from 'github.io/knqyf263' to 'github.io/aquasecurity'

Environment

  • Platform9 Managed OpenStack - v5.4 and Higher.

  • Ubuntu Operating system.

Cause

The apt cache on the affected node could be corrupted.

Resolution

Updating the repo on the affected node should fix this issue, as shown below:

# apt update
Get:1 https://aquasecurity.github.io/trivy-repo/deb bionic InRelease [3,062 B]
Hit:3 https://apt.releases.hashicorp.com bionic InRelease
Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:9 http://ppa.launchpad.net/zanchey/asciinema/ubuntu bionic InRelease
E: Repository 'https://aquasecurity.github.io/trivy-repo/deb bionic InRelease' changed its 'Origin' value from 'knqyf263.github.io/trivy-repo/deb' to 'aquasecurity.github.io/trivy-repo/deb'
E: Repository 'https://aquasecurity.github.io/trivy-repo/deb bionic InRelease' changed its 'Label' value from 'github.io/knqyf263' to 'github.io/aquasecurity'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N] y
Hit:10 https://baltocdn.com/helm/stable/debian all InRelease