jfrog / nexus2artifactory

NexusToArtifactory - A tool designed to ease migration from Sonatype Nexus to JFrog Artifactory.
Apache License 2.0
67 stars 54 forks source link

Deadlock occurs during migration #64

Closed hyunkj42 closed 4 years ago

hyunkj42 commented 4 years ago

Hello.

nexus -> dev-artifactory migration test is in progress,

As the migration toward Artifacts, there is a part where an error occurs, so I leave an inquiry to see if there is any part that can be checked.

From some point during the migration, the following errors often occur.

2020-11-03 18:36:47,240 [http-nio-8081-exec-10] [ERROR] (o.a.w.s.RepoFilter  :222) - Sending HTTP error code 500
java.lang.reflect.UndeclaredThrowableException: null
        at com.sun.proxy.$Proxy118.next(Unknown Source) ~[na:na]
        at org.artifactory.storage.db.fs.dao.NodesDao.getChildren(NodesDao.java:217) ~[artifactory-storage-db-5.4.6.jar:na]
        at org.artifactory.storage.db.fs.service.FileServiceImpl.loadChildren(FileServiceImpl.java:250) ~[artifactory-storage-db-5.4.6.jar:na]
        at org.artifactory.storage.fs.tree.FolderNode.getChildrenItemNode(FolderNode.java:74) ~[artifactory-storage-common-5.4.6.jar:na]
        at org.artifactory.storage.fs.tree.FolderNode.getChildren(FolderNode.java:56) ~[artifactory-storage-common-5.4.6.jar:na]
        at org.artifactory.maven.MavenMetadataCalculator.folderContainsPoms(MavenMetadataCalculator.java:420) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.maven.MavenMetadataCalculator.createSnapshotsMetadata(MavenMetadataCalculator.java:208) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.maven.MavenMetadataCalculator.calculateAndSet(MavenMetadataCalculator.java:177) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.maven.MavenMetadataCalculator.calculate(MavenMetadataCalculator.java:152) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.maven.MavenMetadataServiceImpl.calculateMavenMetadata(MavenMetadataServiceImpl.java:81) ~[artifactory-core-5.4.6.jar:na]
        at sun.reflect.GeneratedMethodAccessor432.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at com.sun.proxy.$Proxy153.calculateMavenMetadata(Unknown Source) ~[na:na]
        at org.artifactory.repo.interceptor.MavenMetadataCalculationInterceptor.afterCreate(MavenMetadataCalculationInterceptor.java:72) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.repo.interceptor.storage.StorageInterceptorsImpl.afterCreate(StorageInterceptorsImpl.java:65) ~[artifactory-core-5.4.6.jar:na]
        at sun.reflect.GeneratedMethodAccessor408.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at com.sun.proxy.$Proxy172.afterCreate(Unknown Source) ~[na:na]
        at org.artifactory.repo.db.DbStoringRepoMixin.invokeAfterCreateInterceptors(DbStoringRepoMixin.java:386) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.repo.db.DbStoringRepoMixin.saveResource(DbStoringRepoMixin.java:227) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.repo.db.DbLocalRepo.saveResource(DbLocalRepo.java:152) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.repo.service.RepositoryServiceImpl.saveResourceInTransaction(RepositoryServiceImpl.java:1759) ~[artifactory-core-5.4.6.jar:na]
        at sun.reflect.GeneratedMethodAccessor420.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at com.sun.proxy.$Proxy152.saveResourceInTransaction(Unknown Source) ~[na:na]
        at org.artifactory.repo.service.RepositoryServiceImpl.saveResource(RepositoryServiceImpl.java:1727) ~[artifactory-core-5.4.6.jar:na]
        at sun.reflect.GeneratedMethodAccessor419.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at com.sun.proxy.$Proxy152.saveResource(Unknown Source) ~[na:na]
        at org.artifactory.engine.UploadServiceImpl.uploadItemWithContent(UploadServiceImpl.java:681) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.uploadItemWithReusedContent(UploadServiceImpl.java:610) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.uploadItem(UploadServiceImpl.java:561) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.uploadFile(UploadServiceImpl.java:538) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.uploadArtifact(UploadServiceImpl.java:517) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.adjustResponseAndUpload(UploadServiceImpl.java:247) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.validateRequestAndUpload(UploadServiceImpl.java:187) ~[artifactory-core-5.4.6.jar:na]
        at org.artifactory.engine.UploadServiceImpl.upload(UploadServiceImpl.java:146) ~[artifactory-core-5.4.6.jar:na]
        at sun.reflect.GeneratedMethodAccessor414.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.artifactory.request.aop.RequestAdvice.invoke(RequestAdvice.java:67) ~[artifactory-core-5.4.6.jar:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
        at com.sun.proxy.$Proxy169.upload(Unknown Source) ~[na:na]
        at org.artifactory.webapp.servlet.RepoFilter.doUpload(RepoFilter.java:216) [artifactory-web-application-5.4.6.jar:na]
        at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:165) [artifactory-web-application-5.4.6.jar:na]
        at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:94) [artifactory-web-application-5.4.6.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.41]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.41]
        at org.artifactory.webapp.servlet.AccessFilter.useAuthentication(AccessFilter.java:399) [artifactory-web-application-5.4.6.jar:na]
        at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:275) [artifactory-web-application-5.4.6.jar:na]
        at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:205) [artifactory-web-application-5.4.6.jar:na]
        at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:165) [artifactory-web-application-5.4.6.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.41]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.41]
        at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:67) [artifactory-web-application-5.4.6.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.41]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.41]
        at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:164) [spring-session-1.2.2.RELEASE.jar:na]
        at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80) [spring-session-1.2.2.RELEASE.jar:na]
        at org.artifactory.webapp.servlet.SessionFilter.doFilter(SessionFilter.java:62) [artifactory-web-application-5.4.6.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.41]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.41]
        at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:116) [artifactory-web-application-5.4.6.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.41]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.41]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [catalina.jar:8.0.41]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) [catalina.jar:8.0.41]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.41]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.41]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.41]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509) [catalina.jar:8.0.41]
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104) [tomcat-coyote.jar:8.0.41]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) [tomcat-coyote.jar:8.0.41]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1524) [tomcat-coyote.jar:8.0.41]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480) [tomcat-coyote.jar:8.0.41]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.41]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.lang.reflect.InvocationTargetException: null
        at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
        at org.artifactory.storage.db.util.ResultSetWrapper.invoke(ResultSetWrapper.java:75) ~[artifactory-storage-db-5.4.6.jar:na]
        ... 101 common frames omitted
