Code Monkey home page Code Monkey logo

Comments (20)

moorereason avatar moorereason commented on May 2, 2024 1

Can you provide more information? It sounds like it was working and then just stopped working. ? Did you update webhook? What version of webhook are you running?

from webhook.

adnanh avatar adnanh commented on May 2, 2024 1

What payload is bitbucket sending? What is the configuration of your hook in hooks.json file?

from webhook.

adnanh avatar adnanh commented on May 2, 2024 1

You should remove "parse-parameters-as-json": [ { "source": "payload", "name": "payload" } ] from the hooks.json and then restart webhook.

parse-parameters-as-json property is used to parse strings that are valid JSON. The payload bitbucket sends is not a string, it is actually an object.

from webhook.

adnanh avatar adnanh commented on May 2, 2024 1

Can you copy the exact output of the command: curl -v -X POST http://192.168.1.229:9000

from webhook.

adnanh avatar adnanh commented on May 2, 2024 1

Turns out the Bitbucket has updated the event payloads. Try replacing { "source": "payload", "name": "payload.commits.0.author" } with { "source": "payload", "name": "actor.username" }

from webhook.

moorereason avatar moorereason commented on May 2, 2024 1

Can we add this sample config to the wiki?

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

Thanks for your answers.
hooks.json:
[ { "id": "redep-it-hook", "execute-command": "/home/it/ho/redeploy.sh", "command-working-directory": "/home/it/ho", "parse-parameters-as-json": [ { "source": "payload", "name": "payload" } ], "pass-arguments-to-command": [ { "source": "string", "name": "123" }, { "source": "payload", "name": "payload.commits.0.author" } ] } ]

BitBucket send request on push to repo.
It happened after the server is not working day. Then I re-launched webhook.

Start webhook: nohup ./webhook -hooks hooks.json -verbose -port 9000

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

Today I downloaded the latest version of webhook again, all the same.

I checked with the help of ngrok - he is also responsible 405
With what it can be connected?

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

I do the same, the exact same error.
Even if I just send your inquiry to:
curl -X POST http://192.168.1.229:9000

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

`* Rebuilt URL to: http://192.168.1.229:9000/

  • Hostname was NOT found in DNS cache
  • Trying 192.168.1.229...
  • Connected to 192.168.1.229 (192.168.1.229) port 9000 (#0)

    POST / HTTP/1.1
    User-Agent: curl/7.35.0
    Host: 192.168.1.229:9000
    Accept: /

    < HTTP/1.1 404 Not Found
    < Content-Type: text/plain; charset=utf-8
    < Date: Wed, 13 Apr 2016 09:53:53 GMT
    < Content-Length: 19
    <
    404 page not found
  • Connection #0 to host 192.168.1.229 left intact
    `

Replaced payload, yet all the same

from webhook.

adnanh avatar adnanh commented on May 2, 2024

Sorry, try hitting the actual hook: curl -v -X POST http://192.168.1.229:9000/hooks/redep-it-hook

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

`

  • Hostname was NOT found in DNS cache
  • Trying 192.168.1.229...
  • Connected to 192.168.1.229 (192.168.1.229) port 9000 (#0)

    POST /hooks/redep-it-hook HTTP/1.1
    User-Agent: curl/7.35.0
    Host: 192.168.1.229:9000
    Accept: /

    < HTTP/1.1 400 Bad Request
    < Date: Wed, 13 Apr 2016 10:00:04 GMT
    < Content-Length: 80
    < Content-Type: text/plain; charset=utf-8
    <
  • Connection #0 to host 192.168.1.229 left intact
    error parsing JSON: couldn't retrieve argument for {Source:payload Name:payload}
    `

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

In hooks.json:
[ { "id": "redep-it-hook", "execute-command": "/home/it/ho/redeploy.sh", "command-working-directory": "/home/it/ho" } ]

from webhook.

adnanh avatar adnanh commented on May 2, 2024

Are you sure you restarted webhook?

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

Problem with:
"parse-parameters-as-json":

{
"source": "payload",
"name": "payload"
}

from webhook.

adnanh avatar adnanh commented on May 2, 2024

Yes, I asked you to remove that from your hooks.json file. Did it work after that?

from webhook.

DarkDrim avatar DarkDrim commented on May 2, 2024

Yes, after remove and restart webhook

from webhook.

adnanh avatar adnanh commented on May 2, 2024

Awesome. :-)

from webhook.

adnanh avatar adnanh commented on May 2, 2024

I guess the original example is now outdated, so we should update it. Do you mind doing it?

from webhook.

moorereason avatar moorereason commented on May 2, 2024

Wiki updated.

from webhook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.