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 during processing webhook #640

Closed
alexwesemann opened this issue May 22, 2023 · 10 comments
Closed

Error during processing webhook #640

alexwesemann opened this issue May 22, 2023 · 10 comments
Labels

Comments

@alexwesemann
Copy link

Good afternoon,
Currently I am running Webhook version 2.6.9 on a virtualized Ubuntu 11 machine. Maybe this is a really noob question, but I am struggling now for a couple of days and running out of inspiration.

My hooks.json file looks like this:
hooks
My redeploy.sh script looks like this:
image

I constantly get the following error when running the listener:
image

Can someone tell me what I am doing wrong?
Hope to hear from you guys soon.

@moorereason
Copy link
Collaborator

This is probably a duplicate of #615. What does you payload look like?

@adnanh
Copy link
Owner

adnanh commented May 22, 2023

Hmm, seems to work with 2.8.0

@alexwesemann
Copy link
Author

alexwesemann commented May 23, 2023 via email

@alexwesemann
Copy link
Author

alexwesemann commented May 23, 2023 via email

@alexwesemann
Copy link
Author

alexwesemann commented May 23, 2023 via email

@alexwesemann
Copy link
Author

alexwesemann commented May 23, 2023 via email

@alexwesemann
Copy link
Author

alexwesemann commented May 25, 2023 via email

@alexwesemann
Copy link
Author

alexwesemann commented May 25, 2023

Gents, I cannot find the hook anywhere in any folder. This is what is coming through while running Webhook:

[webhook] 2023/05/25 09:31:50 [df23ab] incoming HTTP POST request from 127.0.0.1:42954
[webhook] 2023/05/25 09:31:50 [df23ab] redeploy-webhook got matched
[webhook] 2023/05/25 09:31:50 [df23ab] redeploy-webhook hook triggered successfully
[webhook] 2023/05/25 09:31:50 [df23ab] 200 | 0 B | 188.526µs | 127.0.0.1:9000 | POST /hooks/redeploy-webhook
[webhook] 2023/05/25 09:31:50 [df23ab] executing /home/debian/hooks/redeploy-webhook/redeploy.sh (/home/debian/hooks/redeploy-webhook/redeploy.sh) with arguments ["/home/debian/hooks/redeploy-webhook/redeploy.sh" "{"Accept":"text/plain, application/json, application/+json, /","Accept-Encoding":"gzip,deflate","Connection":"close","Content-Length":"416","Content-Type":"application/json","Things-Device-Barcode":"NULL","Things-Message-Token":"c3a62f7b43b3cbfef1895088924c87935ccc752693c557e9c656dcc7b6f098b3","Things-Plug-Uuid":"4aff6a7c-8d9b-44a2-b984-700c777be714","User-Agent":"axios/0.24.0"}" "{"root":[{"bn":"urn:dev:IMEI:86*********1814:","bt":1.684999803E9},{"n":"CPU temperatuur","u":"Cel","v":41.16},{"n":"GPRS-signaal","u":"count","v":27.0},{"n":"Hoogte in masl","u":"count","v":1.0},{"n":"Actuele grondsnelheid in km/h","u":"count","v":0.0},{"n":"Aantal gevonden satellieten","u":"count","v":1.0},{"n":"Totale schijfruimte in Gb","u":"count","v":14.0},{"n":"Beschikbare schijfruimte in Gb","u":"count","v":9.0}]}"] and environment [] using /var/www/html/hooks/redeploy-webhook as cwd
[webhook] 2023/05/25 09:31:50 [31c5f8] command output: mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.

[webhook] 2023/05/25 09:31:50 [31c5f8] finished handling redeploy-webhook
[webhook] 2023/05/25 09:31:50 [df23ab] command output: mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.

I would expect to find the webhook in the folder /var/www/html/hooks/redeploy-webhook but its empty.
Does it have to do with the fact that <[webhook] 2023/05/25 09:31:50 [df23ab] 200 | 0 B | 188.526µs | 127.0.0.1:9000 | POST /hooks/redeploy-webhook?> states 0 B??? Is it all empty?? I am really stuck here.

Anyone?
KR Alex

@moorereason
Copy link
Collaborator

I think you're misunderstanding what webhook does. webhook parses a web request and passes parts of that request to a local script or executable. It's up to the script or executable to do something useful with what's passed to it.

Your config is telling webhook to pass a JSON representation of the entire headers and payload to your script, but your script isn't doing anything with the parameters that are passed to it. It's only appending stuff to a log file.

@alexwesemann
Copy link
Author

alexwesemann commented May 25, 2023 via email

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

No branches or pull requests

3 participants