caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
575 stars 49 forks source link

Signal using curl: django.request: Failed Dependency: /notify/apprise #162

Closed voc0der closed 5 months ago

voc0der commented 6 months ago

:mega: Notification Service(s) Impacted Signal

:lady_beetle: Describe the bug Got apprise-api set up, with an internal reverse proxy and routing, and all appears fine. I use the lsio container, but they said I should report this upstream.

I only have one signal entry in the configuration, a group. signal_group=signal://signal-cli-rest-api:8080/+555555555/group.xyzXiIEFWJFIWEJFIWEJFIWEJFIEJWijwfweijfwiejfwef= which seems to work fine when I docker exec -it apprise-api bash then apprise -vv -t "Test" -b "XYZ" --tag=all --config=http://localhost:8000/get/apprise. That works.

But when I try to call it with curl that's when it stops working.

curl --insecure -X POST \
    -F "body=Test Message" \
    -F "tags=all" \
    https://notify.some-dmz-server1.home/notify/apprise

:bulb: Screenshots and Logs In the docker logs apprise-api, it shows the error in the title:

[pid: 146|app: 0|req: 29/29] 172.28.0.105 () {52 vars in 843 bytes} [Tue Jan  9 08:11:21 2024] POST /notify/apprise => generated 72 bytes in 3 msecs (HTTP/1.1 424) 5 headers in 297 bytes (1 switches on core 0)
2024-01-09 08:12:54,535 [INFO] apprise: Loaded 1 entries from memory://
2024-01-09 08:12:54,536 [WARNING] django.request: Failed Dependency: /notify/apprise

:computer: Your System Details:

Thank you for any help you or suggestions you may provide!

caronc commented 6 months ago

Could be timing out making the upstream request. What happens if you add ?rto=30 to the URL; see caronc/apprise#653

voc0der commented 6 months ago

No luck here. Don't know what I'm doing wrong. Thank you for the help. I switched my config to yaml and now I'm using:

urls:
  - "signal://signal-cli-rest-api:8080/+1111111111":
    - to: "group.eG43HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE0="
      tag: signal
      rto: 30

Per the linked thread, but to no avail.

2024-01-09 15:46:16,841 [INFO] apprise: Loaded 1 entries from memory://
2024-01-09 15:46:16,841 [WARNING] django.request: Failed Dependency: /notify/apprise
[pid: 147|app: 0|req: 26/28] 172.28.0.105 () {52 vars in 843 bytes} [Tue Jan  9 15:46:16 2024] POST /notify/apprise => generated 72 bytes in 2 msecs (HTTP/1.1 424) 5 headers in 297 bytes (1 switches on core 0)
2024-01-09 15:46:49,688 [INFO] apprise: Loaded 1 entries from memory://
2024-01-09 15:46:49,689 [WARNING] django.request: Failed Dependency: /notify/apprise
[pid: 147|app: 0|req: 27/29] 172.28.0.105 () {52 vars in 843 bytes} [Tue Jan  9 15:46:49 2024] POST /notify/apprise => generated 72 bytes in 4 msecs (HTTP/1.1 424) 5 headers in 297 bytes (1 switches on core 0)
2024-01-09 15:46:56,014 [INFO] apprise: Loaded 1 entries from memory://
2024-01-09 15:46:56,014 [WARNING] django.request: Failed Dependency: /notify/apprise
[pid: 147|app: 0|req: 28/30] 172.28.0.105 () {52 vars in 843 bytes} [Tue Jan  9 15:46:56 2024] POST /notify/apprise => generated 72 bytes in 2 msecs (HTTP/1.1 424) 5 headers in 297 bytes (1 switches on core 0)
caronc commented 5 months ago

So one thing i noticed is you're setting tags= try setting tag= instead.

I will leave this ticket open and add support for tags= as well for future releases.

voc0der commented 5 months ago

Ack, that was it. Thank you!

caronc commented 5 months ago

Closing ticket as last MR improves logging which should help resolve your concern

YouveGotMeowxy commented 5 months ago

I had the same problem. I copied the curl example from the Web UI, which has "tags" instead of "tag", and it gave me the error, and doesn't send anything.

image