java.lang.Throwable: [http-nio-8081-exec-96] async call to 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)' completed with error.

JFrog JIRA | Alexei Vainshtein | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    There is a race condition when trying to do multi login attempts with the same user. There is an insertion to the user_props multiple times and that causes a duplicate key violets: {code} 2016-01-27 15:43:17,580 [art-exec-15] [ERROR] (o.a.s.a.AsyncAdvice :168) - Could not execute async method: 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)'. java.lang.Throwable: [http-nio-8081-exec-96] async call to 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)' completed with error. at org.artifactory.schedule.aop.AsyncAdvice$TraceableMethodInvocation.<init>(AsyncAdvice.java:329) ~[artifactory-core-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice.invoke(AsyncAdvice.java:88) ~[artifactory-core-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice.invoke(AsyncAdvice.java:1) ~[artifactory-core-4.4.0.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.$Proxy40.resetIncorrectLoginAttempts(Unknown Source) ~[na:na] at org.artifactory.security.SecurityServiceImpl.interceptLoginSuccess(SecurityServiceImpl.java:703) ~[artifactory-core-4.4.0.jar:na] at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60] 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.$Proxy41.interceptLoginSuccess(Unknown Source) ~[na:na] at org.artifactory.webapp.servlet.authentication.ArtifactoryAuthenticationFilterChain.doFilter(ArtifactoryAuthenticationFilterChain.java:195) ~[artifactory-web-application-4.4.0.jar:na] at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:240) ~[artifactory-web-application-4.4.0.jar:na] at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:190) ~[artifactory-web-application-4.4.0.jar:na] at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:156) ~[artifactory-web-application-4.4.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[catalina.jar:8.0.22] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina.jar:8.0.22] at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:65) ~[artifactory-web-application-4.4.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[catalina.jar:8.0.22] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina.jar:8.0.22] at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:116) ~[artifactory-web-application-4.4.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[catalina.jar:8.0.22] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) ~[catalina.jar:8.0.22] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) ~[catalina.jar:8.0.22] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) ~[catalina.jar:8.0.22] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) ~[tomcat-coyote.jar:8.0.22] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) ~[tomcat-coyote.jar:8.0.22] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) ~[tomcat-coyote.jar:8.0.22] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) ~[tomcat-coyote.jar:8.0.22] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_60] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.0.22] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60] Caused by: org.artifactory.storage.StorageException: Could not reset incorrect login attempts for user 'admin', because ERROR: duplicate key value violates unique constraint "user_props_pk" Detail: Key (user_id, prop_key)=(15, incorrect_login_attempts) already exists. at org.artifactory.storage.db.security.service.UserGroupServiceImpl.resetIncorrectLoginAttempts(UserGroupServiceImpl.java:643) ~[artifactory-storage-db-4.4.0.jar:na] at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60] 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.schedule.aop.AsyncAdvice$TraceableMethodInvocation.proceed(AsyncAdvice.java:348) ~[artifactory-core-4.4.0.jar:na] 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.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:64) ~[artifactory-storage-common-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice.doInvoke(AsyncAdvice.java:210) ~[artifactory-core-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice$1.call(AsyncAdvice.java:146) ~[artifactory-core-4.4.0.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60] at org.artifactory.schedule.ArtifactoryConcurrentExecutor$RunnableWrapper.run(ArtifactoryConcurrentExecutor.java:102) [artifactory-storage-common-4.4.0.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_60] ... 1 common frames omitted {code}

    JFrog JIRA | 1 year ago | Alexei Vainshtein
    java.lang.Throwable: [http-nio-8081-exec-96] async call to 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)' completed with error.
  2. 0

    There is a race condition when trying to do multi login attempts with the same user. There is an insertion to the user_props multiple times and that causes a duplicate key violets: {code} 2016-01-27 15:43:17,580 [art-exec-15] [ERROR] (o.a.s.a.AsyncAdvice :168) - Could not execute async method: 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)'. java.lang.Throwable: [http-nio-8081-exec-96] async call to 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)' completed with error. at org.artifactory.schedule.aop.AsyncAdvice$TraceableMethodInvocation.<init>(AsyncAdvice.java:329) ~[artifactory-core-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice.invoke(AsyncAdvice.java:88) ~[artifactory-core-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice.invoke(AsyncAdvice.java:1) ~[artifactory-core-4.4.0.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.$Proxy40.resetIncorrectLoginAttempts(Unknown Source) ~[na:na] at org.artifactory.security.SecurityServiceImpl.interceptLoginSuccess(SecurityServiceImpl.java:703) ~[artifactory-core-4.4.0.jar:na] at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60] 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.$Proxy41.interceptLoginSuccess(Unknown Source) ~[na:na] at org.artifactory.webapp.servlet.authentication.ArtifactoryAuthenticationFilterChain.doFilter(ArtifactoryAuthenticationFilterChain.java:195) ~[artifactory-web-application-4.4.0.jar:na] at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:240) ~[artifactory-web-application-4.4.0.jar:na] at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:190) ~[artifactory-web-application-4.4.0.jar:na] at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:156) ~[artifactory-web-application-4.4.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[catalina.jar:8.0.22] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina.jar:8.0.22] at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:65) ~[artifactory-web-application-4.4.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[catalina.jar:8.0.22] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina.jar:8.0.22] at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:116) ~[artifactory-web-application-4.4.0.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) ~[catalina.jar:8.0.22] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) ~[catalina.jar:8.0.22] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) ~[catalina.jar:8.0.22] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) ~[catalina.jar:8.0.22] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) ~[catalina.jar:8.0.22] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) ~[tomcat-coyote.jar:8.0.22] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) ~[tomcat-coyote.jar:8.0.22] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) ~[tomcat-coyote.jar:8.0.22] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) ~[tomcat-coyote.jar:8.0.22] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_60] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.0.22] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60] Caused by: org.artifactory.storage.StorageException: Could not reset incorrect login attempts for user 'admin', because ERROR: duplicate key value violates unique constraint "user_props_pk" Detail: Key (user_id, prop_key)=(15, incorrect_login_attempts) already exists. at org.artifactory.storage.db.security.service.UserGroupServiceImpl.resetIncorrectLoginAttempts(UserGroupServiceImpl.java:643) ~[artifactory-storage-db-4.4.0.jar:na] at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60] 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.schedule.aop.AsyncAdvice$TraceableMethodInvocation.proceed(AsyncAdvice.java:348) ~[artifactory-core-4.4.0.jar:na] 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.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:64) ~[artifactory-storage-common-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice.doInvoke(AsyncAdvice.java:210) ~[artifactory-core-4.4.0.jar:na] at org.artifactory.schedule.aop.AsyncAdvice$1.call(AsyncAdvice.java:146) ~[artifactory-core-4.4.0.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60] at org.artifactory.schedule.ArtifactoryConcurrentExecutor$RunnableWrapper.run(ArtifactoryConcurrentExecutor.java:102) [artifactory-storage-common-4.4.0.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_60] ... 1 common frames omitted {code}

    JFrog JIRA | 1 year ago | Alexei Vainshtein
    java.lang.Throwable: [http-nio-8081-exec-96] async call to 'public abstract void org.artifactory.storage.security.service.UserGroupStoreService.resetIncorrectLoginAttempts(java.lang.String)' completed with error.

    Root Cause Analysis

    1. org.artifactory.storage.StorageException

      Could not reset incorrect login attempts for user 'admin', because ERROR: duplicate key value violates unique constraint "user_props_pk" Detail: Key (user_id, prop_key)=(15, incorrect_login_attempts) already exists.

      at org.artifactory.storage.db.security.service.UserGroupServiceImpl.resetIncorrectLoginAttempts()
    2. org.artifactory.storage
      UserGroupServiceImpl.resetIncorrectLoginAttempts
      1. org.artifactory.storage.db.security.service.UserGroupServiceImpl.resetIncorrectLoginAttempts(UserGroupServiceImpl.java:643)[artifactory-storage-db-4.4.0.jar:na]
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_60]
      3. java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_60]
      3 frames
    4. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
      3 frames
    5. org.artifactory.schedule
      AsyncAdvice$TraceableMethodInvocation.proceed
      1. org.artifactory.schedule.aop.AsyncAdvice$TraceableMethodInvocation.proceed(AsyncAdvice.java:348)[artifactory-core-4.4.0.jar:na]
      1 frame
    6. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
      3 frames
    7. org.artifactory.storage
      LockingAdvice.invoke
      1. org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:64)[artifactory-storage-common-4.4.0.jar:na]
      1 frame
    8. org.artifactory.schedule
      AsyncAdvice$1.call
      1. org.artifactory.schedule.aop.AsyncAdvice.doInvoke(AsyncAdvice.java:210)[artifactory-core-4.4.0.jar:na]
      2. org.artifactory.schedule.aop.AsyncAdvice$1.call(AsyncAdvice.java:146)[artifactory-core-4.4.0.jar:na]
      2 frames
    9. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_60]
      1 frame
    10. org.artifactory.schedule
      ArtifactoryConcurrentExecutor$RunnableWrapper.run
      1. org.artifactory.schedule.ArtifactoryConcurrentExecutor$RunnableWrapper.run(ArtifactoryConcurrentExecutor.java:102)[artifactory-storage-common-4.4.0.jar:na]
      1 frame
    11. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_60]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_60]
      3. java.lang.Thread.run(Thread.java:745)[na:1.8.0_60]
      3 frames