java.lang.RuntimeException: Error opening/reading [/var/atlassian/application-data/stash/shared/data/repositories/1/refs/heads/master]

Atlassian JIRA | Peter Koczan | 1 year ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 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]
  2. 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]

    Root Cause Analysis

    1. 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()
    2. com.atlassian.stash
      StateTransferringExecutor$StateTransferringRunnable.run
      1. com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:260)[na:na]
      2. com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:251)[na:na]
      3. com.atlassian.stash.internal.scm.git.RawGitAgent.resolveBranch(RawGitAgent.java:368)[na:na]
      4. com.atlassian.stash.internal.scm.git.RawGitAgent.resolveHead(RawGitAgent.java:225)[na:na]
      5. com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:198)[na:na]
      6. com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$1.call(DefaultGitCommandFactory.java:194)[na:na]
      7. com.atlassian.stash.internal.repository.RepositoryMetadataServiceImpl.getDefaultBranch(RepositoryMetadataServiceImpl.java:93)[stash-service-impl-3.9.1.jar:na]
      8. com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.getDefaultBranchId(PrintBranchLinksHook.java:66)[na:na]
      9. com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.shouldPrint(PrintBranchLinksHook.java:57)[na:na]
      10. com.atlassian.stash.internal.plugin.hooks.branchlinks.PrintBranchLinksHook.onReceive(PrintBranchLinksHook.java:44)[na:na]
      11. com.atlassian.stash.internal.hook.DefaultBuiltInHookHandlerFactory$2.handle(DefaultBuiltInHookHandlerFactory.java:71)[stash-service-impl-3.9.1.jar:na]
      12. com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:345)[stash-service-impl-3.9.1.jar:na]
      13. com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:331)[stash-service-impl-3.9.1.jar:na]
      14. com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:239)[stash-service-impl-3.9.1.jar:na]
      15. com.atlassian.stash.internal.hook.DefaultHookService$2$1.run(DefaultHookService.java:205)[stash-service-impl-3.9.1.jar:na]
      16. com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:73)[stash-platform-3.9.1.jar:na]
      16 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0_66]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_66]
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0_66]
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[na:1.8.0_66]
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_66]
      6. java.lang.Thread.run(Thread.java:745)[na:1.8.0_66]
      6 frames