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

Issue when triggering PR Notifier

Open stoleas opened this issue 8 years ago • 8 comments

Hi Thomas,

We are seeing this Java stack trace on a lot of repositories when PR's are "Opened":

2016-10-26 11:22:20,057 ERROR [ajp-nio-9001-exec-97] user1 *9MCSYx682x628530x4 1woafev 171.70.124.199 "GET /rest/prnfb-admin/1.0/settings/buttons/repository/91/pullrequest/1063 HTTP/1.1" c.a.p.r.c.e.j.ThrowableExceptionMapper Uncaught exception thrown by REST service: Repository is null
java.lang.NullPointerException: Repository is null
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226) ~[guava-18.0.jar:na]
        at com.atlassian.stash.internal.CommonValidations.validateRepository(CommonValidations.java:70) ~[bitbucket-service-impl-4.8.3.jar:na]
        at com.atlassian.stash.internal.user.PermissionServiceImpl.hasRepositoryPermission(PermissionServiceImpl.java:618) ~[bitbucket-service-impl-4.8.3.jar:na]
        at com.atlassian.stash.internal.user.PermissionServiceImpl.hasRepositoryPermission(PermissionServiceImpl.java:300) ~[bitbucket-service-impl-4.8.3.jar:na]
        at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) ~[atlassian-plugins-core-4.1.8.jar:na]
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        at se.bjurr.prnfb.service.UserCheckService.isAdmin(UserCheckService.java:79) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]
        at se.bjurr.prnfb.service.UserCheckService.isAdminAllowed(UserCheckService.java:134) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]
        at se.bjurr.prnfb.service.UserCheckService.isAllowedUseButton(UserCheckService.java:97) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]
        at se.bjurr.prnfb.service.ButtonsService.doGetButtons(ButtonsService.java:118) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]
        at se.bjurr.prnfb.service.ButtonsService.getButtons(ButtonsService.java:54) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]
        at se.bjurr.prnfb.presentation.ButtonServlet.get(ButtonServlet.java:101) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1469663356000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1469663356000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1469663356000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1469663356000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.2_1469663356000.jar:na]
        at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
        at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [classes/:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [classes/:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [classes/:na]
        at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) [atlassian-trusted-apps-core-4.2.0.jar:na]
        at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) [atlassian-oauth-service-provider-plugin-2.0.3_1469663358000.jar:na]
        at com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21) [atlassian-core-4.6.19.jar:na]
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) [atlassian-core-4.6.19.jar:na]
        at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
        at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) [jwt-plugin-1.5.11-0002_1469663358000.jar:na]
        at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) [analytics-client-5.2.7_1469663356000.jar:na]
        at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) [analytics-client-5.2.7_1469663356000.jar:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [classes/:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [classes/:na]
        at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:83) ~[bitbucket-service-impl-4.8.3.jar:na]
        at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) ~[classes/:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_92]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_92]
        ... 264 frames trimmed

What happens is the call to the URL never gets made, however if the job is re-triggered through another state or via the button trigger the job will complete successfully without errors.

Wondering if you've seen this before.

We are running version 2.34 of the plugins with 4.8.3 Bitbucket Datacenter.

Thanks

stoleas avatar Oct 26 '16 19:10 stoleas

This line:

        at se.bjurr.prnfb.presentation.ButtonServlet.get(ButtonServlet.java:101) ~[plugin.8623394022764929865.pull-request-notifier-for-bitbucket-2.34_1470771116000.jar:na]

Shows that the stacktrace is from a request made to the plugins rest api. The endpoint should respond with buttons available for the user on a specific repo and pull request. And the request probably happens before the PR is created. That should have the effect that the buttons are not shown in the PR. If the page is refreshed, they are probably shown.

But that does not sound like the problem you describe. There might be another stacktrace in the logs?

tomasbjerre avatar Oct 26 '16 19:10 tomasbjerre

Hi Tomas,

I looked into this more it's not blocking the URL payload from happening. We are seeing another issue that I don't think is related to this at all. I'm not sure if we are seeing any side effects from this stack trace but perhaps it's still something you'd like to know about. You can close this issue or keep it open if you'd like.

Thanks, Ed

stoleas avatar Oct 26 '16 21:10 stoleas

Ok. Yes the stacktrace is interesting. I'll try to get rid of that.

Den 26 okt. 2016 23:18 skrev "edquail" [email protected]:

Hi Tomas, I looked into this more it's not blocking the URL payload from happening. We are seeing another issue that I don't think is related to this at all. I'm not sure if we are seeing any side effects from this stack trace but perhaps it's still something you'd like to know about. You can close this issue or keep it open if you'd like.

Thanks, Ed

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/150#issuecomment-256479892, or mute the thread https://github.com/notifications/unsubscribe-auth/AAa1EwAMGn_li6pPYbUxJbTje5gUer61ks5q38OIgaJpZM4KhkXG .

tomasbjerre avatar Oct 27 '16 15:10 tomasbjerre

Our user is producing the same error. Only they are unable to see the buttons in an already opened pull request, even after relaunching the browser and clearing cache. User is a project admin and buttons are set to 'Everyone' visibility. I am a system admin and can see the buttons in the pull request without producing an error.

Bitbucket Server: 4.11.1 Pull request notifier: 2.38

2016-11-29 13:28:11,103 ERROR [http-nio-7990-exec-27] user @13Z92OPx808x9047x0 1nw0fs5 xx.xx.xx.xx "GET /rest/prnfb-admin/1.0/settings/buttons/repository/57/pullrequest/52 HTTP/1.1" c.a.p.r.c.e.j.ThrowableExceptionMapper Uncaught exception thrown by REST service: Repository is null                                                                                                            
java.lang.NullPointerException: Repository is null                                                                                                                                                   
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226) ~[guava-18.0.jar:na]                                                                                            
        at com.atlassian.stash.internal.CommonValidations.validateRepository(CommonValidations.java:70) ~[bitbucket-service-impl-4.11.1.jar:na]                                                      
        at com.atlassian.stash.internal.user.PermissionServiceImpl.hasRepositoryPermission(PermissionServiceImpl.java:618) ~[bitbucket-service-impl-4.11.1.jar:na]
        at com.atlassian.stash.internal.user.PermissionServiceImpl.hasRepositoryPermission(PermissionServiceImpl.java:300) ~[bitbucket-service-impl-4.11.1.jar:na]
        at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) ~[atlassian-plugins-core-4.2.4.jar:na]
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) ~[na:na]
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) ~[na:na]
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) ~[na:na]
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) ~[na:na]
        at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) ~[na:na]
        at se.bjurr.prnfb.service.UserCheckService.isAdmin(UserCheckService.java:79) ~[plugin_8703573400498210721_pull-request-notifier-for-bitbucket-2.38_1479265492000.jar:na]
        at se.bjurr.prnfb.service.UserCheckService.isAdminAllowed(UserCheckService.java:134) ~[plugin_8703573400498210721_pull-request-notifier-for-bitbucket-2.38_1479265492000.jar:na]
        at se.bjurr.prnfb.service.UserCheckService.isAllowedUseButton(UserCheckService.java:97) ~[plugin_8703573400498210721_pull-request-notifier-for-bitbucket-2.38_1479265492000.jar:na]
        at se.bjurr.prnfb.service.ButtonsService.doGetButtons(ButtonsService.java:95) ~[plugin_8703573400498210721_pull-request-notifier-for-bitbucket-2.38_1479265492000.jar:na]
        at se.bjurr.prnfb.service.ButtonsService.getButtons(ButtonsService.java:54) ~[plugin_8703573400498210721_pull-request-notifier-for-bitbucket-2.38_1479265492000.jar:na]
        at se.bjurr.prnfb.presentation.ButtonServlet.get(ButtonServlet.java:102) ~[plugin_8703573400498210721_pull-request-notifier-for-bitbucket-2.38_1479265492000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.4_1479334904000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.4_1479334904000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.4_1479334904000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.4_1479334904000.jar:na]
        at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [applinks-plugin-5.2.4_1479334904000.jar:na]
        at com.atlassian.analytics.client.filter.UniversalAnalyticsFilter.doFilter(UniversalAnalyticsFilter.java:92) [analytics-client-5.2.20_1479338804000.jar:na]
        at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) [analytics-client-5.2.20_1479338804000.jar:na]
        at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:81) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
        at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [classes/:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [classes/:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [classes/:na]
        at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94) [atlassian-trusted-apps-core-4.2.0.jar:na]
        at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67) [atlassian-oauth-service-provider-plugin-2.0.3_1479338806000.jar:na]
        at com.atlassian.core.filters.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:21) [atlassian-core-4.6.19.jar:na]
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) [atlassian-core-4.6.19.jar:na]
        at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109) [atlassian-connect-plugin-1.1.86-bitbucket-04.jar:na]
        at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32) [jwt-plugin-1.5.11-0002_1479338804000.jar:na]
        at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38) [analytics-client-5.2.20_1479338804000.jar:na]
        at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39) [analytics-client-5.2.20_1479338804000.jar:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [classes/:na]
        at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [classes/:na]
        at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:86) ~[bitbucket-service-impl-4.11.1.jar:na]
        at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:355) ~[hazelcast-wm-3.5.2-atlassian-37.jar:3.5.2-atlassian-37]
        at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:36) ~[classes/:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_112]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_112]
        ... 268 frames trimmed

ar613 avatar Nov 29 '16 18:11 ar613

The problem you, ar613 , refer to should have been fixed in in 2.40.

tomasbjerre avatar Nov 29 '16 18:11 tomasbjerre

Ok updated to 2.41 and now the buttons appear. I see the following log though. User says they deleted 'test_repo1'.

2016-11-29 14:07:40,390 ERROR [http-nio-7990-exec-29] user @13Z92OPx847x9658x0 psck8w 10.128.58.62 "GET /rest/prnfb-admin/1.0/settings/buttons/repository/57/pullrequest/52 HTTP/1.1" s.b.prnfb.service.UserCheckService Button with project UR_THWD_NGM and repo test_repo1 configured. But no such repo exists!

ar613 avatar Nov 29 '16 19:11 ar613

You can delete that button from the global admin page. Or just ignore the log message.

What code do you refer to? There is currently no unreleased code.

tomasbjerre avatar Nov 29 '16 19:11 tomasbjerre

Got it, thank you.

ar613 avatar Nov 29 '16 19:11 ar613