Gotify: diun: error: rpc error: code = Unknown desc context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Support guidelines
- [X] I've read the support guidelines
I've found a bug and checked that ...
- [X] ... the documentation does not mention anything about my problem
- [X] ... there are no open or closed issues that are related to my problem
Description
diun fail to send notifications to gotify.
Expected behaviour
Diun must be able to send notifications to Gotify
Actual behaviour
The notifications fail to be send with the following message:
diun: error: rpc error: code = Unknown desc = Post "http://gotify/message?token=token": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Steps to reproduce
- launch docker compose exec diun diun notif test
- the following error is displayed diun: error: rpc error: code = Unknown desc = Post "http://gotify/message?token=token": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Diun version
v4.28.0
Docker info
Client:
Version: 27.3.1
Context: default
Debug Mode: false
Plugins:
compose: Docker Compose (Docker Inc.)
Version: 2.29.7
Path: /usr/lib/docker/cli-plugins/docker-compose
Server:
Containers: 7
Running: 7
Paused: 0
Stopped: 0
Images: 13
Server Version: 27.3.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 57f17b0a6295a39009d861b89e3b3b87b005ca27.m
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.6.58-1-lts
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 30.98GiB
Name: thinkpad
ID: KGJK:QQ2A:LN74:V2IH:YRBB:QGCM:VEG2:NEJL:7HAD:5PNW:WND5:IHPH
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Docker Compose config
services:
diun:
image: crazymax/diun:latest
cap_add:
- NET_RAW
- NET_ADMIN
restart: always
command: serve
volumes:
- "./diun.yml:/diun.yml:ro"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ=Europe/Paris"
- "LOG_LEVEL=trace"
- "LOG_JSON=false"
networks:
- tests
labels:
- "diun.enable=true"
gotify:
image: ghcr.io/gotify/server
ports:
- 32769:80
networks:
- tests
labels:
- "diun.enable=true"
networks:
tests:
external: true
name: tests
### Logs
```text
diun-1 | Sat, 26 Oct 2024 12:41:32 CEST INF New image found image=ghcr.io/gotify/server:latest provider=docker
diun-1 | Sat, 26 Oct 2024 12:41:32 CEST INF New image found image=ghcr.io/gotify/server:latest provider=docker
diun-1 | Sat, 26 Oct 2024 12:41:32 CEST DBG Manifest saved to database image=ghcr.io/gotify/server:latest provider=docker
diun-1 | Sat, 26 Oct 2024 12:41:32 CEST DBG Sending gotify notification... image=ghcr.io/gotify/server:latest
diun-1 | Sat, 26 Oct 2024 12:41:32 CEST ERR Gotify notification failed error="Post \"http://gotify/message?token=ArTyG98mClAhvBjs\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)" image=ghcr.io/gotify/server:l
atest
Additional info
The diun configuration:
watch:
workers: 20
schedule: "0 */6 * * *"
firstCheckNotif: true
runOnStartup: true
providers:
docker:
watchStopped: true
notif:
gotify:
endpoint: http://gotify
token: AzS2Ypd6YAf70Uk
priority: 1
timeout: 10
If Iaunch the following command in the diun container, gotify receive the notification (note that the following command comes from https://gotify.net/docs/pushmsg):
curl http://gotify/message?token=AzS2Ypd6YAf70Uk -F "title=toto" -F "message=titi"
So it seems that the environment is fine.
Here is a pcap capture when I lanch the test command docker compose exec diun diun notif test:
I might encounter a related problem. I also get diun: error: rpc error: code = Unknown desc = Post "http://IP:PORT/v2/send": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
This is my setup:
services:
diun:
image: crazymax/diun:latest
container_name: diun
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
environment:
- TZ=UTC
- DIUN_WATCH_WORKERS=20
- DIUN_WATCH_SCHEDULE=0 */6 * * *
- DIUN_PROVIDERS_DOCKER=true
- DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true
- DIUN_NOTIF_SIGNALREST_ENDPOINT=${SIG_REST_ENDPOINT}
- DIUN_NOTIF_SIGNALREST_NUMBER=${SIG_REST_NUMBER}
- DIUN_NOTIF_SIGNALREST_RECIPIENTS=${SIG_REST_RECIPIENTS}
- DIUN_NOTIF_SIGNALREST_TEMPLATEBODY=Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
Somehow I can also not send signal messages via wget from the diun container, but it works from host and other containers without any problems.