Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

unable to trigger build using bitbucket and jenkins #300

Closed
keshav-12 opened this issue Sep 7, 2018 · 2 comments
Closed

unable to trigger build using bitbucket and jenkins #300

keshav-12 opened this issue Sep 7, 2018 · 2 comments

Comments

@keshav-12
Copy link

keshav-12 commented Sep 7, 2018

We don’t have admin rights so not able to capture enough information. Tried to capture information as much as possible. Please let me know if any other information I can provide. We followed your blog and configured all parameters similar to that. when we created PR in bitbucket, when we click button which we created from blog (Eg: Deploy, Test etc), we are getting "500" error.

URL which we are configuring : http://jenkinsip:8080/job/Pull%20Request%20Builder/buildWithParameters?${EVERYTHING_URL}

We are completely clueless what might be the issue. Please help us in this regard if there are any possible common mistakes.

  • Plugin version used : 3.22

  • Bitbucket Server version used : v 5.8.1

  • Stack traces in Bitbucket Server log file
    018-09-11 15:13:15,986 WARN [http-nio-7990-exec-8] lsadmin @2UZQ5Mx913x7418x0 1jp6euz 10.90.206.56 "POST /rest/prnfb-admin/1.0/settings/buttons/2bc004df-8fa0-4e56-8e8a-493e878ef91a/press/repository/9/pullrequest/6 HTTP/1.1" c.s.j.s.c.servlet.WebComponent A servlet request, to the URI http://10.90.207.225:7990/rest/prnfb-admin/1.0/settings/buttons/2bc004df-8fa0-4e56-8e8a-493e878ef91a/press/repository/9/pullrequest/6, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.

2018-09-11 15:13:15,992 ERROR [http-nio-7990-exec-8] lsadmin @2UZQ5Mx913x7418x0 1jp6euz 10.90.206.56 "POST /rest/prnfb-admin/1.0/settings/buttons/2bc004df-8fa0-4e56-8e8a-493e878ef91a/press/repository/9/pullrequest/6 HTTP/1.1" c.a.p.r.c.e.j.ThrowableExceptionMapper Uncaught exception thrown by REST service: Header value must be set

java.lang.NullPointerException: Header value must be set

           at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226)

           at se.bjurr.prnfb.settings.PrnfbHeader.<init>(PrnfbHeader.java:14)

           at se.bjurr.prnfb.http.UrlInvoker.withHeader(UrlInvoker.java:231)

           at se.bjurr.prnfb.listener.PrnfbPullRequestEventListener.notify(PrnfbPullRequestEventListener.java:320)

           at se.bjurr.prnfb.service.ButtonsService.doHandlePressed(ButtonsService.java:108)

           at se.bjurr.prnfb.service.ButtonsService.handlePressed(ButtonsService.java:160)

           at se.bjurr.prnfb.presentation.ButtonServlet.press(ButtonServlet.java:179)

           at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)

           at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)

           at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)

           at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)

           at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)

           at com.atlassian.analytics.client.filter.UniversalAnalyticsFilter.doFilter(UniversalAnalyticsFilter.java:92)

           at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)

           at com.atlassian.bitbucket.internal.xcode.web.XcodeUserAgentFilter.doFilter(XcodeUserAgentFilter.java:36)

           at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)

           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.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:32)

           at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:38)

           at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)

           at com.atlassian.bitbucket.internal.scm.git.lfs.servlet.filter.GitLfsLockingFilter.doFilter(GitLfsLockingFilter.java:50)

           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:89)

           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)

           ... 246 frames trimmed
  • Any browser console log messages, you can find it in Developer Tools in Chome by pressing F12.

user-activity-xhr-header.js?_statichash=d520affd01d65b23d4e37a17154abb22-T%2F-363926918%2F97921f3%2F700%2F0b31022ea59d009ff21b2455d08b3410&locale=en-US&nps-not-opted-out=true:1 POST https://bitbucket.xxxx.com/rest/prnfb-admin/1.0/settings/buttons/415f5d1d-368b-4d5a-aec3-43205f655d14/press/repository/430/pullrequest/96 500 ()

XMLHttpRequest.send @ user-activity-xhr-header.js?_statichash=d520affd01d65b23d4e37a17154abb22-T%2F-363926918%2F97921f3%2F700%2F0b31022ea59d009ff21b2455d08b3410&locale=en-US&nps-not-opted-out=true:1

send @ jquery.js?_statichash=0ff565774d12c4a12f6e6a6467609179-CDN%2F-363926918%2F97921f3%2F700%2F1b615eee93091f36273c8450f7d72556&locale=en-US:4

ajax @ jquery.js?_statichash=0ff565774d12c4a12f6e6a6467609179-CDN%2F-363926918%2F97921f3%2F700%2F1b615eee93091f36273c8450f7d72556&locale=en-US:4

y @ pr-triggerbutton.js?_statichash=d520affd01d65b23d4e37a17154abb22-T%2F-363926918%2F97921f3%2F700%2F0b31022ea59d009ff21b2455d08b3410&locale=en-US&nps-not-opted-out=true:1

(anonymous) @ pr-triggerbutton.js?_statichash=d520affd01d65b23d4e37a17154abb22-T%2F-363926918%2F97921f3%2F700%2F0b31022ea59d009ff21b2455d08b3410&locale=en-US&nps-not-opted-out=true:1

dispatch @ jquery.js?_statichash=0ff565774d12c4a12f6e6a6467609179-CDN%2F-363926918%2F97921f3%2F700%2F1b615eee93091f36273c8450f7d72556&locale=en-US:3

r.handle @ jquery.js?_statichash=0ff565774d12c4a12f6e6a6467609179-CDN%2F-363926918%2F97921f3%2F700%2F1b615eee93091f36273c8450f7d72556&locale=en-US:3

http://localhost:8080/bitbucket/rest/prnfb-admin/1.0/settings

{"adminRestriction":"ADMIN","keyStorePassword":"KEEP_THIS_TO_LEAVE_UNCHANGED","keyStoreType":"","shouldAcceptAnyCertificate":true}

http://localhost:8080/bitbucket/rest/prnfb-admin/1.0/settings/buttons

[{"buttonFormList":[],"buttonFormListString":"[]","confirmation":"on","name":"Deploy","projectKey":"LS","repositorySlug":"test_repo","userLevel":"EVERYONE","uuid":"415f5d1d-368b-4d5a-aec3-43205f655d14"},{"buttonFormList":[],"buttonFormListString":"[]","confirmation":"on","name":"Test","projectKey":"LS","repositorySlug":"test_repo","userLevel":"EVERYONE","uuid":"c63489d1-3e8c-47e2-ba92-26a653dcb338"}]

http://localhost:8080/bitbucket/rest/prnfb-admin/1.0/settings/notifications

[{"filterRegexp":"Deploy*","filterString":"${BUTTON_TRIGGER_TITLE}","headers":[{"name":"Jenkins-Crumb","value":"${INJECTION_URL_VALUE}"}],"method":"POST","name":"Deploy","password":"KEEP_THIS_TO_LEAVE_UNCHANGED","projectKey":"LS","proxyPassword":"KEEP_THIS_TO_LEAVE_UNCHANGED","proxySchema":"http","proxyUser":"KEEP_THIS_TO_LEAVE_UNCHANGED","repositorySlug":"test_repo","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":[],"triggers":["OPENED","BUTTON_TRIGGER"],"updatePullRequestRefs":false,"url":"http://10.89.236.150:8080/job/Pull%20Request%20Builder/buildWithParameters?${EVERYTHING_URL}","user":"KEEP_THIS_TO_LEAVE_UNCHANGED","uuid":"89e1b15b-0b44-45c5-8095-72e4bcc19a38","postContentEncoding":"NONE"},{"filterRegexp":"Test","filterString":"${BUTTON_TRIGGER_TITLE}","headers":[],"method":"POST","name":"PR","password":"KEEP_THIS_TO_LEAVE_UNCHANGED","projectKey":"LS","proxyPassword":"KEEP_THIS_TO_LEAVE_UNCHANGED","proxySchema":"http","proxyUser":"KEEP_THIS_TO_LEAVE_UNCHANGED","repositorySlug":"test_repo","triggerIfCanMerge":"ALWAYS","triggerIgnoreStateList":["MERGED"],"triggers":["OPENED","BUTTON_TRIGGER"],"updatePullRequestRefs":false,"url":"http://10.89.236.150:8080/job/liquidsecurity/job/kbirla%252FJ/build?delay=0sec","user":"KEEP_THIS_TO_LEAVE_UNCHANGED","uuid":"89b30517-915f-4a01-a1e9-299791129134","postContentEncoding":"NONE","httpVersion":"HTTP_1_0"}]

@tomasbjerre
Copy link
Owner

It is the ${INJECTION_URL_VALUE} that you have configured that evaluates to an empty string. You are using it as a header value in a notification.

@albertvalles2-zz
Copy link

albertvalles2-zz commented Mar 7, 2019

Hi, might be this error linked to this issue too? tried reenabling without luck. network tab shows nothing. Any other ideas? thanks

image
image
image
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants