No user-role mapping for user:


#1

HI
I was upgrading an old nexus manager 2.14 repos and configurations to a new nexus manager we are using(3.15).
I followed the process from the website, when I get the step to begin upgrade I got an "NO user-role mapping for user " error.


and the logs

2019-04-11 16:14:53,201+0800 DEBUG [plan-executor-8-thread-7] admin com.sonatype.nexus.migration.config.ConfigurationStep - Transitioning: RUNNING -> FAILED
2019-04-11 16:14:53,201+0800 WARN [plan-executor-8-thread-7] admin com.sonatype.nexus.migration.config.ConfigurationStep - Upgrade configuration: security.user-role-mappings failed
org.sonatype.nexus.security.user.NoSuchRoleMappingException: No user-role mapping for user: webdev
at org.sonatype.nexus.security.internal.SecurityConfigurationManagerImpl.deleteUserRoleMapping(SecurityConfigurationManagerImpl.java:258)
at org.sonatype.nexus.security.config.SecurityConfigurationManager$deleteUserRoleMapping$9.call(Unknown Source)
at com.sonatype.nexus.migration.config.ingesters.SecurityUserRoleMappingsIngester$_ingest_closure5.doCall(SecurityUserRoleMappingsIngester.groovy:70)
at sun.reflect.GeneratedMethodAccessor637.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:434)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2125)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2110)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2151)
at org.codehaus.groovy.runtime.dgm$163.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at com.sonatype.nexus.migration.config.ingesters.SecurityUserRoleMappingsIngester.ingest(SecurityUserRoleMappingsIngester.groovy:69)
at com.sonatype.nexus.migration.config.ConfigurationIngester$ingest$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at com.sonatype.nexus.migration.config.ConfigurationIngester$ingest$0.call(Unknown Source)
at com.sonatype.nexus.migration.config.ConfigurationStep.doRun(ConfigurationStep.groovy:68)
at com.sonatype.nexus.migration.plan.Step.run(Step.groovy:271)
at com.sonatype.nexus.migration.plan.Step$run$1.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at com.sonatype.nexus.migration.plan.Step$run$1.call(Unknown Source)
at com.sonatype.nexus.migration.plan.StepExecutor.runSync(StepExecutor.groovy:168)
at sun.reflect.GeneratedMethodAccessor546.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:169)
at com.sonatype.nexus.migration.plan.StepExecutor$_runAsync_closure1.doCall(StepExecutor.groovy:197)
at com.sonatype.nexus.migration.plan.StepExecutor$_runAsync_closure1.doCall(StepExecutor.groovy)
at sun.reflect.GeneratedMethodAccessor556.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.run(Closure.java:499)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2019-04-11 16:14:53,203+0800 DEBUG [plan-executor-8-thread-7] admin com.sonatype.nexus.migration.config.ConfigurationStep - Transitioned: FAILED
2019-04-11 16:14:53,203+0800 DEBUG [plan-executor-8-thread-7] admin com.sonatype.nexus.migration.plan.StepExecutor - Step finished: Step(name:Upgrade configuration: security.user-role-mappings, phase:PREPARE)
2019-04-11 16:14:53,204+0800 INFO [plan-executor-8-thread-5] admin com.sonatype.nexus.migration.plan.StepExecutor - Step not runnable: Step(name:End phase: PREPARE, phase:PREPARE)
2019-04-11 16:14:53,308+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:14:54,310+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:14:55,311+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:14:56,315+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:14:57,319+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:14:58,319+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:14:59,325+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:00,328+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:01,327+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:02,329+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:03,333+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:04,334+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:05,340+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:06,339+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:07,341+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:08,345+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:09,352+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:10,353+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:11,351+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:12,355+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:13,362+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:14,364+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:15,387+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:16,387+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:17,394+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:18,394+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:19,397+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:20,401+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:21,404+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:22,407+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:23,409+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:24,410+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:25,412+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:26,414+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:27,414+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:28,416+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:29,417+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:30,421+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:31,422+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:32,426+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:33,433+0800 DEBUG [qtp539042340-605] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE
2019-04-11 16:15:34,436+0800 DEBUG [qtp539042340-603] admin com.sonatype.nexus.migration.ui.ProgressComponent - read PREPARE


#2

It looks like it’s trying to delete an already existing user role mapping. Has the upgrade wizard been run more than once? If so, that isn’t supported:

https://help.sonatype.com/display/NXRM3/Upgrading#Upgrading-Upgradingfrom2.xto3.y


#3

thanks a lot for the help rseddon.
this is the first time for the upgrading,
but yes, the 3.15 manager already had some new user-role ,and repos configrations.
as the url you given ,the target 3.** manager should be a clean manager,
is there any way to merge the old 2.14 manager and the 3.15 manager to one 3.15 manager?


#4

The upgrade wizard can only be run once, and it needs to be run against a new (unpopulated) Nexus Repo 3 install. However, if you’re just trying to get repository content from Nexus Repo 2 into 3 you can use scripts like these:

But if you’re trying to bring over other configuration, you’ll need to restart the upgrade.