Details
-
Type:
Story
-
Status: Done
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: 2.14.1, 3.1.0
-
Component/s: Upgrade
-
Labels:None
-
Story Points:3
-
Epic Link:
-
Sprint:Sprint 84, Sprint 86
Description
Background
A number of customer bug reports have been traced to the fact that the NX2->NX3 migration REST API is using encoded slashes in requests. This causes problems with reverse proxies, and so far our recommendation is to fine tune the reverse proxy settings. This will continue to be problematic in the future, so let's adjust to eliminate the encoding.
The problem manifests itself when the HTTP download option is used during upgrade to Nexus 3, and Nexus 3 is sending requests for artifacts to Nexus 2. Nexus 3 sends requests to Nexus 2 with encoded slashes like
<base url>/service/siesta/migrationagent/repository-content/npmproxy/which%2F-%2Fwhich-1.0.9.tgz, those decoded slashes need to arrive at the Nexus 2 instance unaltered/undecoded in order for migration to work.
Symptoms
Requests by the Nexus migration agent to Nexus 2 will fail with 404 not found. Example stack trace from your nexus.log:
2016-11-08 08:39:26,510+0100 ERROR [plan-executor-5-thread-6] admin com.sonatype.nexus.migration.repository.ProcessChangesStep - Failed processing of CREATE /package/-/package-2.0.1.tgz, will ignore and move on. HTTP 404 Not Found javax.ws.rs.NotFoundException: HTTP 404 Not Found at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:201) [na:na] at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:174) [na:na] at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:59) [na:na] at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104) [na:na] at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:64) [na:na] at com.sonatype.nexus.migration.client.$Proxy193.get(Unknown Source) [na:na]
This can happen with any repository type.
Acceptance
- Remove slash encoding from the NX2 migration REST API so that we don't have problems with reverse proxies.
- Revert note added by https://github.com/sonatype/nexus-book-internal/pull/55 which will become obsolete
Workaround
- configure Nexus 3 to send requests to Nexus 2 directly instead of going through an intermediary reverse proxy
- configure the httpd in front of Nexus 2 with the directive AllowEncodedSlashes NoDecode and the option nocanon for your ProxyPass directive - do a similar change for nginx if using that server
- upgrade to 2.14.3/3.2.1 once released