pull-request-notifier-for-bitbucket icon indicating copy to clipboard operation
pull-request-notifier-for-bitbucket copied to clipboard

Update plugin 4.1 to 5.0

Open nenashev-ve opened this issue 4 years ago • 3 comments

After updating the plugin to 7.6.1 After updating the plugin on 7.6.1, I could not go to the plugin configuration page, in every PR I saw this error, after the warning was closed, the configuration of the plugin was not available via the web.

We couldn't find the page you requested.

At the same time, in the logs, I missed the attempt to access the installed sonar4bitbucket in the system but not belonging to the prnfb settings.

2021-01-19 06:45:25,224 ERROR [http-nio-7991-exec-7] 11004961 *15LPMEUx405x5978838x4 1w1acxw 10.2.174.85,10.46.235.120 "GET /plugins/servlet/prnfb/admin HTTP/1.0" c.m.s.s.sonar.DefaultSonarClient SONAR: Could not connect Sonar server at GET http://10.53.86.186:9000/api/server/version HTTP/1.1 org.apache.http.conn.HttpHostConnectException: Connect to 10.53.86.186:9000 [/10.53.86.186] failed: Connection refused (Connection refused) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient$$anonfun$71.apply(DefaultSonarClient.scala:2717) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient$$anonfun$71.apply(DefaultSonarClient.scala:2717) at ch.mibex.stash.sonar4stash.Logging$class.time(Logging.scala:34) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient.time(DefaultSonarClient.scala:45) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient.executeInternal(DefaultSonarClient.scala:2717) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient.ch$mibex$stash$sonar4stash$sonar$DefaultSonarClient$$executeWithResult(DefaultSonarClient.scala:2697) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient$$anonfun$getSonarVersion$1.apply(DefaultSonarClient.scala:2627) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient$$anonfun$getSonarVersion$1.apply(DefaultSonarClient.scala:2623) at ch.mibex.stash.sonar4stash.Utils$.using(Utils.scala:57) at ch.mibex.stash.sonar4stash.sonar.DefaultSonarClient.getSonarVersion(DefaultSonarClient.scala:2623) at ch.mibex.stash.sonar4stash.webhooks.SonarWebhookService.getSonarVersion(SonarWebhookService.scala:76) at ch.mibex.stash.sonar4stash.webhooks.SonarWebhookService.isSonarWebhookExisting(SonarWebhookService.scala:28) at ch.mibex.stash.sonar4stash.webhooks.WebHookConfigNeededCondition$$anonfun$shouldDisplay$1.apply(WebHookConfigNeededCondition.scala:16) at ch.mibex.stash.sonar4stash.webhooks.WebHookConfigNeededCondition$$anonfun$shouldDisplay$1.apply(WebHookConfigNeededCondition.scala:16) at scala.collection.IndexedSeqOptimized$class.prefixLengthImpl(IndexedSeqOptimized.scala:38) at scala.collection.IndexedSeqOptimized$class.exists(IndexedSeqOptimized.scala:46) at scala.collection.mutable.ArrayBuffer.exists(ArrayBuffer.scala:48) at ch.mibex.stash.sonar4stash.webhooks.WebHookConfigNeededCondition.shouldDisplay(WebHookConfigNeededCondition.scala:16) at com.atlassian.plugin.web.DefaultWebInterfaceManager.filterFragmentsByCondition(DefaultWebInterfaceManager.java:160) at com.atlassian.plugin.web.DefaultWebInterfaceManager.getDisplayableWebPanelDescriptors(DefaultWebInterfaceManager.java:123) at com.atlassian.stash.internal.web.fragments.WebFragmentSupport.getWebPanels(WebFragmentSupport.java:98) at com.atlassian.stash.internal.web.fragments.WebFragmentSupport$$FastClassBySpringCGLIB$$a614745b.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at com.atlassian.stash.internal.plugin.OsgiSafeProxyProvider$1.invoke(OsgiSafeProxyProvider.java:95) at com.atlassian.stash.internal.web.fragments.WebFragmentSupport$$EnhancerBySpringCGLIB$$8f87e34e.getWebPanels(<generated>) at com.atlassian.stash.internal.web.soy.functions.WebPanelFunction.apply(WebPanelFunction.java:50) at com.atlassian.stash.internal.web.soy.functions.WebPanelFunction.apply(WebPanelFunction.java:18) at com.atlassian.soy.impl.modules.SoyJavaFunctionAdapter.computeForJava(SoyJavaFunctionAdapter.java:34) at com.atlassian.soy.impl.modules.CompositeFunctionAdaptor.computeForJava(CompositeFunctionAdaptor.java:38) at com.google.template.soy.sharedpasses.render.EvalVisitor.computeFunctionHelper(EvalVisitor.java:670) at com.google.template.soy.sharedpasses.render.EvalVisitor.visitFunctionNode(EvalVisitor.java:653) at com.google.template.soy.sharedpasses.render.EvalVisitor.visitFunctionNode(EvalVisitor.java:87) at com.google.template.soy.exprtree.AbstractReturningExprNodeVisitor.visit(AbstractReturningExprNodeVisitor.java:118) at com.google.template.soy.sharedpasses.render.EvalVisitor.visitExprRootNode(EvalVisitor.java:148) at com.google.template.soy.sharedpasses.render.EvalVisitor.visitExprRootNode(EvalVisitor.java:87) at com.google.template.soy.exprtree.AbstractReturningExprNodeVisitor.visit(AbstractReturningExprNodeVisitor.java:81) at com.google.template.soy.exprtree.AbstractReturningExprNodeVisitor.visit(AbstractReturningExprNodeVisitor.java:73) at com.google.template.soy.basetree.AbstractReturningNodeVisitor.exec(AbstractReturningNodeVisitor.java:43) at com.google.template.soy.sharedpasses.render.RenderVisitor.eval(RenderVisitor.java:739) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitForeachNode(RenderVisitor.java:382) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:104) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:702) at com.google.template.soy.sharedpasses.render.RenderVisitor.renderBlock(RenderVisitor.java:716) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallNodeHelper(RenderVisitor.java:564) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallBasicNode(RenderVisitor.java:457) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:110) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:702) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitTemplateNode(RenderVisitor.java:220) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitTemplateBasicNode(AbstractSoyNodeVisitor.java:160) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:66) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) at com.google.template.soy.basetree.AbstractNodeVisitor.exec(AbstractNodeVisitor.java:40) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallNodeHelper(RenderVisitor.java:590) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitCallBasicNode(RenderVisitor.java:457) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:110) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) at com.google.template.soy.basetree.AbstractNodeVisitor.visitChildren(AbstractNodeVisitor.java:59) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitChildren(AbstractSoyNodeVisitor.java:129) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitBlockHelper(RenderVisitor.java:702) at com.google.template.soy.sharedpasses.render.RenderVisitor.visitTemplateNode(RenderVisitor.java:220) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visitTemplateBasicNode(AbstractSoyNodeVisitor.java:160) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:66) at com.google.template.soy.soytree.AbstractSoyNodeVisitor.visit(AbstractSoyNodeVisitor.java:56) at com.google.template.soy.basetree.AbstractNodeVisitor.exec(AbstractNodeVisitor.java:40) at com.google.template.soy.tofu.internal.BaseTofu.renderMainHelper(BaseTofu.java:366) at com.google.template.soy.tofu.internal.BaseTofu.renderMain(BaseTofu.java:322) at com.google.template.soy.tofu.internal.BaseTofu.access$100(BaseTofu.java:66) at com.google.template.soy.tofu.internal.BaseTofu$RendererImpl.render(BaseTofu.java:476) at com.atlassian.soy.impl.DefaultSoyManager.render(DefaultSoyManager.java:154) at com.atlassian.soy.impl.DefaultSoyTemplateRenderer.render(DefaultSoyTemplateRenderer.java:45) at com.atlassian.stash.internal.plugin.OsgiServiceProxyFactoryImpl$DynamicServiceInvocationHandler.invoke(OsgiServiceProxyFactoryImpl.java:105) at com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:33) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:92) at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.stash.internal.web.auth.AuthorizationFailureInterceptor.doFilterInternal(AuthorizationFailureInterceptor.java:39) at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69) at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109) at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37) at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:26) at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:48) at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90) at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 188 frames trimmed Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:606) at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ... 110 common frames omitted