Caused by: java.sql.SQLTransactionRollbackException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
Lock : ROW, NODES, (1058,115)
  Waiting XID : {122291478, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {122197041, X}
Lock : ROW, NODES, (1059,98)
  Waiting XID : {122197041, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {122291478, X}
. The selected victim is XID : 122291478.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source) ~[derby-10.11.1.1.jar:na]
        ... 105 common frames omitted
Caused by: org.apache.derby.iapi.error.StandardException: A lock could not be obtained due to a deadlock, cycle of locks and waiters is:
Lock : ROW, NODES, (1058,115)
  Waiting XID : {122291478, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {122197041, X}
Lock : ROW, NODES, (1059,98)
  Waiting XID : {122197041, S} , APP, SELECT * FROM nodes WHERE repo = ? AND node_path = ? AND depth = ?
  Granted XID : {122291478, X}
. The selected victim is XID : 122291478.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.services.locks.Deadlock.buildException(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.services.locks.ConcurrentLockSet.zeroDurationLockObject(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.services.locks.AbstractPool.zeroDurationlockObject(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.services.locks.ConcurrentPool.zeroDurationlockObject(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.raw.xact.RowLocking2nohold.lockRecordForRead(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.store.access.btree.BTreeScan.fetchNextGroup(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reloadArray(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.getNextRowCore(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.getNextRowCore(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source) ~[derby-10.11.1.1.jar:na]
        at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(Unknown Source) ~[derby-10.11.1.1.jar:na]
        ... 107 common frames omitted
hyunkj42 commented 4 years ago

After changing db from derby to mysql, the above error does not occur.