Error creating bean with name 'authenticationInterceptor#rest'
MohammedFadin opened this issue · 2 comments
Describe the bug
Container randomly throwing errors below.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationInterceptor#rest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.redback.users.UserManager org.apache.archiva.redback.rest.services.interceptors.AuthenticationInterceptor.userManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManager#archiva': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin org.apache.archiva.web.security.ArchivaConfigurableUsersManager.redbackRuntimeConfigurationAdmin; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redbackRuntimeConfigurationAdmin#default': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List org.apache.archiva.admin.repository.AbstractRepositoryAdmin.auditListeners; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditListener#metadata': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.metadata.repository.RepositorySessionFactory org.apache.archiva.audit.MetadataAuditListener.repositorySessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositorySessionFactory#cassandra': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.metadata.repository.MetadataResolver org.apache.archiva.metadata.repository.cassandra.CassandraRepositorySessionFactory.metadataResolver; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metadataResolver#default': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.metadata.repository.storage.RepositoryStorage org.apache.archiva.metadata.repository.DefaultMetadataResolver.repositoryStorage; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryStorage#maven2': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.remoteRepositoryAdmin; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'remoteRepositoryAdmin#default': Invocation of init method failed; nested exception is org.apache.archiva.admin.model.RepositoryAdminException: Cannot forcefully unlock a NativeFSLock which is held by another indexer component: /archiva-data/data/remotes/central/.index/write.lock
To Reproduce
Randomly
Environment Details
Docker Version: Kubernetes 1.14.4_1527
Host OS: OpenJDK8
Image Version: v2.2.4
We've never seen this before, but looking at the stack trace it's clear that an Archiva thread is unable obtain an fs lock on a file. This is either a problem with how you've deployed Archiva in k8s or with Archiva itself. In either case, this isn't where the issue issue would get resolved - this project is just about the docker image.
I suspect the problem is with how you've deployed Archiva in your cluster, based on a similar issue raised on the Archiva mailing list back in 2014.
I would check to make sure that:
- Archiva data PV is configured as
ReadWriteOnce
, since Archiva cannot have different processes modifying it's data volume. - You don't have any sidecar containers that might be locking the files on the Archiva data volume in the pod you're using (this is possible if you're not using our xetusoss-archiva helm chart to deploy Archiva)
Hey @MohammedFadin - I'll leave this open for another day or so, in case you want to follow up with anything.
If you found that the issue was, in fact, due to another process concurrently accessing the file system, then please do indicate that here. In case somebody else bumps into the same problem, I'm sure they would appreciating knowing what happened in your case.