com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: git fetch updated refs/heads/refs/notes/commits, but the ref does not exist

Atlassian JIRA | Bryan Turner | 4 years 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

    Having a pipe {{|}} in the branch name will result in the changeset index failing, which in turn results in JIRA linking not working at all in that repository. This may manifest itself with the following stacktrace in the logs: {noformat} com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: Broken pipe at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120) ~[na:na] at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.onCancel(GitCommandExitHandler.java:46) ~[na:na] at com.atlassian.stash.scm.BaseCommand.callExitHandler(BaseCommand.java:138) ~[stash-spi-2.9.2.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:257) ~[stash-spi-2.9.2.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.get(BaseCommand.java:238) ~[stash-spi-2.9.2.jar:na] at com.atlassian.stash.internal.idx.ChangesetIndexingServiceImpl$IndexOperation.wrapUpCommand(ChangesetIndexingServiceImpl.java:486) ~[stash-service-impl-2.9.2.jar:na] at com.atlassian.stash.internal.idx.ChangesetIndexingServiceImpl$IndexOperation.indexChangesets(ChangesetIndexingServiceImpl.java:447) ~[stash-service-impl-2.9.2.jar:na] at com.atlassian.stash.internal.idx.ChangesetIndexingServiceImpl$IndexOperation.index(ChangesetIndexingServiceImpl.java:366) ~[stash-service-impl-2.9.2.jar:na] at com.atlassian.stash.internal.idx.ChangesetIndexingServiceImpl$IndexOperation.perform(ChangesetIndexingServiceImpl.java:273) ~[stash-service-impl-2.9.2.jar:na] at com.atlassian.stash.internal.idx.ChangesetIndexingServiceImpl.indexRepository(ChangesetIndexingServiceImpl.java:146) ~[stash-service-impl-2.9.2.jar:na] at com.sun.proxy.$Proxy209.indexRepository(Unknown Source) ~[na:na] at com.atlassian.stash.internal.idx.ChangesetIndexingScheduler$HierarchyIndexer.index(ChangesetIndexingScheduler.java:211) [stash-service-impl-2.9.2.jar:na] {noformat} Some broken artifacts may be visible in the branch selector UI.

    Atlassian JIRA | 3 years ago | Charles O'Farrell [Atlassian]
    com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: Broken pipe
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    When repositories contain nonstandard refs, ref sync incorrectly classifies them as branches and fails when trying to synchronize them. "Nonstandard" refs in this case means any ref that's not in a place where built-in {{git}} commands write refs. The "standard" refs are: * {{/refs/heads/}} for branches * {{/refs/notes/}} for notes * {{/refs/tags/}} for tags For example, {{/refs/pull}} and {{/refs/pull-requests}} are nonstandard refs. No built-in {{git}} command will ever create them on its own. Since ref sync assumes anything that isn't a note or a tag is a branch, when it synchronizes a nonstandard ref it tries to qualify them as branches to verify they were synchronized. That results in it trying to look up the refs as, e.g., {{/refs/heads/refs/pull-requests/...}}. Since there's no such branch, ref sync fails with an error like: {noformat} 2016-02-15 01:06:13,156 WARN [ref-sync:thread-1] c.a.s.i.r.s.a.AutoRefSyncProcessor ~USER/repo[2]: Could not synchronize changes with KEY/repo[1] com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: git fetch updated refs/heads/refs/pull-requests/example, but the ref does not exist at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:113) ~[stash-scm-git-common-3.11.6.jar:na] at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:159) ~[stash-scm-git-common-3.11.6.jar:na] at com.atlassian.stash.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:33) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.FetchCommandHandler$FetchExitHandler.onExit(FetchCommandHandler.java:163) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.scm.BaseCommand.callExitHandler(BaseCommand.java:138) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:251) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.get(BaseCommand.java:220) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.scm.BaseCommand.call(BaseCommand.java:75) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.AbstractFetchSynchronizeRefsCommand.runFetch(AbstractFetchSynchronizeRefsCommand.java:91) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.IncrementalSynchronizeRefsCommand.runFetch(IncrementalSynchronizeRefsCommand.java:198) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.IncrementalSynchronizeRefsCommand.fetchRefs(IncrementalSynchronizeRefsCommand.java:194) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.IncrementalSynchronizeRefsCommand.synchronize(IncrementalSynchronizeRefsCommand.java:59) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.AbstractSynchronizeRefsCommand.call(AbstractSynchronizeRefsCommand.java:63) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.AbstractFetchSynchronizeRefsCommand.call(AbstractFetchSynchronizeRefsCommand.java:68) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.command.AbstractFetchSynchronizeRefsCommand.call(AbstractFetchSynchronizeRefsCommand.java:35) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SynchronizeOperation.doPerform(DefaultRefSyncService.java:604) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$AbstractOperation.perform(DefaultRefSyncService.java:345) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$AbstractOperation.perform(DefaultRefSyncService.java:334) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.util.TimerUtils.time(TimerUtils.java:54) ~[stash-util-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.time(DefaultRefSyncService.java:297) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.synchronize(DefaultRefSyncService.java:286) ~[stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.auto.AutoRefSyncProcessor.doProcess(AutoRefSyncProcessor.java:127) [stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.auto.AutoRefSyncProcessor.access$000(AutoRefSyncProcessor.java:32) [stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.auto.AutoRefSyncProcessor$1.perform(AutoRefSyncProcessor.java:67) [stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:51) [stash-service-impl-3.11.6.jar:na] at com.atlassian.stash.internal.repository.sync.auto.AutoRefSyncProcessor.process(AutoRefSyncProcessor.java:61) [stash-repository-ref-sync-3.11.6.jar:na] at com.atlassian.stash.internal.concurrent.HazelcastBucketedExecutor$BucketProcessingBootstrapper.run(HazelcastBucketedExecutor.java:130) [stash-service-impl-3.11.6.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_80] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_80] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_80] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_80] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80] ... 1 frame trimmed Caused by: java.lang.IllegalStateException: git fetch updated refs/heads/refs/pull-requests/example, but the ref does not exist at com.atlassian.stash.internal.repository.sync.command.FetchCommandHandler.buildAddRefChange(FetchCommandHandler.java:134) ~[na:na] at com.atlassian.stash.internal.repository.sync.command.FetchCommandHandler.processRef(FetchCommandHandler.java:103) ~[na:na] at com.atlassian.stash.internal.repository.sync.command.FetchCommandHandler.access$500(FetchCommandHandler.java:36) ~[na:na] at com.atlassian.stash.internal.repository.sync.command.FetchCommandHandler$RefOutputHandler.processLine(FetchCommandHandler.java:207) ~[na:na] at com.atlassian.utils.process.LineOutputHandler.process(LineOutputHandler.java:70) ~[atlassian-processutils-1.7.2.jar:na] at com.atlassian.utils.process.LineOutputHandler.process(LineOutputHandler.java:33) ~[atlassian-processutils-1.7.2.jar:na] at com.atlassian.stash.scm.SummarizingProcessHandler$DelegatingInputStreamHandler.process(SummarizingProcessHandler.java:186) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.scm.SummarizingProcessHandler$DelegatingInputStreamHandler.process(SummarizingProcessHandler.java:168) ~[stash-spi-3.11.6.jar:na] at com.atlassian.stash.scm.SummarizingProcessHandler.processError(SummarizingProcessHandler.java:88) ~[stash-spi-3.11.6.jar:na] at com.atlassian.utils.process.ExternalProcessImpl$ErrorHandlerRunnable.process(ExternalProcessImpl.java:730) ~[atlassian-processutils-1.7.2.jar:na] at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.doTask(ExternalProcessImpl.java:683) ~[atlassian-processutils-1.7.2.jar:na] at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:158) ~[atlassian-processutils-1.7.2.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:73) ~[stash-platform-3.11.6.jar:na] ... 3 common frames omitted {noformat}

    Atlassian JIRA | 1 year ago | Bryan Turner
    com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: git fetch updated refs/heads/refs/pull-requests/example, but the ref does not exist
  4. 0

    {code} 2013-11-22 09:11:40,241 DEBUG [http-bio-7990-exec-31] voodoo 551x361x4 m751bs 127.0.0.1 "GET /rest/branch-utils/latest/projects/PROJECT/repos/repo/branches/info/23d2b5c777d94a603c489ac049628ea177463fcb HTTP/1.0" c.a.s.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 500 com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: process timed out at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120) ~[na:na] at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:163) ~[na:na] at com.atlassian.stash.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:35) ~[stash-spi-2.9.1.jar:na] at com.atlassian.stash.scm.BaseCommand.callExitHandler(BaseCommand.java:141) ~[stash-spi-2.9.1.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:257) ~[stash-spi-2.9.1.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.get(BaseCommand.java:224) ~[stash-spi-2.9.1.jar:na] at com.atlassian.stash.scm.BaseCommand.call(BaseCommand.java:78) ~[stash-spi-2.9.1.jar:na] at com.atlassian.stash.internal.branch.info.git.GitBranchInformation.getBranches(GitBranchInformation.scala:79) ~[stash-branch-utils-2.9.1_1384828358000.jar:na] at com.atlassian.stash.internal.branch.info.DefaultBranchInformationService.getFilteredBranches$1(DefaultBranchInformationService.scala:26) ~[stash-branch-utils-2.9.1_1384828358000.jar:na] at com.atlassian.stash.internal.branch.info.DefaultBranchInformationService.getBranches(DefaultBranchInformationService.scala:40) ~[stash-branch-utils-2.9.1_1384828358000.jar:na] at com.atlassian.stash.internal.branch.rest.BranchUtilsResource.getBranches(BranchUtilsResource.java:107) ~[stash-branch-utils-2.9.1_1384828358000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.0.5_1384476184000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:90) [StashAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) [atlassian-trusted-apps-core-3.0.2.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:61) [atlassian-oauth-service-provider-plugin-1.9.0-m3_1384476184000.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:72) [stash-service-impl-2.9.1.jar:na] at java.lang.Thread.run(Thread.java:662) [na:1.6.0_45] ... 174 frames trimmed Caused by: com.atlassian.utils.process.ProcessTimeoutException: process timed out at com.atlassian.utils.process.ExternalProcessImpl.wrapUpProcess(ExternalProcessImpl.java:506) ~[atlassian-processutils-1.5.14.jar:na] at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:423) ~[atlassian-processutils-1.5.14.jar:na] at com.atlassian.stash.scm.BaseCommand$CommandFuture.get(BaseCommand.java:222) ~[stash-spi-2.9.1.jar:na] ... 16 common frames omitted {code}

    Atlassian JIRA | 4 years ago | Alexey Efimov
    com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: process timed out

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.atlassian.stash.exception.ServerException

      An error occurred while executing an external process: git fetch updated refs/heads/refs/notes/commits, but the ref does not exist

      at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.evaluateThrowable()
    2. com.atlassian.stash
      GitCommandExitHandler.evaluateThrowable
      1. com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120)[stash-scm-git-common-2.8.1_1380678110000.jar:na]
      1 frame