Unable to upgrade nexus.properties with whitelisted storage
search cancel

Unable to upgrade nexus.properties with whitelisted storage

book

Article ID: 275007

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio) CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction

During upgrade of Nexus repository following error appears in catalina.out file :

2023-10-04 13:48:29,224+0000 INFO  [main]  org.sonatype.nexus.NxApplication - This is an upgraded instance of Nexus.
2023-10-04 13:48:29,224+0000 INFO  [main]  org.sonatype.nexus.NxApplication - Nexus Work Directory : /opt/RA/sonatype-work/nexus
2023-10-04 13:48:29,224+0000 INFO  [main]  org.sonatype.nexus.NxApplication - Started Nexus Repository Manager OSS 2.14.20-02
2023-10-04 13:48:29,226+0000 ERROR [main]  org.sonatype.nexus.proxy.storage.StorageWhitelistUpgradeEvent - Unable to upgrade nexus.properties with whitelisted storage
java.nio.file.NoSuchFileException: /opt/RA/webapps/nexus/WEB-INF/conf/nexus.properties
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)

Environment

Release Automation 6.8

Cause

During upgrade Nexus is upgraded to version 2.14.20-02
 
Nexus upgrade is looking for the file /opt/RA/webapps/nexus/WEB-INF/conf/nexus.properties but it could not find it and displays the error message.
It could not find it because the file is under /opt/RA/webapps/nexus/WEB-INF/classes/nexus.properties
 
Nexus upgrade would like to update the file nexus.properties in order to add the parameter nexus.override.local.storage.whitelist
 
See in this page :
 

Override Storage Location

You can choose to override the storage location for a specific repository. You would do this if you were concerned about storage and wanted to put the contents of a specific repository (such as Central) in a different location.

NEW IN 2.14.15

Storage locations must be whitelisted to be available for use in a repository configuration. 
The target location must be added to the nexus.override.local.storage.whitelist property in nexus.properties (see Configuration Directory). This is a comma-separated list of paths which can then be set for the overridden storage location of a repository. Subdirectories contained in the final directory of a whitelisted path are automatically included as allowed locations (e.g., if /home/nexus/storage is set in the property then /home/nexus/storage/repo1 becomes a valid storage location, but /home/nexus/other-storage would not be).

This property will be automatically populated using existing configuration values on repositories upon upgrading to the latest NXRM2 version if the property is not found during upgrade.

 
 
So parameter nexus.override.local.storage.whitelist is needed to indicate the list of allowed override storage locations for repositories you could specify in field "Override Local Storage Location" :
 
 
 
Example of nexus.properties with added parameter :
 
# WAR specific configuration requirements
nexus-work=./sonatype-work/nexus
runtime=${bundleBasedir}
nexus-app=${runtime}

# Storage whitelist
# Generated using existing configured values from all repositories if not found on upgrade
# Comma-separated list of allowed override storage locations for repositories
# See https://links.sonatype.com/products/nxrm2/configuring-repositories
nexus.override.local.storage.whitelist=

Resolution

If option "Override Local Storage Location" in repository configuration is not used, error message could be ignored.
 
If option "Override Local Storage Location" is used, then add the parameter nexus.override.local.storage.whitelist in file <RA_HOME>/webapps/nexus/WEB-INF/classes/nexus.properties>