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

django.request: Failed Dependency Explanation #158

Closed datenzar closed 5 months ago

datenzar commented 6 months ago

:mega: Notification Service(s) Impacted Pushover (maybe others)

:lady_beetle: Describe the bug When I create a simple configuration (using Pushover) and then try to send a notification from another machine via curl, I don't receive the notification.

If I call the the scheme directly (without configuration), it works as supposed.

:bulb: Screenshots and Logs

On the client side:

[INFO] apprise: Loaded 1 entries from memory://

On the service side:

apprise  | 2023-12-25 04:46:50,101 [INFO] apprise: Loaded 1 entries from memory://
apprise  | 2023-12-25 04:46:50,102 [WARNING] django.request: Failed Dependency: /notify/test
apprise  | 172.18.0.10 - - [25/Dec/2023:11:46:50 +0100] "POST /notify/test HTTP/1.1" 424 72 "-" "curl/7.74.0"

:computer: Your System Details:

:crystal_ball: Additional context

Not sure if it's related to caronc/apprise#995 but as I don't get the ' new thread' error I opened a separate issue.

Also here is the content of my docker-compose.yml:

services:
  apprise:
    image: caronc/apprise:latest
    container_name: apprise
    ports:
      - 8000:8000
    privileged: true
    restart: unless-stopped
    user: "www-data:www-data"
    volumes:
      - ./config:/config
datenzar commented 6 months ago

Ok, I could figure out the problem now. It seems to happen as soon as I introduce tags into the configuration and want to use them, e.g.

# Define our version
version: 1

# Define our URLs
urls:
  - discord://<discord_id>/<discord_token>:
    - tag: discord

  - pover://<pushover_token>@<pushover_id>:
    - tag: pushover

The issue seems to be not the configuration itself, but rather when I call it without a proper tag being matched.

So instead of a django.request: Failed Dependency: /notify/test on the server, I would expect a warning like Couldn't find matching tags.

caronc commented 6 months ago

Failed Dependency is the request response. Basically 1 or more notifications could not be delivered. I updated the README.md to explain the codes a bit better. The logged error comes from the underlining library; not sure if this can be easily changed.

If you're actually using the API, the response is actually a nice JSON message explaining this error in more details; so end users developing against the error can easily accommodate.

As a Sysadmin (in your case) reviewing the logs; i hope the documentation updates will be satisfactory?

caronc commented 5 months ago

Closing issue as logging is improved in the attach PR which will address your concern.

datenzar commented 5 months ago

Sorry for the late reply but thanks for the explanation!