webhook: fork/exec: exec format error (question)
Hi, I have following settings:
[
{
"id": "redeploy-webhook",
"execute-command": "/home/joseluis/test/hooks/redeploy.sh",
"command-working-directory": "/home/joseluis/test",
"response-message": "I got the payload!"
}
]
I request the hook:
$ curl http://localhost:9000/hooks/redeploy-webhook
I got the payload!
On the terminal I got this error:
$ webhook -hooks hooks.json -verbose
[webhook] 2015/12/06 16:58:02 version 2.3.6 starting
[webhook] 2015/12/06 16:58:02 setting up os signal watcher
[webhook] 2015/12/06 16:58:02 attempting to load hooks from hooks.json
[webhook] 2015/12/06 16:58:02 loaded 1 hook(s) from file
[webhook] 2015/12/06 16:58:02 > redeploy-webhook
[webhook] 2015/12/06 16:58:02 os signal watcher ready
[webhook] 2015/12/06 16:58:02 starting insecure (http) webhook on :9000
[webhook] 2015/12/06 16:58:07 Started GET /hooks/redeploy-webhook
[webhook] 2015/12/06 16:58:07 redeploy-webhook got matched (1 time(s))
[webhook] 2015/12/06 16:58:07 redeploy-webhook hook triggered successfully
[webhook] 2015/12/06 16:58:07 Completed 200 OK in 265.558µs
[webhook] 2015/12/06 16:58:07 executing /home/joseluis/test/hooks/redeploy.sh
(/home/joseluis/test/hooks/redeploy.sh) with arguments
["/home/joseluis/test/hooks/redeploy.sh"] and environment []
using /home/joseluis/test as cwd
[webhook] 2015/12/06 16:58:07 command output:
[webhook] 2015/12/06 16:58:07 error occurred:
fork/exec /home/joseluis/test/hooks/redeploy.sh: exec format error
[webhook] 2015/12/06 16:58:07 finished handling redeploy-webhook
My simple echo "Hello"
command in redeploy.sh
doesn’t execute.
What am I doing wrong?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 23 (7 by maintainers)
Commits related to this issue
- Include shebang info wiki/home.md in readme A change was made in response to #60 (fork/exec: exec format error) on the wiki that would be useful to also propagate to the readme. — committed to 464bb26bac556e85b6fd6b524347b103/webhook by 464bb26bac556e85b6fd6b524347b103 6 years ago
Can you add
#!/bin/sh
on topThat’s the problem. The first line must be something like this:
Voilà now works fine! 😄
Always Shebang on top 😄
Thanks a lot guys.
Done ! https://github.com/adnanh/webhook/wiki/Home/_compare/aaa832b5ba58f0904fdcba183d1fc8184caafd00?diff=unified