Stash returns "500 error" when trying to access public repository

Dear Atlassian,

I am a Stash administrator at my company. We are experiencing an issue where we get a "500 error" when accessing public repositories while not logged in.

When I open Stash, click on the project, and then navigate into the repository and branch, I do not get the error. Once I hit refresh or try to access the url with an incognito browser, I get a 500 error.

Here is a snippet from the Stash logs:

2015-04-17 14:19:33,610 ERROR [http-nio-7990-exec-30] @1OP056Vx859x6321197x1 10.22.90.10 "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/projects/DAT/repos/json_event_parser/browse]
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.google.template.soy.tofu.SoyTofuException: When evaluating "getWebItems('stash.repository.nav', ['repository': $repository])": While computing function "getWebItems('stash.repository.nav', ['repository': $repository])": null value
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) ~[spring-webm
vc-4.1.4.RELEASE.jar:4.1.4.RELEASE]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na]
        at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:111) ~[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.8.jar:na]
        at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) ~[na:na]
        at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) ~[atlassian-trusted-apps-core-3.0.8.jar:na]
        at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) ~[na:na]
        at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32) ~[na:na]
        at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) ~[na: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.7.0.jar:na]
        at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) ~[ConfigurableWebFilter.class:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_25]
        at java.lang.Thread.run(Thread.java:724) [na:1.7.0_25]
        ... 215 frames trimmed
Caused by: com.google.template.soy.tofu.SoyTofuException: When evaluating "getWebItems('stash.repository.nav', ['repository': $repository])": While computing function "getWebItems('stash.repository.nav', ['repository': $repository])": null value
        at stash.layout.repository(repository.soy:58) ~[na:na]
        at stash.layout.branch(branch.soy:39) ~[na:na]
        at stash.layout.files(files.soy:36) ~[na:na]
        at stash.page.filebrowser(filebrowser.soy:17) ~[na:na]
        at com.google.template.soy.tofu.internal.BaseTofu.renderMainHelper(BaseTofu.java:369) ~[na:na]
        at com.google.template.soy.tofu.internal.BaseTofu.renderMain(BaseTofu.java:322) ~[na:na]
        at com.google.template.soy.tofu.internal.BaseTofu.access$100(BaseTofu.java:66) ~[na:na]
        at com.google.template.soy.tofu.internal.BaseTofu$RendererImpl.render(BaseTofu.java:476) ~[na:na]
        at com.atlassian.soy.impl.DefaultSoyManager.render(DefaultSoyManager.java:155) ~[na:na]
        at com.atlassian.soy.impl.DefaultSoyTemplateRenderer.render(DefaultSoyTemplateRenderer.java:52) ~[na:na]
        at com.atlassian.stash.internal.plugin.OsgiServiceProxyFactoryImpl$DynamicServiceInvocationHandler.invoke(OsgiServiceProxyFactoryImpl.java:119) ~[stash-platform-3.7.0.jar:na]
        at com.atlassian.soy.springmvc.SoyView.render(SoyView.java:55) ~[atlassian-soy-spring-mvc-support-3.3.1.jar:na]
        at com.atlassian.stash.internal.web.soy.StashSoyViewResolver$1.render(StashSoyViewResolver.java:33) ~[StashSoyViewResolver$1.class:na]
        ... 17 common frames omitted
Caused by: com.google.template.soy.sharedpasses.render.RenderException: When evaluating "getWebItems('stash.repository.nav', ['repository': $repository])": While computing function "getWebItems('stash.repository.nav', ['repository': $repository])": null value
        at stash.layout.repository(repository.soy:58) ~[na:na]
        at stash.layout.branch(branch.soy:39) ~[na:na]
        at stash.layout.files(files.soy:36) ~[na:na]
        at stash.page.filebrowser(filebrowser.soy:17) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.eval(RenderVisitor.java:741) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallNodeHelper(RenderVisitor.java:558) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallBasicNode(RenderVisitor.java:457) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:110) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:702) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitTemplateNode(RenderVisitor.java:220) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitTemplateBasicNode(AbstractSoyNodeVisitor.java:160) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:66) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.exec(AbstractNodeVisitor.java:40) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallNodeHelper(RenderVisitor.java:590) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallBasicNode(RenderVisitor.java:457) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:110) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:698) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitTemplateNode(RenderVisitor.java:220) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitTemplateBasicNode(AbstractSoyNodeVisitor.java:160) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:66) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.exec(AbstractNodeVisitor.java:40) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallNodeHelper(RenderVisitor.java:590) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallBasicNode(RenderVisitor.java:457) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:110) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:702) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitTemplateNode(RenderVisitor.java:220) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitTemplateBasicNode(AbstractSoyNodeVisitor.java:160) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:66) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.exec(AbstractNodeVisitor.java:40) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallNodeHelper(RenderVisitor.java:590) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallBasicNode(RenderVisitor.java:457) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:110) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:702) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.visitTemplateNode(RenderVisitor.java:220) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitTemplateBasicNode(AbstractSoyNodeVisitor.java:160) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:66) ~[na:na]
        at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) ~[na:na]
        at com.google.template.soy.basetree.AbstractNodeVisitor.exec(AbstractNodeVisitor.java:40) ~[na:na]
        at com.google.template.soy.tofu.internal.BaseTofu.renderMainHelper(BaseTofu.java:366) ~[na:na]
        ... 25 common frames omitted
