Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.25.0, 3.28.0
-
Fix Version/s: 3.29.0
-
Component/s: Proxy Repository
-
Labels:
-
Notability:2
Description
Updating a proxy repository with a remote URL that contains encoded spaces can cause startup failures when Nexus is restarted.
To reproduce:
1. Via the UI, create a proxy repo e.g. raw proxy, with a valid remote url e.g. https://remoteserver/com/foo
2. Edit the repo config and update the remote URL with an address that contains encoded spaces e.g. https://remoteserver/com/foo/this%20is%20a%20space
3. On save, an error will be thrown and the config will not update as the URL is being decoded - repo will be in an invalid state:
2020-10-12 11:59:07,145+0100 INFO [qtp1896489260-51] admin org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Updating repository: raw-proxy -> OrientConfiguration
Unknown macro: {repositoryName='raw-proxy', recipeName='raw-proxy', attributes= Unknown macro}
, proxy=
Unknown macro: {remoteUrl=[https}
, httpclient={blocked=false, autoBlock=true, connection={useTrustStore=false}}, storage={blobStoreName=default, strictContentTypeValidation=true}, negativeCache={enabled=true, timeToLive=1440.0}}}
2020-10-12 11:59:07,150+0100 ERROR [qtp1896489260-51] admin org.sonatype.nexus.extdirect.internal.ExtDirectExceptionHandler - Failed to invoke action method: coreui_Repository.update, java-method: org.sonatype.nexus.coreui.RepositoryComponent.updateorg.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED] at org.sonatype.nexus.common.stateguard.StateGuard._ensure(StateGuard.java:115) at org.sonatype.nexus.common.stateguard.StateGuard.access$1(StateGuard.java:108) at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:187) at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:56) at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.update(RepositoryManagerImpl.java:380)
4. At this point, restart Nexus.
Expected:
Nexus will start up.
Actual:
Nexus fails to start and throws similar initialisation error for the invalid proxy repo as it still tries to process the new URL rather than reverting to the existing one.