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

Gotify is sending one single message with all notifications from watchtower #873

Closed
cerealconyogurt opened this issue Mar 31, 2021 · 12 comments

Comments

@cerealconyogurt
Copy link

cerealconyogurt commented Mar 31, 2021

Describe the bug
Before updating from v1.1.5 to v.1.2.1 watchtower was sending each notification to gotify separately, so I was receiving a message from gotify for each message from watchtower. See below an example

image

but now the notifications coming in just one message:

image

Expected behavior
I am expecting to see one message per one notification. It is hard to read which docker has been updated when all notifications are in one message in gotify

Environment

  • Platform Asustor AS5202T
  • Linux x86_64 (kernel 4.14.0.x)
  • Docker version 19.03.8 (API: 1.40)

log
today at 1:31 AM time="2021-03-31T01:31:15-03:00" level=info msg="Found new haugene/transmission-openvpn:latest image (sha256:26319b02276cce1fd61189fd97cafc830cb35b128375f77b7c126f4756f4e532)"
today at 1:31 AM time="2021-03-31T01:31:42-03:00" level=info msg="Found new quay.io/invidious/invidious:latest image (sha256:1f88fd91398fbfe85dd871bbd7ae4bfe4823adca912e710b781c55caf5753cbf)"
today at 1:31 AM time="2021-03-31T01:31:50-03:00" level=info msg="Found new excalidraw/excalidraw:latest image (sha256:2a0dc9a84a8272835837fda3e7ced670b2d04e44a3b64a8759a796d831514ae5)"
today at 1:32 AM time="2021-03-31T01:32:09-03:00" level=info msg="Found new amir20/dozzle:latest image (sha256:9cf27bca912f322057abab409a0f0f243c5907805047657a4ec42cac5abe459d)"

@github-actions
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! 🙏

@scottjl
Copy link

scottjl commented Apr 2, 2021

this is the same format shoutrrr uses and i too wouldn't mind separate messages for each container vs. one very long message.

@piksel
Copy link
Member

piksel commented Apr 2, 2021

The reason for this change was that all messages belonging to a single run would be "connected", so that if you had 20 containers to check, you wouldn't get 20 notifications (minimum!) for every run.
We could perhaps add an option to split the messages if this is really important, but I would suggest exploring other alternatives to not increase the maintenance/testing/development burden.

You could, for example, set a message template with spaces between the lines:

WATCHTOWER_NOTIFICATION_TEMPLATE="{{range .}}{{.Message}}{{println}}{{println}}{{end}}"

One thing that would decrease the clutter a lot, is to use the short IDs for the images instead, which would look like this:

Found new haugene/transmission-openvpn:latest image (26319b02276c)
Found new quay.io/invidious/invidious:latest image (1f88fd91398f)
Found new excalidraw/excalidraw:latest image (2a0dc9a84a82)
Found new amir20/dozzle:latest image (9cf27bca912f)

It's not something that you can enable right now, but it's a general change that I am looking into applying throughout Watchtower (unless an obstacle to this is discovred).
Perhaps that would also reduce the need for separate messages?

@scottjl
Copy link

scottjl commented Apr 2, 2021

see, i wouldn't mind 20 messages. because i can sort or ignore them, or possibly set separate priorities based on the container, my database is more important than a minor application. everything lumped together, it's all or nothing. trying to see one particular container in a list of 20 is a chore.

@piksel
Copy link
Member

piksel commented Apr 2, 2021

You cannot set different priorities for separate containers even with multiple messages , but you could do it if you use separate scopes (and a watchtower instance per scope with the priority set in the notification URL).
I don't really see how a list of 20 notifications is less a chore than a notification with 20 lines. As I pointed out above, you can customize the template to add any separation you want to make it clearer.

@scottjl
Copy link

scottjl commented Apr 2, 2021

well, it would be nice if you could set separate priorities.
as for one list of 20, or 20 separate messages, we simply have different preferences. it would have been nice if this would have been made an option rather than simply changing the existing functionality without notice or any way to revert the change.

changing the template, not being a golang programmer (or actually a programmer at all), i find the template structure confusing, i really don't want to have to learn golang just to change messages. i came back to watchtower (after it was abandoned) from ouroborus because they've stopped development. it's looking like i might need to find yet another alternative..

@piksel
Copy link
Member

piksel commented Apr 2, 2021

Yeah, the templating langue is not the easiest. The suggested template I gave above changes the default:

{{range .}}{{.Message}}{{println}}{{end}}

into

{{range .}}{{.Message}}{{println}}{{println}}{{end}}

Effectively just adding another newline between every item. No need to learn go to use it, just copy+paste into your docker command or docker-compose.
I'm sorry that you feel like this is a deal-breaking change, but we are trying to satisfy as many users as possible without increasing the burden of maintenance for us volunteers that try to keep this project afloat.

@cerealconyogurt
Copy link
Author

Thank @piksel for your promptly reply. I do not want indeed to increase the maintenance/testing/development burden. I will try the templating suggestion. I believe this solution shall fit to my requirement

It'd be great to use the short IDs for the images instead. I am looking forward this change in the new versions

cheers

@rg9400
Copy link
Contributor

rg9400 commented Apr 5, 2021

I think one thing that could help is to have a more concise summary related to the messages being sent as notifications. While I don't use Gotify specifically and use Discord instead, the new format is resulting in characters being cutoff, leading to incomplete notifications, which defeats the purpose completely. It would be nice to get a simple list of each image that was updated during a run using short IDs as you mentioned, rather than getting 4 separate lines for the image being found, the container being stopped, the new image being created, and the prior image being removed.

I am not sure if that would satisfy the OP, but I assume it would make the notifications far more legible, even if they were added in a single message (and would prevent overflow issues in other services like Discord)

image

@cerealconyogurt
Copy link
Author

There is not incomplete notification problem with Gotify but indeed we need short IDs. See the Gotify output with the new language template:

image

@cerealconyogurt
Copy link
Author

I will close the issue since there is a partial solution (at least for me).
I will create a new one with a short IDs request

@ghost
Copy link

ghost commented Apr 8, 2021

To avoid important communication to get lost in a closed issues no one monitors, I'll go ahead and lock this issue. If you want to continue the discussion, please open a new issue. Thank you! 🙏🏼

@ghost ghost locked as resolved and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants