com.atlassian.bitbucket.repository.NoDefaultBranchException: No default branch is defined

GitHub | mdavoodi | 9 months ago
  1. 0

    No NoDefaultBranchException stops index process

    GitHub | 2 years ago | lotharschulz
    com.atlassian.stash.exception.NoDefaultBranchException: No default branch is defined
  2. 0

    Skip repository if no default branch is defined

    GitHub | 9 months ago | mdavoodi
    com.atlassian.bitbucket.repository.NoDefaultBranchException: No default branch is defined
  3. 0

    h4. Problem If you move your master branch then create one with a name like {{master/alternate}} instead then push it back to origin, Stash will throw a HTTP 500 error stating: {{Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master]}} The logs will show: {noformat} 2015-12-04 12:15:39,342 WARN [threadpool:thread-9] admin @6JC3HDx735x117x0 127.0.0.1 "POST /scm/test/testrepo.git/git-receive-pack HTTP/1.1" c.a.s.i.h.DefaultBuiltInHookHandlerFactory Hook com.atlas sian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook failed. java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:260) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:251) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveBranch(RawGitAgent.java:368) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveHead(RawGitAgent.java:225) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:198) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:194) ~[na:na] at com.atlassian.stash.internal.repository.RepositoryMetadataServiceImpl.getDefaultBranch(RepositoryMetadataServiceImpl.java:93) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.getDefaultBranchId(PrintBranchLinksHook.java:66) ~[na:na] at com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.shouldPrint(PrintBranchLinksHook.java:57) ~[na:na] at com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.onReceive(PrintBranchLinksHook.java:44) ~[na:na] at com.atlassian.stash.internal.hook.DefaultBuiltInHookHandlerFactory$2.handle(DefaultBuiltInHookHandlerFactory.java:71) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:345) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:331) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:239) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService$2$1.run(DefaultHookService.java:205) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:73) [stash-platform-3.9.1.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_66] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_66] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_66] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_66] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_66] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66] ... 66 frames trimmed Caused by: java.io.IOException: Is a directory at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_66] at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_66] at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_66] at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_66] at java.io.BufferedReader.fill(BufferedReader.java:161) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[na:1.8.0_66] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:473) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:469) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:256) ~[na:na] ... 22 common frames omitted 2015-12-04 12:15:46,723 ERROR [http-nio-7990-exec-3] admin @6JC3HDx735x118x0 151ydgu 127.0.0.1 "GET /projects/TEST/repos/testrepo/browse HTTP/1.1" c.a.s.i.w.HandlerExceptionResolverImpl Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master] java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:260) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:251) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveBranch(RawGitAgent.java:368) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveHead(RawGitAgent.java:225) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:198) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:194) ~[na:na] at com.atlassian.stash.internal.repository.RepositoryMetadataServiceImpl.getDefaultBranch(RepositoryMetadataServiceImpl.java:93) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.web.repos.RepositoryController.browseFilePath(RepositoryController.java:271) ~[RepositoryController.class:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.3.5_1427859172000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:83) [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:103) [atlassian-trusted-apps-core-4.0.0.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) [atlassian-oauth-service-provider-plugin-1.9.10_1427859174000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32) [analytics-client-3.65.1_1428700568000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) [analytics-client-3.65.1_1428700568000.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:85) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [ConfigurableWebFilter.class:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_66] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66] ... 273 frames trimmed Caused by: java.io.IOException: Is a directory at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_66] at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_66] at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_66] at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_66] at java.io.BufferedReader.fill(BufferedReader.java:161) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[na:1.8.0_66] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:473) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:469) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:256) ~[na:na] ... 24 common frames omitted {noformat} h4. Steps to reproduce # Create a repository # Clone the newly created repository to a local # Add something to the local repository and commit it # {{git branch -m tmp}} # {{git branch master/alternate}} # {{git checkout master/alternate}} # {{git branch -D tmp}} # {{git push origin master/alternate}} h4. Proposed solution This scenario should be handled the same way as it is described in the following article: [https://confluence.atlassian.com/display/STASHKB/NoDefaultBranchException+error+regarding+the+default+branch+-+this+branch+does+not+exist].

    Atlassian JIRA | 1 year ago | Peter Koczan
    java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h4. Problem If you move your master branch then create one with a name like {{master/alternate}} instead then push it back to origin, Stash will throw a HTTP 500 error stating: {{Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master]}} The logs will show: {noformat} 2015-12-04 12:15:39,342 WARN [threadpool:thread-9] admin @6JC3HDx735x117x0 127.0.0.1 "POST /scm/test/testrepo.git/git-receive-pack HTTP/1.1" c.a.s.i.h.DefaultBuiltInHookHandlerFactory Hook com.atlas sian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook failed. java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:260) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:251) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveBranch(RawGitAgent.java:368) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveHead(RawGitAgent.java:225) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:198) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:194) ~[na:na] at com.atlassian.stash.internal.repository.RepositoryMetadataServiceImpl.getDefaultBranch(RepositoryMetadataServiceImpl.java:93) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.getDefaultBranchId(PrintBranchLinksHook.java:66) ~[na:na] at com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.shouldPrint(PrintBranchLinksHook.java:57) ~[na:na] at com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.onReceive(PrintBranchLinksHook.java:44) ~[na:na] at com.atlassian.stash.internal.hook.DefaultBuiltInHookHandlerFactory$2.handle(DefaultBuiltInHookHandlerFactory.java:71) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:345) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:331) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:239) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hook.DefaultHookService$2$1.run(DefaultHookService.java:205) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:73) [stash-platform-3.9.1.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_66] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_66] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_66] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_66] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_66] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66] ... 66 frames trimmed Caused by: java.io.IOException: Is a directory at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_66] at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_66] at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_66] at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_66] at java.io.BufferedReader.fill(BufferedReader.java:161) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[na:1.8.0_66] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:473) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:469) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:256) ~[na:na] ... 22 common frames omitted 2015-12-04 12:15:46,723 ERROR [http-nio-7990-exec-3] admin @6JC3HDx735x118x0 151ydgu 127.0.0.1 "GET /projects/TEST/repos/testrepo/browse HTTP/1.1" c.a.s.i.w.HandlerExceptionResolverImpl Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master] java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:260) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:251) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveBranch(RawGitAgent.java:368) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveHead(RawGitAgent.java:225) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:198) ~[na:na] at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:194) ~[na:na] at com.atlassian.stash.internal.repository.RepositoryMetadataServiceImpl.getDefaultBranch(RepositoryMetadataServiceImpl.java:93) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.web.repos.RepositoryController.browseFilePath(RepositoryController.java:271) ~[RepositoryController.class:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.3.5_1427859172000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:83) [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:103) [atlassian-trusted-apps-core-4.0.0.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) [atlassian-oauth-service-provider-plugin-1.9.10_1427859174000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32) [analytics-client-3.65.1_1428700568000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) [analytics-client-3.65.1_1428700568000.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:85) [stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [ConfigurableWebFilter.class:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_66] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66] ... 273 frames trimmed Caused by: java.io.IOException: Is a directory at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_66] at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_66] at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_66] at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109) ~[na:1.8.0_66] at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_66] at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_66] at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_66] at java.io.BufferedReader.fill(BufferedReader.java:161) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[na:1.8.0_66] at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[na:1.8.0_66] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:473) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent$FirstLineCallback.doWithReader(RawGitAgent.java:469) ~[na:na] at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:256) ~[na:na] ... 24 common frames omitted {noformat} h4. Steps to reproduce # Create a repository # Clone the newly created repository to a local # Add something to the local repository and commit it # {{git branch -m tmp}} # {{git branch master/alternate}} # {{git checkout master/alternate}} # {{git branch -D tmp}} # {{git push origin master/alternate}} h4. Proposed solution This scenario should be handled the same way as it is described in the following article: [https://confluence.atlassian.com/display/STASHKB/NoDefaultBranchException+error+regarding+the+default+branch+-+this+branch+does+not+exist].

    Atlassian JIRA | 1 year ago | Peter Koczan
    java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master]

    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.bitbucket.repository.NoDefaultBranchException

      No default branch is defined

      at com.atlassian.stash.internal.scm.git.RawGitAgent.getHead()
    2. com.atlassian.stash
      DefaultRefService.getBranches
      1. com.atlassian.stash.internal.scm.git.RawGitAgent.getHead(RawGitAgent.java:136)[na:na]
      2. com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory.branches(DefaultGitCommandFactory.java:109)[na:na]
      3. com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory.branches(DefaultGitCommandFactory.java:61)[na:na]
      4. com.atlassian.stash.internal.scm.PluginScmCommandFactory.branches(PluginScmCommandFactory.java:46)[bitbucket-service-impl-4.4.1.jar:na]
      5. com.atlassian.stash.internal.repository.DefaultRefService.getBranches(DefaultRefService.java:160)[bitbucket-service-impl-4.4.1.jar:na]
      5 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor710.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_74]
      3. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_74]
      3 frames
    4. Spring AOP
      MethodInvocationProceedingJoinPoint.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      4. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      4 frames
    5. com.atlassian.stash
      ProfilingAspect.profileMethod
      1. com.atlassian.stash.internal.aop.ProfilingAspect.profileMethod(ProfilingAspect.java:48)[bitbucket-platform-4.4.1.jar:na]
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_74]
      3. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_74]
      3 frames
    7. Spring AOP
      MethodInvocationProceedingJoinPoint.proceed
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      5. org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      5 frames
    8. com.atlassian.stash
      ThrottledAspect.throttle
      1. com.atlassian.stash.internal.aop.ThrottledAspect.throttle(ThrottledAspect.java:52)[bitbucket-platform-4.4.1.jar:na]
      1 frame
    9. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor706.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_74]
      3. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_74]
      3 frames
    10. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      2. org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      3. org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      4 frames
    11. spring-security-core
      MethodSecurityInterceptor.invoke
      1. org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64)[spring-security-core-3.2.7.RELEASE.jar:3.2.7.RELEASE]
      1 frame
    12. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      1 frame
    13. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      3 frames
    14. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      2. org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:125)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      4. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      5. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      6. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)[spring-aop-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      6 frames
    15. com.sun.proxy
      $Proxy239.getBranches
      1. com.sun.proxy.$Proxy239.getBranches(Unknown Source)[na:na]
      1 frame
    16. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor710.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_74]
      3. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_74]
      3 frames
    17. com.atlassian.plugin
      ContextClassLoaderSettingInvocationHandler.invoke
      1. com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)[atlassian-plugins-core-4.1.1.jar:na]
      1 frame
    18. com.sun.proxy
      $Proxy326.getBranches
      1. com.sun.proxy.$Proxy326.getBranches(Unknown Source)[na:na]
      1 frame
    19. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor710.invoke(Unknown Source)[na:na]
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_74]
      3. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_74]
      3 frames
    20. com.atlassian.plugin
      HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke
      1. com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)[atlassian-plugins-osgi-bridge-4.1.1.jar:na]
      1 frame
    21. com.sun.proxy
      $Proxy326.getBranches
      1. com.sun.proxy.$Proxy326.getBranches(Unknown Source)[na:na]
      1 frame
    22. com.mohamicorp.stash
      GlobalSettingsServlet$1$1.perform
      1. com.mohamicorp.stash.searchforstash.repository.RepositoryServiceManagerImpl.getBranchMap(RepositoryServiceManagerImpl.java:78)[plugin.495922907779022355.search-for-stash-2.2_1460749823000.jar:na]
      2. com.mohamicorp.stash.searchforstash.updater.SearchUpdaterImpl.reindexAll(SearchUpdaterImpl.java:673)[plugin.495922907779022355.search-for-stash-2.2_1460749823000.jar:na]
      3. com.mohamicorp.stash.searchforstash.admin.GlobalSettingsServlet$1$1.perform(GlobalSettingsServlet.java:316)[plugin.495922907779022355.search-for-stash-2.2_1460749823000.jar:na]
      4. com.mohamicorp.stash.searchforstash.admin.GlobalSettingsServlet$1$1.perform(GlobalSettingsServlet.java:312)[plugin.495922907779022355.search-for-stash-2.2_1460749823000.jar:na]
      4 frames
    23. com.atlassian.stash
      DefaultEscalatedSecurityContext.call
      1. com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:51)[bitbucket-service-impl-4.4.1.jar:na]
      1 frame
    24. com.mohamicorp.stash
      GlobalSettingsServlet$1.run
      1. com.mohamicorp.stash.searchforstash.admin.GlobalSettingsServlet$1.run(GlobalSettingsServlet.java:312)[plugin.495922907779022355.search-for-stash-2.2_1460749823000.jar:na]
      1 frame
    25. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_74]
      1 frame