Caused by: com.google.template.soy.sharedpasses.render.RenderException: While computing function "getWebItems('stash.repository.nav', ['repository': $repository])": null value
        at com.google.template.soy.sharedpasses.render.EvalVisitor.computeFunctionHelper(EvalVisitor.java:672) ~[na:na]
        at com.google.template.soy.sharedpasses.render.EvalVisitor.visitFunctionNode(EvalVisitor.java:653) ~[na:na]
        at com.google.template.soy.sharedpasses.render.EvalVisitor.visitFunctionNode(EvalVisitor.java:87) ~[na:na]
        at com.google.template.soy.exprtree.AbstractReturningExprNodeVisitor.visit(AbstractReturningExprNodeVisitor.java:118) ~[na:na]
        at com.google.template.soy.sharedpasses.render.EvalVisitor.visitExprRootNode(EvalVisitor.java:148) ~[na:na]
        at com.google.template.soy.sharedpasses.render.EvalVisitor.visitExprRootNode(EvalVisitor.java:87) ~[na:na]
        at com.google.template.soy.exprtree.AbstractReturningExprNodeVisitor.visit(AbstractReturningExprNodeVisitor.java:81) ~[na:na]
        at com.google.template.soy.exprtree.AbstractReturningExprNodeVisitor.visit(AbstractReturningExprNodeVisitor.java:73) ~[na:na]
        at com.google.template.soy.basetree.AbstractReturningNodeVisitor.exec(AbstractReturningNodeVisitor.java:43) ~[na:na]
        at com.google.template.soy.sharedpasses.render.RenderVisitor.eval(RenderVisitor.java:739) ~[na:na]
        ... 74 common frames omitted
Caused by: java.lang.NullPointerException: null value
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204) ~[guava-11.0.2-atlassian-02.jar:na]
        at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:139) ~[guava-11.0.2-atlassian-02.jar:na]
        at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:178) ~[guava-11.0.2-atlassian-02.jar:na]
        at com.google.common.collect.ImmutableMap$Builder.putAll(ImmutableMap.java:215) ~[guava-11.0.2-atlassian-02.jar:na]
        at com.pirateninjaunicorn.stash.readmeparser.context.BranchContextProvider.getContextMap(BranchContextProvider.java:53) ~[na:na]
        at com.atlassian.plugin.web.model.AbstractWebItem.getContextMap(AbstractWebItem.java:30) ~[atlassian-plugins-webfragment-3.0.8.jar:na]
        at com.atlassian.plugin.web.model.DefaultWebLink.getRenderedUrl(DefaultWebLink.java:34) ~[atlassian-plugins-webfragment-3.0.8.jar:na]
        at com.atlassian.plugin.web.model.DefaultWebLink.getDisplayableUrl(DefaultWebLink.java:45) ~[atlassian-plugins-webfragment-3.0.8.jar:na]
        at com.atlassian.stash.internal.web.soy.functions.AbstractWebFragmentFunction.getWebItems(AbstractWebFragmentFunction.java:44) ~[AbstractWebFragmentFunction.class:na]
        at com.atlassian.stash.internal.web.soy.functions.WebItemFunction.apply(WebItemFunction.java:51) ~[WebItemFunction.class:na]
        at com.atlassian.stash.internal.web.soy.functions.WebItemFunction.apply(WebItemFunction.java:18) ~[WebItemFunction.class:na]
        at com.atlassian.soy.impl.modules.SoyJavaFunctionAdapter.computeForJava(SoyJavaFunctionAdapter.java:39) ~[na:na]
        at com.atlassian.soy.impl.modules.CompositeFunctionAdaptor.computeForJava(CompositeFunctionAdaptor.java:37) ~[na:na]
        at com.google.template.soy.sharedpasses.render.EvalVisitor.computeFunctionHelper(EvalVisitor.java:670) ~[na:na]
        ... 83 common frames omitted


Any leads as to what is causing this would be appreciated.

Thank you,

Alex Gabrielian

2 answers

Hi Alex,

After some research I found this error is seen in two scenarios, so you may give a try checking each of them:

  • Using an unsupported JDK: You are using a JDK version 1.7.0_25, which is supported if you are using Stash 3.8. In case it's an Open JDK, however, I'd suggest giving a try to the Oracle JDK - I saw a case in which switching from the Open JDK to the Oracle JDK avoided the error, despite the Open JDK 1.7 being supported.
  • 3rd party plugin: I've also seen some cases in which the Awesome Graphs plugin was causing this. Please check what 3rd party plugin you have installed. You may give a try, at least for a testing purpose, disabling them and confirm if the error persists.

 

Please also clarify whether you've built, or if you are trying to build your own plugin. According to this Answers topic you may have issues depending on how you build your paths.

Regards,

Gustavo Refosco

Exact same issue here on Stash 3.6.0 with OpenJDK.

Faulty plugin is 'Readme Parser' v 1.4.3. Once disabled, no more 500's on anonymous browsing.

Issue is known, see : https://bitbucket.org/pirateninjaunicorn/stash-readme-parser/issues/46/error-500-when-browsing-anonymously-to

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,768 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you