.
Sonatype has become aware of a PostgreSQL issue which can cause database indexes to stop functioning correctly. This problem is specific to PostgreSQL, but since our products can be configured to use PostgreSQL as their database this issue may cause failures in our products.
What Products Are Affected?
All versions of the following Sonatype products which are using PostgreSQL database could be affected:
- Sonatype Nexus Repository 3
- Sonatype IQ Server
What causes this problem?
The Linux component "glibc" version 2.28 includes a major update to locale data which affects the operation of Postgres database indexes. If the upgrade of the OS running PostgreSQL causes glibc to transition past version 2.28 you will be affected by this problem. Of particular note, an upgrade from RHEL 7 to RHEL 8 or later will cause this issue. See below for a full list of affected distributions. After the OS running PostgreSQL is upgraded all database indexes using btree indexes on text based columns may stop functioning. Further information can be found in this PostgreSQL documentation link :
How do I know if I'm affected?
After upgrading the PostgreSQL host operating system you may see exceptions with a specific message in your Nexus Repository 3 or Sonatype Lifecycle IQ Server application log:
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint
This is an indication you have been affected by this issue. Product behaviors as a result of these exceptions will vary as it will entirely depend on the database indexes affected.
PostgreSQL Host Linux Distributions Affected
- Redhat Enterprise Linux - Upgrade from version 7 to 8 or higher
- SUSE Enterprise - Upgrade from SLE15 service pack 2 to a newer version
- Ubuntu - Upgrade from version 18.04 to 18.10 or higher
Other common Linux distributions are also affected.
The end of life date for Redhat Enterprise 7 is June 30, 2024. If your Postgres is running on Redhat 7 or earlier make sure your IT department is aware of this problem, before any OS upgrades are done.
Recommended Action
Before upgrading the operating system of the machine running PostgreSQL check to see if the upgrade will cause this issue. Shut down the Nexus Repo or IQ Server instance before upgrading the OS running Postgres.
After upgrade run this SQL against the database used by Sonatype product:
REINDEX DATABASE <databasename>;
If the reindex fails due to duplicate records contact Sonatype Support for help.
Do not start up our product if there are duplicated records. Running it while the indexes are not functioning correctly will cause the number of duplicated records to increase.
Example of an error which indicates the reindex has failed due to duplicated records:
ERROR: could not create unique index "uk_npm_asset_repository_path_ccnew"
DETAIL: Key (repository_id, path)=(1, /ansi-colors) is duplicated.