com.atlassian.stash.user.PreAuthenticationFailedException: Could not pre-authenticate as problematicuser

Atlassian JIRA | Michael Heemskerk | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    On startup, the following error occurs and stops Stash from starting up. {noformat} 2014-07-01 14:16:24,514 ERROR [localhost-startStop-1] c.a.j.s.w.c.JohnsonContextLoaderListener The Spring WebApplicationContext could not be started com.atlassian.stash.user.PreAuthenticationFailedException: Could not pre-authenticate as problematicuser at com.atlassian.stash.internal.user.SecurityServiceImpl.doAsUser(SecurityServiceImpl.java:80) ~[stash-service-impl-2.10.1.jar:na] at com.atlassian.stash.internal.pull.rescope.PullRequestRescopeListener.onApplicationEvent(PullRequestRescopeListener.java:170) ~[stash-service-impl-2.10.1.jar:na] at com.atlassian.stash.internal.pull.rescope.PullRequestRescopeListener.onApplicationEvent(PullRequestRescopeListener.java:63) ~[stash-service-impl-2.10.1.jar:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_02] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_02] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_02] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_02] ... 29 frames trimmed {noformat} The issue here is that that user updated a branch, which triggered a pull request update. However, Stash didn't get around to performing that update before it shut down. When Stash starts up again, it tries to reschedule those pull request updates _as_ that user. But the user is no longer active, so it fails... Workaround until this issue is fixed: re-enable/recreate the problematic user in LDAP/Crowd to ensure Stash has started up.

    Atlassian JIRA | 3 years ago | Michael Heemskerk
    com.atlassian.stash.user.PreAuthenticationFailedException: Could not pre-authenticate as problematicuser
  2. 0

    On startup, the following error occurs and stops Stash from starting up. {noformat} 2014-07-01 14:16:24,514 ERROR [localhost-startStop-1] c.a.j.s.w.c.JohnsonContextLoaderListener The Spring WebApplicationContext could not be started com.atlassian.stash.user.PreAuthenticationFailedException: Could not pre-authenticate as problematicuser at com.atlassian.stash.internal.user.SecurityServiceImpl.doAsUser(SecurityServiceImpl.java:80) ~[stash-service-impl-2.10.1.jar:na] at com.atlassian.stash.internal.pull.rescope.PullRequestRescopeListener.onApplicationEvent(PullRequestRescopeListener.java:170) ~[stash-service-impl-2.10.1.jar:na] at com.atlassian.stash.internal.pull.rescope.PullRequestRescopeListener.onApplicationEvent(PullRequestRescopeListener.java:63) ~[stash-service-impl-2.10.1.jar:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) ~[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_02] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_02] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_02] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_02] ... 29 frames trimmed {noformat} The issue here is that that user updated a branch, which triggered a pull request update. However, Stash didn't get around to performing that update before it shut down. When Stash starts up again, it tries to reschedule those pull request updates _as_ that user. But the user is no longer active, so it fails... Workaround until this issue is fixed: re-enable/recreate the problematic user in LDAP/Crowd to ensure Stash has started up.

    Atlassian JIRA | 3 years ago | Michael Heemskerk
    com.atlassian.stash.user.PreAuthenticationFailedException: Could not pre-authenticate as problematicuser

    Root Cause Analysis

    1. com.atlassian.stash.user.PreAuthenticationFailedException

      Could not pre-authenticate as problematicuser

      at com.atlassian.stash.internal.user.SecurityServiceImpl.doAsUser()
    2. com.atlassian.stash
      PullRequestRescopeListener.onApplicationEvent
      1. com.atlassian.stash.internal.user.SecurityServiceImpl.doAsUser(SecurityServiceImpl.java:80)[stash-service-impl-2.10.1.jar:na]
      2. com.atlassian.stash.internal.pull.rescope.PullRequestRescopeListener.onApplicationEvent(PullRequestRescopeListener.java:170)[stash-service-impl-2.10.1.jar:na]
      3. com.atlassian.stash.internal.pull.rescope.PullRequestRescopeListener.onApplicationEvent(PullRequestRescopeListener.java:63)[stash-service-impl-2.10.1.jar:na]
      3 frames
    3. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      2. org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      3. org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      4. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      4 frames
    4. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)[spring-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
      3 frames
    5. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[na:1.7.0_02]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:166)[na:1.7.0_02]
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[na:1.7.0_02]
      4. java.lang.Thread.run(Thread.java:722)[na:1.7.0_02]
      4 frames