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 · 29 comments
Open

Error forwarding Bitbucket Cloud to Internal Jenkins #116

jherman opened this issue Apr 26, 2019 · 29 comments
Labels

Comments

@jherman
Copy link

jherman 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
Copy link

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
Copy link

mgust 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
Copy link
Author

jherman commented May 3, 2019

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

@yrsurya
Copy link

yrsurya commented May 3, 2019

Any update on this issue

@mgust
Copy link

mgust 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
Copy link
Author

jherman 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
Copy link

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
Copy link
Author

jherman 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
Copy link

yrsurya commented Jun 18, 2019

Is this repo is active?

@JasonEtco
Copy link
Member

JasonEtco 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
Copy link

yrsurya 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
Copy link

yrsurya 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
Copy link

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
Copy link

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
Copy link

Ok

@yrsurya
Copy link

yrsurya commented Aug 13, 2019

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

@yrsurya
Copy link

yrsurya commented Oct 2, 2019

Hi Any update on this issue, it would be very helpful if we can get it working for Bitbucket.

@stale
Copy link

stale bot commented Dec 31, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the wontfix label Dec 31, 2019
@oveits
Copy link

oveits commented Jan 4, 2020

I am hitting the same problem. I have compared a tcpdump trace of a direct connection from Bitbucket to my Jenkins (works) with the one between smee client to Jenkins.

The original POST looks like follows:

POST /bitbucket-scmsource-hook/notify/ HTTP/1.1
Host: <removed>
X-Real-IP: <removed>
X-Forwarded-For: <removed>
X-Forwarded-Host: jenkins<removed>
X-Forwarded-Port: 443
X-Forwarded-Proto: https
Connection: close
Content-Length: 7548
User-Agent: Bitbucket-Webhooks/2.0
Accept-Encoding: gzip, deflate
Accept: */*
Content-Type: application/json
X-Hook-UUID: <removed>
X-Event-Key: repo:push
X-Event-Time: Sat, 04 Jan 2020 17:07:36 GMT
X-Request-UUID: <removed>
X-Attempt-Number: 1

{"push": {"changes": [{"forced": false, "old": {"name": "feature/CAAS-2_hetzner-cloud-api-via-curl", "links": {"commits":

The packet coming from the smee client looks like follows:

POST /bitbucket-scmsource-hook/notify/ HTTP/1.1
host: smee.io
accept-encoding: gzip, deflate
user-agent: Bitbucket-Webhooks/2.0
content-type: application/json
connection: close
accept: */*
x-hook-uuid: <removed>
x-event-key: repo:push
x-event-time: Sat, 04 Jan 2020 17:19:01 GMT
x-request-uuid: <removed>
x-attempt-number: 1
x-request-id: 39efe3ca-de29-4299-a281-3f81bff2ccfa
x-forwarded-for: <removed>
x-forwarded-proto: https
x-forwarded-port: 443
via: 1.1 vegur
connect-time: 0
x-request-start: 1578158342399
total-route-time: 0
content-length: 7548
timestamp: 1578158342403