I fixed this problem by reconfiguring the non-prnfb plugin sonar4bitbucket and now I see the following, which does not allow us to understand the cause of the error 2021-01-19 08:23:30,179 DEBUG [http-nio-7991-exec-180] 11004961 *15LPMEUx503x6072047x5 1w1acxw 10.2.174.85,10.46.235.120 "GET /plugins/servlet/prnfb/admin HTTP/1.0" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key bitbucket.server.web.admin.settings.theme and locales [en_US, en] 2021-01-19 08:23:30,186 DEBUG [http-nio-7991-exec-180] 11004961 *15LPMEUx503x6072047x5 1w1acxw 10.2.174.85,10.46.235.120 "GET /plugins/servlet/prnfb/admin HTTP/1.0" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key bbg-settings.label and locales [en_US, en] 2021-01-19 08:23:30,186 DEBUG [http-nio-7991-exec-180] 11004961 *15LPMEUx503x6072047x5 1w1acxw 10.2.174.85,10.46.235.120 "GET /plugins/servlet/prnfb/admin HTTP/1.0" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key bbg-settings.description and locales [en_US, en] 2021-01-19 08:23:30,187 DEBUG [http-nio-7991-exec-180] 11004961 *15LPMEUx503x6072047x5 1w1acxw 10.2.174.85,10.46.235.120 "GET /plugins/servlet/prnfb/admin HTTP/1.0" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key plugin.page.repo.ci.info.tab.label and locales [en_US, en] 2021-01-19 08:23:30,187 DEBUG [http-nio-7991-exec-180] 11004961 *15LPMEUx503x6072047x5 1w1acxw 10.2.174.85,10.46.235.120 "GET /plugins/servlet/prnfb/admin HTTP/1.0" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key plugin.page.repo.ci.sys.info.tab.tooltip and locales [en_US, en]

nenashev-ve avatar Jan 19 '21 09:01 nenashev-ve

It seems we found the reason: it's the context. Our system has an address https://my_url/stash @sreer-pega @sreer I would like to understand why it is removed contextPath in https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/7de2b9c500cbe8a30a57872acd3c72ad27cf932c Is it possible to return contextPath ?

nenashev-ve avatar Jan 19 '21 09:01 nenashev-ve

@nenashev-ve You could try getting back context path. However, let me add that during my testing the context-path was not available. I am not the owner of the code but a consumer of the plugin just like you. This is the code that worked for us with BB7. Hence I shared it to the main repository. You could go ahead and make the changes and try to run in your setup. If everything works you could create a PR.

sreer-pega avatar Jan 19 '21 10:01 sreer-pega

We've ran into the same issue. I did not find out how to re-add the contextPath as a variable, so ended up changing all this URL's to include the context as a fixed string. For example:

Old 4.1 release: var settingsAdminUrlPostUrl = contextPath + "/rest/prnfb-admin/1.0/settings";

Current 5.0 release: var settingsAdminUrlPostUrl = "/rest/prnfb-admin/1.0/settings";

My build of the plugin: var settingsAdminUrlPostUrl = "/bitbucket/rest/prnfb-admin/1.0/settings";

This is not a pull request worthy solution, but maybe it can help for you too @nenashev-ve ?

jhooyberghs avatar Feb 19 '21 11:02 jhooyberghs