Harbor Data Loss scenario: Upgrade of harbor-container-registry tile results in data loss. smoke-test errand shows error: "run-errand smoke-testing --when-changed" and "Exit Status: 1"
The plan is to utilize an attribute within the Harbor tile metadata.yml file. The attribute, minimum_version_for_upgrade, will be implemented to avoid this in future releases.
Environment
VMware Harbor Registry: versions v2.11.0 and earlier
Opsmanager: v3.0.32+LTS-T
Cause
Details:
Harbor upgrades may include upgrades to new Postgres database versions. Upgrades may also include Postgres database schema changes.
Any upgrade attempts which skip these changes may result in the Postgres database to become corrupt or lost.
Potential scenarios:
NOTE: There can be different scenarios depending on source and target Harbor versions. Variables include, but not limited to:
Postgres versions
Harbor db schema differences
Reported Scenario:
Environment Details:
Source Harbor tile version is v2.7.0
Opsmanager version: v3.0.32+LTS-T
Harbor tile is upgraded directly to v2.11.0
Supported Path v2.7.0 -> v2.9.x -> v2.11.0
Data no longer exists in Harbor web UI
Scenario Details:
In the above environment, the harbor-db cannot support upgrade from v2.7.0 to v2.11.0.
Harbor v2.7.0 runs Postgres 13.
Harbor v2.11.0 runs Postgres version 15 which only supports upgrade from Postgres 14.
NOTE: Postgres 14 is introduced in Harbor v2.9 and v2.10.
Resolution
Workaround:
There is a recovery procedure. Recovery procedures may be different, depending upon the original Harbor version and the upgraded version.
Therefore, it is important to engage Tanzu Support. To expedite, include the following in the support request: