crazy-max / diun

Receive notifications when an image is updated on a Docker registry
https://crazymax.dev/diun/
MIT License
3.12k stars 116 forks source link

Rocketchat: no notification after RocketChat update #508

Open StefPlue opened 3 years ago

StefPlue commented 3 years ago

After a new Rocketchat server version was installed at our company, no notifications are displayed there anymore. The Diun debug log shows the dispatch without errors. Trying a new token without 2FA authorization did not change this.

Steps to reproduce this issue

  1. Configure Rocketchat as notification
  2. Call "diun notif test"

Expected behaviour

The message is displayed in the Rocketchannel

Actual behaviour

Nothing is displayed, neither real messages nor the test notification

Configuration

  rocketchat:
    endpoint: https://chat.......
    channel: "#kcs-baseimage-updates"
    userId: <UserId>
    token: <Token>
    templateTitle: "{{ .Entry.Image.Path }}:{{ .Entry.Image.Tag }}"
    templateBody: |
      Container {{.Entry.Image}} wurde {{.Entry.Manifest.Created}} {{ if (eq .Entry.Status "new") }}erstellt{{ else }}aktualisiert{{ end }}.
FROM ghcr.io/crazy-max/diun:latest

ENV TZ Europe/Berlin
ENV LOG_LEVEL info
ENV CONFIG /data/diun.yml

RUN apk update
RUN apk upgrade

RUN apk add bash
RUN apk add git
RUN apk add openssh

RUN apk update
RUN apk upgrade

RUN rm -rf /var/cache/apk/*

COPY files/notifier.sh /usr/local/bin/notifier.sh
RUN chmod +x /usr/local/bin/notifier.sh

COPY files/root/bashrc /root/.bashrc

RUN mkdir /root/.ssh
COPY files/root/ssh/known_hosts /root/.ssh/known_hosts
RUN chmod 700 /root/.ssh

COPY files/root/certificates/root.crt /root/root.crt
RUN git config --global http.sslCAInfo /root/root.crt
RUN git config --global user.name Diun
RUN git config --global user.email <email address>

Logs

Mon, 15 Nov 2021 09:00:00 CET INF Cron triggered
Mon, 15 Nov 2021 09:00:00 CET INF Found 2 image(s) to analyze provider=file
Mon, 15 Nov 2021 09:00:00 CET DBG Registry options will be used image=memcached:1.6.3-alpine provider=file regopt=docker.io
Mon, 15 Nov 2021 09:00:00 CET DBG Registry options will be used image=nginx provider=file regopt=docker.io
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/nginx:latest, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/memcached:1.6.3-alpine, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:00 CET DBG Tag not included image=docker.io/library/nginx:latest provider=file
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fmemcached%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:00 CET DBG [containers/image] HEAD https://registry-1.docker.io/v2/library/memcached/manifests/1.6.3-alpine
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] GET https://registry-1.docker.io/v2/library/nginx/tags/list
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Trying to access "docker.io/library/memcached:1.6.3-alpine"
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/memcached:1.6.3-alpine, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:01 CET DBG 373 tag(s) found in repository. 4 will be analyzed (0 max, 369 not included, 0 excluded). image=docker.io/library/nginx:latest
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/nginx:1.21.0-alpine, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/nginx:1.21.1-alpine, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/nginx:1.21.3-alpine, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Returning credentials for docker.io from DockerAuthConfig
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Using registries.d directory /etc/containers/registries.d for sigstore configuration
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image]  No signature storage configuration found for docker.io/library/nginx:1.21.4-alpine, using built-in default file:///var/lib/containers/sigstore
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
Mon, 15 Nov 2021 09:00:01 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fmemcached%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] GET https://auth.docker.io/token?account=sbdiun&scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.io
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] GET https://registry-1.docker.io/v2/library/memcached/manifests/1.6.3-alpine
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] HEAD https://registry-1.docker.io/v2/library/nginx/manifests/1.21.0-alpine
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] HEAD https://registry-1.docker.io/v2/library/nginx/manifests/1.21.1-alpine
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] HEAD https://registry-1.docker.io/v2/library/nginx/manifests/1.21.4-alpine
Mon, 15 Nov 2021 09:00:02 CET DBG [containers/image] HEAD https://registry-1.docker.io/v2/library/nginx/manifests/1.21.3-alpine
Mon, 15 Nov 2021 09:00:03 CET DBG [containers/image] Content-Type from manifest GET is "application/vnd.docker.distribution.manifest.list.v2+json"
Mon, 15 Nov 2021 09:00:03 CET DBG [containers/image] GET https://registry-1.docker.io/v2/library/memcached/manifests/sha256:504421bbf708add1d72e89d605ea3ea63d4b781866405bcfa5446e0172ad16eb
Mon, 15 Nov 2021 09:00:03 CET DBG No changes image=docker.io/library/nginx:1.21.1-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG Manifest saved to database image=docker.io/library/nginx:1.21.1-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG No changes image=docker.io/library/nginx:1.21.0-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG Manifest saved to database image=docker.io/library/nginx:1.21.0-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG No changes image=docker.io/library/nginx:1.21.4-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG Manifest saved to database image=docker.io/library/nginx:1.21.4-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG No changes image=docker.io/library/nginx:1.21.3-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG Manifest saved to database image=docker.io/library/nginx:1.21.3-alpine provider=file
Mon, 15 Nov 2021 09:00:03 CET DBG [containers/image] Content-Type from manifest GET is "application/vnd.docker.distribution.manifest.v2+json"
Mon, 15 Nov 2021 09:00:03 CET DBG [containers/image] Downloading /v2/library/memcached/blobs/sha256:801fa8ca11ab6a7fd7c3976f966b1a4b804a1f28db61aaf9156e1835dc78c55b
Mon, 15 Nov 2021 09:00:03 CET DBG [containers/image] GET https://registry-1.docker.io/v2/library/memcached/blobs/sha256:801fa8ca11ab6a7fd7c3976f966b1a4b804a1f28db61aaf9156e1835dc78c55b
Mon, 15 Nov 2021 09:00:04 CET INF New image found image=docker.io/library/memcached:1.6.3-alpine provider=file
Mon, 15 Nov 2021 09:00:04 CET DBG Manifest saved to database image=docker.io/library/memcached:1.6.3-alpine provider=file
Mon, 15 Nov 2021 09:00:04 CET DBG Sending mail notification... image=docker.io/library/memcached:1.6.3-alpine
Mon, 15 Nov 2021 09:00:04 CET DBG Sending rocketchat notification... image=docker.io/library/memcached:1.6.3-alpine
Mon, 15 Nov 2021 09:00:04 CET INF Jobs completed added=1 failed=0 skipped=1 unchanged=4 updated=0
Mon, 15 Nov 2021 09:00:04 CET INF Next run in 1 minute 59 seconds (2021-11-15 09:02:00 +0100 CET)
macuros commented 2 years ago

Same problem. Works with Pushover, but not getting any notifications in private RocketChat channel.

crazy-max commented 2 years ago

@StefPlue If you can provide your previous working RocketChat version and the current one, we could see what's changed and how to fix it.