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

Cannot recieve a notification in a json format #2041

Open
QKrempp opened this issue Oct 17, 2024 · 1 comment
Open

Cannot recieve a notification in a json format #2041

QKrempp opened this issue Oct 17, 2024 · 1 comment

Comments

@QKrempp
Copy link

QKrempp commented Oct 17, 2024

Describe the bug

Watchtower seems to fail to provide a notification in a valid json format at least when using a generic webhook.

Steps to reproduce

  1. Create a new docker compose file like the following:
version: "3.3"
services:
  watchtower:
    restart: unless-stopped
    container_name: watchtower_test
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    image: containrrr/watchtower
    environment:
      WATCHTOWER_NOTIFICATION_URL: get a test url from webhook.site and replace "https" with "generic"
  1. Run docker compose up -d
  2. See the interface in Webhook.site, and check Request detail > Raw content
  3. See the "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" banner at the top
    This is causing the app supposed to recieve the data to fail to parse it in my setup

Expected behavior

Recieved data is a valid JSON (as it is supposed to be the default format)

Screenshots

No response

Environment

  • Ubuntu 24.04.1
  • x86_64
  • Docker version 24.0.7, build 24.0.7-0ubuntu4.1
  • Docker Compose version 2.24.6+ds1-0ubuntu2

Your logs

watchtower_test  | time="2024-10-17T19:22:14Z" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
watchtower_test  | time="2024-10-17T19:22:15Z" level=debug msg="Making sure everything is sane before starting"
watchtower_test  | time="2024-10-17T19:22:15Z" level=debug msg="Retrieving running containers"
watchtower_test  | time="2024-10-17T19:22:15Z" level=debug msg="There are no additional watchtower containers"
watchtower_test  | time="2024-10-17T19:22:15Z" level=debug msg="Watchtower HTTP API skipped."
watchtower_test  | time="2024-10-17T19:22:15Z" level=info msg="Watchtower 1.7.1"
watchtower_test  | time="2024-10-17T19:22:15Z" level=info msg="Using notifications: generic"
watchtower_test  | time="2024-10-17T19:22:15Z" level=info msg="Checking all containers (except explicitly disabled with label)"
watchtower_test  | time="2024-10-17T19:22:15Z" level=info msg="Scheduling first run: 2024-10-18 19:22:15 +0000 UTC"
watchtower_test  | time="2024-10-17T19:22:15Z" level=info msg="Note that the first check will be performed in 23 hours, 59 minutes, 59 seconds"
watchtower_test  | Server response: This URL has no default content configured. <a href="https://webhook.site/#!/view/REDACTED">View in Webhook.site</a>.

Additional context

No response

Copy link

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

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

No branches or pull requests

2 participants
@QKrempp and others