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

Invalid JSON Paylod provided using KEY: discord #222

Open
anthonyma94 opened this issue Jan 4, 2025 · 4 comments
Open

Invalid JSON Paylod provided using KEY: discord #222

anthonyma94 opened this issue Jan 4, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@anthonyma94
Copy link

I have a persistent endpoint for Discord (/notify/discord). However, I have one specific client (Proxmox backup server webhook) calling it that always ends up with a 400 error, with the following log:

2025-01-03 19:00:22,741 [WARNING] django: NOTIFY - 192.168.12.15 - Invalid JSON Payload provided using KEY: discord
2025-01-03 19:00:22,742 [WARNING] django.request: Bad Request: /notify/discord
[pid: 144|app: 0|req: 2/2] 192.168.12.15 () {30 vars in 402 bytes} [Fri Jan  3 19:00:22 2025] POST /notify/discord => generated 42 bytes in 1 msecs (HTTP/1.1 400) 6 headers in 374 bytes (1 switches on core 0)

I would like to see the contents of the request for troubleshooting but am unable to. I have set LOG_LEVEL=debug and DEBUG=yes.

The following curl works:

curl -X POST -H 'Content-Type: application/json' -d '{"body":"hello world"}' http://192.168.3.10:8000/notify/discord

The same contents within proxmox, however, doesn't:
image

I don't have a way to see the raw contents on Proxmox's side.

@anthonyma94 anthonyma94 added the bug Something isn't working label Jan 4, 2025
@caronc
Copy link
Owner

caronc commented Jan 4, 2025

See here on details of the Payload Manipulation.

apprise -b "hello world" "json://192.168.3.10:8000/notify/discord/?:version&:title&:type&:message=body"

Try that and see if it helps?

@anthonyma94
Copy link
Author

Proxmox only does HTTP calls, however none of the payload manipulation tactics worked. Still the same error.

@anthonyma94
Copy link
Author

I used Wireshark and found something interesting. The API cannot accept a payload when it is encoded with Transfer-Encoding: chunked in the header.

@caronc
Copy link
Owner

caronc commented Jan 7, 2025

I don't use Proxmox, but the bug appears on its side if curl works fine. You could try submitting it not as JSON but just a FORM.

Maybe you can change it to be a application/x-www-form-urlencoded and then set the body to body=This%20is%20a%20Test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants