Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error forwarding Bitbucket Cloud to Internal Jenkins #116

Open
jherman opened this issue Apr 26, 2019 · 16 comments

Comments

@jherman
Copy link

commented Apr 26, 2019

Anyone seen this issue?

{ Error: Internal Server Error
    at Request.callback (/home/docker/.nvm/v10.15.3/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:706:15)
    at Stream.parser (/home/docker/.nvm/v10.15.3/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:916:18)
    at Stream.emit (events.js:189:13)
    at Unzip.unzip.on (/home/docker/.nvm/v10.15.3/lib/node_modules/smee-client/node_modules/superagent/lib/node/unzip.js:55:12)
    at Unzip.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  status: 500,
  response:
   Response {
     _events: [Object: null prototype] {},
     _eventsCount: 0,
     _maxListeners: undefined,
     res:
      IncomingMessage {
        _readableState: [ReadableState],
        readable: false,
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        socket: [TLSSocket],
        connection: [TLSSocket],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Array],
        trailers: {},
        rawTrailers: [],
        aborted: false,
        upgrade: false,
        url: '',
        method: null,
        statusCode: 500,
        statusMessage: 'Server Error',
        client: [TLSSocket],
        _consuming: false,
        _dumped: false,
        req: [ClientRequest],
        setEncoding: [Function],
        on: [Function],
        text:
         '\n\n\n\n\n  \n  <!DOCTYPE html><html><head resURL="/static/d20d011a" data-rooturl="" data-resurl="/static/d20d011a">\n    \n\n    <title>Jenkins [Jenkins]</title><link rel="stylesheet" href="/static/d20d011a/css/layout-common.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/css/style.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/css/color.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/css/responsive-grid.css" type="text/css" /><link rel="shortcut icon" href="/static/d20d011a/favicon.ico" type="image/vnd.microsoft.icon" /><link color="black" rel="mask-icon" href="/images/mask-icon.svg" /><script>var isRunAsTest=false; var rootURL=""; var resURL="/static/d20d011a";</script><script src="/static/d20d011a/scripts/prototype.js" type="text/javascript"></script><script src="/static/d20d011a/scripts/behavior.js" type="text/javascript"></script><script src=\'/adjuncts/d20d011a/org/kohsuke/stapler/bind.js\' type=\'text/javascript\'></script><script src="/static/d20d011a/scripts/yui/yahoo/yahoo-min.js"></script><script src="/static/d20d011a/scripts/yui/dom/dom-min.js"></script><script src="/static/d20d011a/scripts/yui/event/event-min.js"></script><script src="/static/d20d011a/scripts/yui/animation/animation-min.js"></script><script src="/static/d20d011a/scripts/yui/dragdrop/dragdrop-min.js"></script><script src="/static/d20d011a/scripts/yui/container/container-min.js"></script><script src="/static/d20d011a/scripts/yui/connection/connection-min.js"></script><script src="/static/d20d011a/scripts/yui/datasource/datasource-min.js"></script><script src="/static/d20d011a/scripts/yui/autocomplete/autocomplete-min.js"></script><script src="/static/d20d011a/scripts/yui/menu/menu-min.js"></script><script src="/static/d20d011a/scripts/yui/element/element-min.js"></script><script src="/static/d20d011a/scripts/yui/button/button-min.js"></script><script src="/static/d20d011a/scripts/yui/storage/storage-min.js"></script><script src="/static/d20d011a/scripts/hudson-behavior.js" type="text/javascript"></script><script src="/static/d20d011a/scripts/sortable.js" type="text/javascript"></script><script>crumb.init("Jenkins-Crumb", "96c421a9852134a21add1909bc1981db");</script><link rel="stylesheet" href="/static/d20d011a/scripts/yui/container/assets/container.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/scripts/yui/assets/skins/sam/skin.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/scripts/yui/container/assets/skins/sam/container.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/scripts/yui/button/assets/skins/sam/button.css" type="text/css" /><link rel="stylesheet" href="/static/d20d011a/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" /><meta name="ROBOTS" content="INDEX,NOFOLLOW" /><meta name="viewport" content="width=device-width, initial-scale=1" /><script src="/static/d20d011a/jsbundles/page-init.js" type="text/javascript"></script></head><body data-model-type="hudson.model.Hudson" id="jenkins" class="yui-skin-sam two-column jenkins-2.164.2" data-version="2.164.2"><a href="#skip2content" class="skiplink">Skip to content</a><div id="page-head"><div id="header"><div class="logo"><a id="jenkins-home-link" href="/"><img src="/static/d20d011a/images/headshot.png" alt="[Jenkins]" id="jenkins-head-icon" /><img src="/static/d20d011a/images/title.png" alt="Jenkins" width="139" id="jenkins-name-icon" height="34" /></a></div><div class="login"> <a href="/login?from=%2Fbitbucket-hook%2F"><b>log in</b></a></div><div class="searchbox hidden-xs"><form role="search" method="get" name="search" action="/search/" style="position:relative;" class="no-json"><div id="search-box-minWidth"></div><div id="search-box-sizer"></div><div id="searchform"><input role="searchbox" name="q" placeholder="search" id="search-box" class="has-default-text" /> <a href="https://jenkins.io/redirect/search-box"><img src="/static/d20d011a/images/16x16/help.png" style="width: 16px; height: 16px; " class="icon-help icon-sm" /></a><div id="search-box-completion"></div><script>createSearchBox("/search/");</script></div></form></div></div><div id="breadcrumbBar"><tr id="top-nav"><td id="left-top-nav" colspan="2"><link rel=\'stylesheet\' href=\'/adjuncts/d20d011a/lib/layout/breadcrumbs.css\' type=\'text/css\' /><script src=\'/adjuncts/d20d011a/lib/layout/breadcrumbs.js\' type=\'text/javascript\'></script><div class="top-sticker noedge"><div class="top-sticker-inner"><div id="right-top-nav"></div><ul id="breadcrumbs"><li class="item"><a href="/" class="model-link inside">Jenkins</a></li><li href="/" class="children"></li></ul><div id="breadcrumb-menu-target"></div></div></div></td></tr></div></div><div id="page-body" class="clear"><div id="side-panel"><div class="task"><a href="https://jenkins.io/" class="task-icon-link"><img src="/static/d20d011a/images/24x24/next.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-next icon-md" /></a> <a href="https://jenkins.io/" class="task-link">Jenkins project</a></div><div class="task"><a href="https://jenkins.io/redirect/report-an-issue" class="task-icon-link"><img src="/static/d20d011a/images/24x24/gear2.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-gear2 icon-md" /></a> <a href="https://jenkins.io/redirect/report-an-issue" class="task-link">Bug tracker</a></div><div class="task"><a href="https://jenkins.io/redirect/mailing-lists" class="task-icon-link"><img src="/static/d20d011a/images/24x24/search.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-search icon-md" /></a> <a href="https://jenkins.io/redirect/mailing-lists" class="task-link">Mailing Lists</a></div><div class="task"><a href="https://twitter.com/jenkinsci" class="task-icon-link"><img src="/static/d20d011a/images/24x24/user.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-user icon-md" /></a> <a href="https://twitter.com/jenkinsci" class="task-link">Twitter: @jenkinsci</a></div></div><div id="main-panel"><a name="skip2content"></a><h1 style="text-align: center"><img src="/static/d20d011a/images/rage.png" width="154" height="179" /><span style="font-size:50px"> Oops!</span></h1><div id="error-description"><p>A problem occurred while processing the request.\n        Please check <a href="https://jenkins.io/redirect/issue-tracker">our bug tracker</a> to see if a similar problem has already been reported.\n        If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem.\n        If you think this is a new issue, please file a new issue.\n        When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins.\n        <a href="https://jenkins.io/redirect/users-mailing-list">The users list</a> might be also useful in understanding what has happened.</p><h2>Stack trace</h2><pre style="margin:2em; clear:both">Also:   java.lang.Throwable: HttpInput failure\n\t\tat org.eclipse.jetty.server.HttpInput.failed(HttpInput.java:826)\n\t\tat org.eclipse.jetty.server.HttpConnection$BlockingReadCallback.failed(HttpConnection.java:649)\n\t\tat org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:138)\n\t\tat org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillableFail(SslConnection.java:451)\n\t\tat org.eclipse.jetty.io.ssl.SslConnection.onFillInterestedFailed(SslConnection.java:314)\n\t\tat org.eclipse.jetty.io.ssl.SslConnection$2.failed(SslConnection.java:165)\n\t\tat org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:138)\n\t\tat org.eclipse.jetty.io.AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:406)\njava.util.concurrent.TimeoutException: Idle timeout expired: 5000/5000 ms\n\tat org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)\n\tat org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\nCaused: java.io.IOException\n\tat org.eclipse.jetty.server.HttpInput$ErrorState.noContent(HttpInput.java:1080)\n\tat org.eclipse.jetty.server.HttpInput.read(HttpInput.java:313)\n\tat sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)\n\tat sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)\n\tat sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)\n\tat java.io.InputStreamReader.read(InputStreamReader.java:184)\n\tat java.io.Reader.read(Reader.java:140)\n\tat org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2537)\n\tat org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2516)\n\tat org.apache.commons.io.IOUtils.copy(IOUtils.java:2493)\n\tat org.apache.commons.io.IOUtils.copy(IOUtils.java:2441)\n\tat org.apache.commons.io.IOUtils.toString(IOUtils.java:1084)\n\tat org.apache.commons.io.IOUtils.toString(IOUtils.java:1064)\n\tat io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRHookReceiver.doIndex(BitBucketPPRHookReceiver.java:79)\n\tat java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)\n\tat org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)\n\tat org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)\n\tat org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)\n\tat org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)\n\tat org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:27)\n\tat org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)\n\tat org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:458)\n\tat org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)\n\tat org.kohsuke.stapler.Stapler.service(Stapler.java:238)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)\n\tat org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:243)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)\n\tat io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRCrumbExclusion.process(BitBucketPPRCrumbExclusion.java:47)\n\tat hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:73)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)\n\tat hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)\n\tat hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)\n\tat hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)\n\tat hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)\n\tat hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)\n\tat org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)\n\tat hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)\n\tat org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:503)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\n\tat org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:411)\n\tat org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:305)\n\tat org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:159)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)\n\tat java.lang.Thread.run(Thread.java:748)\n</pre></div></div></div><footer><div class="container-fluid"><div class="row"><div class="col-md-6" id="footer"></div><div class="col-md-18"><span class="page_generated">Page generated: Apr 26, 2019 7:02:52 PM UTC</span><span class="rest_api"><a href="api/">REST API</a></span><span class="jenkins_ver"><a href="https://jenkins.io/">Jenkins ver. 2.164.2</a></span></div></div></div></footer></body></html>' },

I'm currently running smee on Centos 7:
smee --url https://smee.io/XXXXXXXXXXXXXX --target https://X.X.X.X/bitbucket-hook/

I logged the call from Bitbucket, and reproduced the POST call using just CURL locally, and it started the job just fine. So it appears Bitbucket is fine and Jenkins is fine. I'm not sure what smee-client doesn't like here.

Any advice?

@issue-label-bot

This comment has been minimized.

Copy link

commented Apr 26, 2019

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.85. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug label Apr 26, 2019

@mgust

This comment has been minimized.

Copy link

commented May 3, 2019

I noted the issue, and it appears this happens on Github when the Content Type of the hook is set to application/x-www-form-urlencoded. It appears to assume that the body is JSON encoded.

(Jenkins appears to throw the java.lang.Throwable: HttpInput idle timeout exception when there is no body in the message sent to github-webhook).

@jherman

This comment has been minimized.

Copy link
Author

commented May 3, 2019

@mgust Just a heads up, that this was for BitBucket. Maybe it's the same issue?

@yrsurya

This comment has been minimized.

Copy link

commented May 3, 2019

Any update on this issue

@mgust

This comment has been minimized.

Copy link

commented May 7, 2019

@mgust Just a heads up, that this was for BitBucket. Maybe it's the same issue?

Ah, missed that. I suspect it may be something similar though as the error basically just seemed to mean that Jenkins didn't get a body in the trigger.

at org.eclipse.jetty.server.HttpInput$ErrorState.noContent(HttpInput.java:1080) this part buried in the stacktrace appears to throw the TimeoutException to show there were no content.

So basically, the error is upstream. Either BitBucket isn't sending a body to Smee, or the format of the body it sends is malformed and can't be parsed.

@jherman

This comment has been minimized.

Copy link
Author

commented May 8, 2019

Actually I still believe it's smee that has an issue. I ended up using socketxp instead for relaying and it works well. I have to believe the issue lies with smee.

@nickwilley

This comment has been minimized.

Copy link

commented Jun 12, 2019

I was experiencing the same issue with Jenkins, GitHub, and smee. Changing the Content Type to 'application/json' on the GitHub webook configuration is what finally worked for me. As @mgust indicated, setting the webhook configuration to 'application/x-www-form-urlencoded' does not appear to provide the correct response for Jenkins. Not sure is BitBucket has a similar option.

@jherman

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

Yeah that may well be the issue and unfortunately Bitbucket doesn't let you switch content type. I also think this project has lost traction as it appears the owners haven't replied to anything in quite some time.

@yrsurya

This comment has been minimized.

Copy link

commented Jun 18, 2019

Is this repo is active?

@JasonEtco

This comment has been minimized.

Copy link
Member

commented Jun 18, 2019

@yrsurya yes, this just isn't a big problem.

Based on this comment from @mgust, it looks like this is due to passing non-JSON data to smee-client. Whether or not some other client works with the same payload (see this comment) isn't super relevant - kind of just confirms that smee-client doesn't support application/x-www-form-urlencoded payloads.

So, I'd say we have two options:

  1. A PR to support application/x-www-form-urlencoded.
  2. Tell BitBucket support that they should really support this and wait until they implement it.

If any of y'all want to open a PR, happy to review it. Should just be some additions here:

const data = JSON.parse(msg.data)

And here (so two PRs to the different repos):

https://github.com/probot/smee.io/blob/2df8ab37683812fefe01d8a67c8af74ef12db057/server.js#L32

GitHub
☁️📦 Webhook payload delivery service. Contribute to probot/smee.io development by creating an account on GitHub.
@yrsurya

This comment has been minimized.

Copy link

commented Jun 19, 2019

I am following this blog to setup smee client https://jenkins.io/blog/2019/01/07/webhook-firewalls/

But it didn’t work

Triggering builds with webhooks behind a secure firewall
Jenkins – an open source automation server which enables developers around the world to reliably build, test, and deploy their software
@yrsurya

This comment has been minimized.

Copy link

commented Jun 23, 2019

Actually I still believe it's smee that has an issue. I ended up using socketxp instead for relaying and it works well. I have to believe the issue lies with smee.

Can I know how you configured socketxp to receive webhooks from bitbucket cloud to internal jenkins as I am also facing same 500 error issue while using sme where it is working for github

@thirstybear

This comment has been minimized.

Copy link

commented Jun 26, 2019

Having the same issue with BitBucket.

BitBucket is claiming to be sending Content-Type application/json. I'll have more of a poke around and report back here.

Screenshot 2019-06-26 at 11 18 13

@JamesMc86

This comment has been minimized.

Copy link

commented Jul 18, 2019

Had a poke in the client code and captured some wireshark traces to check what was being sent to jenkins.

The problem is that for some reason (not sure why exactly) the content-length is wrong. When I prevent the content length from being added to the request it appears to work. Need to do more testing and can complete a pull request then.

@ally13nella

This comment has been minimized.

Copy link

commented Jul 21, 2019

Ok

@yrsurya

This comment has been minimized.

Copy link

commented Aug 13, 2019

Hi, any update on this issue? please let us know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.