[RTFACT-17493] RemoteRepoBypassHeadSystemPropsConverter fails with 'Only an admin user can save the artifactory config' error Created: 12/Sep/18  Updated: 25/Oct/18  Resolved: 13/Sep/18

Status: Resolved
Project: Artifactory Binary Repository
Component/s: Installer
Affects Version/s: 6.4.0
Fix Version/s: 6.4.0

Type: Bug Priority: Normal
Reporter: Alex Dvorkin Assignee: Tamir Hadad
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Trigger
Assigned QA: Alex Dvorkin

 Description   

When upgrading from 5.4.12 to 6.4.0 (master-4933), the upgrade converter RemoteRepoBypassHeadSystemPropsConverter fails. Assuming that we force its function by defining system property artifactory.downloads.shouldSkipHeadRepositoriesList

2018-09-12 14:51:40,164 [art-init] [INFO ] (o.a.c.ConvertersManagerImpl:143) - Triggering POST_INIT conversion, from v5412 to next
2018-09-12 14:51:40,234 [art-init] [DEBUG] (o.a.c.p.v.ConanRepoPathConverter:68) - Done converting conan repo paths
2018-09-12 14:51:40,249 [art-init] [INFO ] (o.a.c.p.v.RemoteRepoBypassHeadSystemPropsConverter:63) - Adding 'bypass head request' config to repo 'bla'
2018-09-12 14:51:40,251 [art-init] [ERROR] (o.a.c.ConvertersManagerImpl:216) - Conversion failed. You should analyze the error and retry launching Artifactory. Error is: Only an admin user can save the artifactory configuration.
2018-09-12 14:51:40,259 [art-init] [ERROR] (o.a.w.s.ArtifactoryContextConfigListener:92) - Application could not be initialized: RemoteRepoBypassHeadSystemPropsConverter.
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:207)
	at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener.access$200(ArtifactoryContextConfigListener.java:63)
	at org.artifactory.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:88)
Caused by: java.lang.RuntimeException: Only an admin user can save the artifactory configuration.
	at org.artifactory.converter.ConvertersManagerImpl.handleException(ConvertersManagerImpl.java:223)
	at org.artifactory.converter.ConvertersManagerImpl.convert(ConvertersManagerImpl.java:149)
	at org.artifactory.converter.ConvertersManagerImpl.afterServiceConvert(ConvertersManagerImpl.java:177)
	at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:257)
	at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:136)
	... 7 common frames omitted
Caused by: org.artifactory.api.security.AuthorizationException: Only an admin user can save the artifactory configuration.
	at org.artifactory.config.CentralConfigServiceImpl.saveEditedDescriptorAndReload(CentralConfigServiceImpl.java:511)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
	at com.sun.proxy.$Proxy131.saveEditedDescriptorAndReload(Unknown Source)
	at org.artifactory.converter.postinit.v102.RemoteRepoBypassHeadSystemPropsConverter.convert(RemoteRepoBypassHeadSystemPropsConverter.java:45)
	at org.artifactory.converter.postinit.PostInitVersions.lambda$convert$2(PostInitVersions.java:63)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.artifactory.converter.postinit.PostInitVersions.convert(PostInitVersions.java:63)
	at org.artifactory.converter.postinit.PostInitConverterAdapter.convert(PostInitConverterAdapter.java:60)
	at org.artifactory.converter.ConvertersManagerImpl.runConverters(ConvertersManagerImpl.java:261)
	at org.artifactory.converter.ConvertersManagerImpl.convert(ConvertersManagerImpl.java:144)
	... 10 common frames omitted
2018-09-12 14:51:40,931 [http-nio-8081-exec-2] [ERROR] (o.a.w.s.ArtifactoryFilter:191) - Artifactory failed to initialize: Context is null


 Comments   
Comment by Alex Dvorkin [ 13/Sep/18 ]

Moving to QA as per Tamir's update

Comment by Alex Dvorkin [ 13/Sep/18 ]

Verified on artifactory-pro:6.x.master-4937 (see https://www.jfrog.com/jira/browse/RTFACT-17371?focusedCommentId=59032&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-59032)

Generated at Tue May 21 12:35:58 UTC 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.