{"push":{"changes":[{"forced":false,"old":{"name":"feature/CAAS-2_hetzner-cloud-api-via-curl","links":{"commits":{"href":

I have noticed that the spaces behind : and , are missing in the POST sent by the smee client. However, both are reporting the same length:
Content-Length: 7548

It seems like the content-length of the packet sent by the smee client is wrong. Is it just copied from the input packet? If I have seen it correctly from the source, the content is interpreted by a JSON slurper and it is re-built before being sent out. If so, I guess, the length should be re-calculated.

I am not sure, whether a correct content-length will solve the issue, though. Maybe we also should add the spaces? However, https://jsonformatter.curiousconcept.com/ tells me that the smee client has sent a valid JSON, so Jenkins should be able to cope with it.

@stale stale bot removed the wontfix label Jan 4, 2020
@oveits
Copy link

oveits commented Jan 4, 2020

This is probably not a smee client issue, but an issue of smee.io. See probot/smee.io#5.

@stale
Copy link

stale bot commented Apr 3, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@rnkhouse
Copy link

I am getting the same error:

Error: cannot POST /bitbucket-scmsource-hook/notify/ (500)
      at Response.toError (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/response.js:94:15)
      at ResponseBase._setStatusProperties (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/response-base.js:123:16)
      at new Response (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/response.js:41:8)
      at Request._emitResponse (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:752:20)
      at Stream.parser (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:916:38)
      at Stream.emit (events.js:189:13)
      at Unzip.unzip.on (/usr/local/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:1103:12)
      at process._tickCallback (internal/process/next_tick.js:63:19)
    status: 500,
    text:
     '\n  \n  <!DOCTYPE html><html class=""><head resURL="/static/7d1612bd" data-rooturl="" data-resurl="/static/7d1612bd">\n    \n    \n\n    <title>Jenkins [Jenkins]</title><link rel="stylesheet" href="/static/7d1612bd/jsbundles/base-styles-v2.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/css/color.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/css/responsive-grid.css" type="text/css"><link rel="shortcut icon" href="/static/7d1612bd/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/7d1612bd";</script><script src="/static/7d1612bd/scripts/prototype.js" type="text/javascript"></script><script src="/static/7d1612bd/scripts/behavior.js" type="text/javascript"></script><script src=\'/adjuncts/7d1612bd/org/kohsuke/stapler/bind.js\' type=\'text/javascript\'></script><script src="/static/7d1612bd/scripts/yui/yahoo/yahoo-min.js"></script><script src="/static/7d1612bd/scripts/yui/dom/dom-min.js"></script><script src="/static/7d1612bd/scripts/yui/event/event-min.js"></script><script src="/static/7d1612bd/scripts/yui/animation/animation-min.js"></script><script src="/static/7d1612bd/scripts/yui/dragdrop/dragdrop-min.js"></script><script src="/static/7d1612bd/scripts/yui/container/container-min.js"></script><script src="/static/7d1612bd/scripts/yui/connection/connection-min.js"></script><script src="/static/7d1612bd/scripts/yui/datasource/datasource-min.js"></script><script src="/static/7d1612bd/scripts/yui/autocomplete/autocomplete-min.js"></script><script src="/static/7d1612bd/scripts/yui/menu/menu-min.js"></script><script src="/static/7d1612bd/scripts/yui/element/element-min.js"></script><script src="/static/7d1612bd/scripts/yui/button/button-min.js"></script><script src="/static/7d1612bd/scripts/yui/storage/storage-min.js"></script><script src="/static/7d1612bd/scripts/hudson-behavior.js" type="text/javascript"></script><script src="/static/7d1612bd/scripts/sortable.js" type="text/javascript"></script><script>crumb.init("Jenkins-Crumb", "829a9bec34d37a30b09b4a725b62f0cf8027d90029ac612cdd872d31e2b696ea");</script><link rel="stylesheet" href="/static/7d1612bd/scripts/yui/container/assets/container.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/scripts/yui/assets/skins/sam/skin.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/scripts/yui/container/assets/skins/sam/container.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/scripts/yui/button/assets/skins/sam/button.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/css/google-fonts/roboto/css/roboto.css" type="text/css"><link rel="stylesheet" href="/static/7d1612bd/jsbundles/ui-refresh-overrides.css" type="text/css"><meta name="ROBOTS" content="INDEX,NOFOLLOW"><meta name="viewport" content="width=device-width, initial-scale=1"><script src="/adjuncts/7d1612bd/org/kohsuke/stapler/jquery/jquery.full.js" type="text/javascript"></script><script>var Q=jQuery.noConflict()</script><script src="/static/7d1612bd/jsbundles/vendors.js" type="text/javascript"></script><script src="/static/7d1612bd/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.222.1" data-version="2.222.1"><a href="#skip2content" class="skiplink">Skip to content</a><div id="page-head"><header id="header" class="page-header"><div class="page-header__brand"><div class="logo"><a id="jenkins-home-link" href="/"><img src="/static/7d1612bd/images/jenkins-header-logo-v2.svg" alt="[Jenkins]" id="jenkins-head-icon"><img src="/static/7d1612bd/images/title.png" alt="Jenkins" width="139" id="jenkins-name-icon" height="34"></a></div><a href="/" class="page-header__brand-link"><img src="/static/7d1612bd/images/jenkins-header-logo-v2.svg" alt="[Jenkins]" class="page-header__brand-image"><span class="page-header__brand-name">Jenkins</span></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="main-search__input has-default-text"><span class="main-search__icon-leading"><svg viewBox="0 0 24 24" aria-hidden="" focusable="false" class="svg-icon "><use href="/static/7d1612bd/images/material-icons/svg-sprite-action-symbol.svg#ic_search_24px"></use></svg></span><a href="https://jenkins.io/redirect/search-box" class="main-search__icon-trailing"><svg viewBox="0 0 24 24" aria-hidden="" focusable="false" class="svg-icon "><use href="/static/7d1612bd/images/material-icons/svg-sprite-action-symbol.svg#ic_help_outline_24px"></use></svg></a><div id="search-box-completion"></div><script>createSearchBox("/search/");</script></div></form></div><div class="login page-header__hyperlinks"><div id="visible-am-insertion" class="page-header__am-wrapper"></div><a href="/loginEntry?from=%2Fbitbucket-scmsource-hook%2Fnotify%2F"><b>log in</b></a></div></header><div id="breadcrumbBar"><tr id="top-nav"><td id="left-top-nav" colspan="2"><link rel=\'stylesheet\' href=\'/adjuncts/7d1612bd/lib/layout/breadcrumbs.css\' type=\'text/css\' /><script src=\'/adjuncts/7d1612bd/lib/layout/breadcrumbs.js\' type=\'text/javascript\'></script><div class="top-sticker noedge"><div class="top-sticker-inner"><div class="breadcrumbs__wrapper"><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></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/7d1612bd/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/" title="Jenkins project" 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/7d1612bd/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" title="Bug tracker" 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/7d1612bd/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" title="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/7d1612bd/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" title="Twitter: @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/7d1612bd/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.<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:830)\n\t\tat org.eclipse.jetty.server.HttpConnection$BlockingReadCallback.failed(HttpConnection.java:659)\n\t\tat org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:138)\n\t\tat org.eclipse.jetty.io.AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:407)\njava.util.concurrent.TimeoutException: Idle timeout expired: 5000/5000 ms\n\tat org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:171)\n\tat org.eclipse.jetty.io.IdleTimeout.idleCheck(IdleTimeout.java:113)\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:1083)\n\tat org.eclipse.jetty.server.HttpInput.read(HttpInput.java:321)\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 com.cloudbees.jenkins.plugins.bitbucket.hooks.BitbucketSCMSourcePushHookReceiver.doNotify(BitbucketSCMSourcePushHookReceiver.java:80)\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.MetaClass$11.doDispatch(MetaClass.java:535)\n\tat org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)\n\tat org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)\n\tat org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:456)\n\tat org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)\n\tat org.kohsuke.stapler.Stapler.invoke(Stapler.java:676)\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:755)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)\n\tat org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)\n\tat hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)\n\tat jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)\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 com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)\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:1604)\n\tat com.cloudbees.jenkins.plugins.bitbucket.hooks.BitbucketSCMSourcePushHookReceiver.process(BitbucketSCMSourcePushHookReceiver.java:59)\n\tat hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:127)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\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:118)\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 hudson.security.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:118)\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:1604)\n\tat org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:500)\n\tat org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)\n\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)\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 23, 2020 3:49:25 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.222.1</a></span></div></div></div></footer><script async="true" src="/static/7d1612bd/scripts/svgxuse.min.js" type="text/javascript"></script></body></html>',
    method: 'POST',
    path: '/bitbucket-scmsource-hook/notify/'

@stale stale bot removed the wontfix label Apr 23, 2020
@danmoez
Copy link

danmoez commented May 27, 2020

Same error here, payload never made it to Jenkins.

error: Error: cannot POST /generic-webhook-trigger/invoke?token=MyToken (500)
        at Response.toError (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/response.js:94:15)
        at ResponseBase._setStatusProperties (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/response-base.js:123:16)
        at new Response (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/response.js:41:8)
        at Request._emitResponse (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:752:20)
        at /usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:916:38
        at Stream.<anonymous> (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/parsers/json.js:19:7)
        at Stream.emit (events.js:315:20)
        at Unzip.<anonymous> (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/unzip.js:55:12)
        at Unzip.emit (events.js:327:22)
        at endReadableNT (_stream_readable.js:1201:12) {
      status: 500,
      text: '',
      method: 'POST',
      path: '/generic-webhook-trigger/invoke?token=MyToken'
    },

@schowave
Copy link

schowave commented Jun 8, 2020

I have the same issue with bitbucket:

Error: Internal Server Error
at Request.callback (/snapshot/webhooks/node_modules/superagent/lib/node/index.js:706:15)
at Stream. (/snapshot/webhooks/node_modules/superagent/lib/node/index.js:916:18)
at Stream.emit (events.js:311:20)
at Stream.EventEmitter.emit (domain.js:482:12)
at Unzip. (/snapshot/webhooks/node_modules/superagent/lib/node/unzip.js:55:12)
at Unzip.emit (events.js:323:22)
at Unzip.EventEmitter.emit (domain.js:482:12)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
status: 500,
response: Response {
_events: [Object: null prototype] {},

@schowave
Copy link

schowave commented Jun 8, 2020

I got it working by using the PR from here: #152 manually in the npm code.

@stale
Copy link

stale bot commented Sep 7, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the wontfix label Sep 7, 2020
@aphex3k
Copy link

aphex3k commented Sep 7, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

Yes this is still relevant as at least #152 has not been closed yet.

@stale stale bot removed the wontfix label Sep 7, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the wontfix label Dec 25, 2020
@Deejuha
Copy link

Deejuha commented Feb 14, 2021

Had same issue while trying to parse gitlab http request into jenkins, #152 fixed it for me.

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

Successfully merging a pull request may close this issue.