Artifactory unable to start if a repository name contains space in it
Description
Environment
None
Activity
Show:
Jira Fixversion
updated the Fix versionsApril 6, 2023 at 5:53 PMNone
7.55.6
Exalate
changed the StatusMarch 7, 2023 at 2:45 PMOpen
Done
Exalate
updated the ResolutionMarch 7, 2023 at 2:45 PMNone
Done
Exalate
updated the SeverityMarch 5, 2023 at 11:24 AMHigh
Critical
Exalate
changed the PriorityMarch 5, 2023 at 11:23 AM2 - Critical
1 - Blocker
Exalate
changed the PriorityMarch 5, 2023 at 11:23 AM4 - Normal
2 - Critical
Santhosh Pesari
updated the DescriptionMarch 3, 2023 at 7:27 PM*Issue:*
Artifactory allows to create a virtual repository with space in the repo key. After creating the repository, if we perform a restart of Artifactory, it doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
*Issue:*
Artifactory allows to create a virtual repository with space in the repo key. After creating the repository, if we perform a restart of Artifactory, it doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
Santhosh Pesari
updated the DescriptionMarch 3, 2023 at 7:26 PM*Issue:*
Artifactory allows to create a virtual repository with space in the repo key in Artifactory 7.53.3 SaaS version. After creating the repository, if we perform a restart of Artifactory, Artifactory doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
*Issue:*
Artifactory allows to create a virtual repository with space in the repo key. After creating the repository, if we perform a restart of Artifactory, it doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
Santhosh Pesari
updated the DescriptionMarch 3, 2023 at 7:26 PM*Issue:*
Artifactory allows to create a repository with space in the repo key in Artifactory 7.53.3 SaaS version. After creating the repository, if we perform a restart of Artifactory, Artifactory doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
*Issue:*
Artifactory allows to create a virtual repository with space in the repo key in Artifactory 7.53.3 SaaS version. After creating the repository, if we perform a restart of Artifactory, Artifactory doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
Santhosh Pesari
updated the DescriptionMarch 3, 2023 at 7:25 PM*Issue:*
Artifactory allows to create a repository with space in the repo key in Artifactory 7.53.3 SaaS version. After creating the repository, if we perform a restart of Artifactory, Artifactory doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Edit {{$JFROG_HOME/artifactory/var/etc/artifactory/artifactory.repository.config.latest.json}} and remove the space for the “docker “ repository . Then, rename the file to: {{$JFROG_HOME/artifactory/var/etc/artifactory/artifactory.repository.config.import.json}}, in order to get it to load during bootstrap.
Another way to do the above is to go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
*Issue:*
Artifactory allows to create a repository with space in the repo key in Artifactory 7.53.3 SaaS version. After creating the repository, if we perform a restart of Artifactory, Artifactory doesn’t startup.
*Steps to reproduce:*
# Create a virtual docker repository with repository name as “docker “ that contains *space* after “docker”
# Repository “docker “ will be created successfully
# Now restart the Artifactory
# Artifactory fails to restart with the following error:
{noformat}2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327)
at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298)
at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182)
... 7 common frames omitted
Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache.
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96)
at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source)
at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111)
at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325)
... 9 common frames omitted
Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1
at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78)
at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48)
at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96)
at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781)
at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198)
at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223)
at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199)
at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790)
at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149)
at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144)
at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94)
... 19 common frames omitted
{noformat}
This test is performed in Artifactory on 7.55.2 version as well and got the above error with Artifactory start to fail.
*Workaround solution:*
Go to the database and check the repository_config table and update the repository key value by removing the space.
*What is the expected behavior?*
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
*Environment details:*
Tested on Artifactory On-prem version - 7.55.2
Exalate
changed the PriorityMarch 3, 2023 at 7:15 PM4 - Normal
Santhosh Pesari
created the IssueMarch 3, 2023 at 7:14 PMDone
Details
Assignee
Reporter
Santhosh Pesari
Santhosh PesariFix versions
Severity
Critical
Components
Created March 3, 2023 at 7:14 PM
Updated April 6, 2023 at 5:53 PM
Resolved March 7, 2023 at 2:45 PM
Issue:
Artifactory allows to create a virtual repository with space in the repo key. After creating the repository, if we perform a restart of Artifactory, it doesn’t startup.
Steps to reproduce:
Create a virtual docker repository with repository name as “docker “ that contains space after “docker”
Repository “docker “ will be created successfully
Now restart the Artifactory
Artifactory fails to restart with the following error:
2023-03-03T18:59:58.098Z [jfrt ] [ERROR] [1ec5dad52bbcfd19] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Attempt to lock 'docker1:' with repository 'docker1 java.lang.reflect.InvocationTargetException: null at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267) at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122) Caused by: org.springframework.beans.factory.BeanInitializationException: Failed to initialize bean 'PersistentQueueRegistrationServiceImpl'.; nested exception is org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache. at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:327) at org.artifactory.spring.ArtifactoryApplicationContext.refresh(ArtifactoryApplicationContext.java:298) at org.artifactory.spring.ArtifactoryApplicationContext.<init>(ArtifactoryApplicationContext.java:182) ... 7 common frames omitted Caused by: org.artifactory.storage.db.security.service.VersioningCacheException: Failed to reload cache. at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:96) at org.artifactory.repo.service.RepositoryServiceImpl.getAllRepoKeys(RepositoryServiceImpl.java:2051) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at jdk.proxy3/jdk.proxy3.$Proxy215.getAllRepoKeys(Unknown Source) at org.artifactory.queue.register.PersistentQueueRegistrationServiceImpl.init(PersistentQueueRegistrationServiceImpl.java:111) at org.artifactory.spring.ArtifactoryApplicationContext.initReloadableBeans(ArtifactoryApplicationContext.java:325) ... 9 common frames omitted Caused by: java.lang.IllegalArgumentException: Attempt to lock 'docker1:' with repository 'docker1 at org.artifactory.storage.db.fs.model.DbFsItemProvider.<init>(DbFsItemProvider.java:78) at org.artifactory.storage.db.fs.model.DbMutableFolderProvider.<init>(DbMutableFolderProvider.java:48) at org.artifactory.storage.db.fs.model.DbVfsItemProviderFactory.createFolderProvider(DbVfsItemProviderFactory.java:96) at org.artifactory.repo.db.DbStoringRepoMixin.createOrGetFolder(DbStoringRepoMixin.java:781) at org.artifactory.repo.db.DbStoringRepoMixin.init(DbStoringRepoMixin.java:198) at org.artifactory.repo.virtual.VirtualRepo.initStorage(VirtualRepo.java:223) at org.artifactory.repo.virtual.VirtualRepo.init(VirtualRepo.java:199) at org.artifactory.repo.service.RepositoryServiceImpl.initRepo(RepositoryServiceImpl.java:4141) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at jdk.proxy3/jdk.proxy3.$Proxy215.initRepo(Unknown Source) at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.initRepoInNewTransaction(RepositoryServiceImpl.java:4119) at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildVirtualRepositories(RepositoryServiceImpl.java:3982) at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheBuilder.rebuildRepositories(RepositoryServiceImpl.java:3790) at org.artifactory.repo.service.RepositoryServiceImpl.rebuildRepositoriesInTransaction(RepositoryServiceImpl.java:1967) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) at jdk.proxy3/jdk.proxy3.$Proxy215.rebuildRepositoriesInTransaction(Unknown Source) at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4149) at org.artifactory.repo.service.RepositoryServiceImpl$RepositoriesCacheLoader.call(RepositoryServiceImpl.java:4144) at org.artifactory.storage.db.security.service.VersioningCacheImpl.get(VersioningCacheImpl.java:94) ... 19 common frames omitted
Workaround solution:
Go to the database and check the repository_config table and update the repository key value by removing the space.
What is the expected behavior?
Artifactory shouldn’t allow creating a new repository with a name that contains space (for example: “docker “).
Environment details:
Tested on Artifactory On-prem version - 7.55.2