diun
diun copied to clipboard
Error: "invalid character '<' looking for beginning of value"
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
- [ ] ... there are no open or closed issues that are related to my problem
Description
This issue is related to #986.
When using DIUN to send notifications through a self-hosted instance of ntfy, the following error is logged: "invalid character '<' looking for beginning of value"
This behavior can also be triggered by using test notifications.
Expected behaviour
When sending any kind of notification via ntfy, it should immediately be visible to all subscribers.
Actual behaviour
The aforementioned error shows up and notifications do not go through.
Steps to reproduce
- Install a self-hosted ntfy instance
- Make necessary adjustment to DIUN configuration to point to ntfy
- Execute
diun notif test
from the command line - Read error message "invalid character '<' looking for beginning of value"
Diun version
4.26.0
Docker info
Client: Docker Engine - Community
Version: 24.0.6
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.21.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 11
Running: 11
Paused: 0
Stopped: 0
Images: 11
Server Version: 24.0.6
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
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 logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
runc version: v1.1.9-0-gccaecfc
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.0-0.deb11.11-amd64
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.57GiB
Name:
ID:
Docker Root Dir:
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Docker Compose config
No response
Logs
N/A
Additional info
As mentioned in #986, I think this is related to the response parser, which expects a json, but in some cases may receive an html in the response body.
I just found a way to fix this issue:
- Background: I am running gotify (ntfy alternative) and diun in the same server, gotify is running behind reverse proxy with a domain name so its port is not exposed.
- Problem: When I set
DIUN_NOTIF_GOTIFY_ENDPOINT
to gotify https domain, I got the same error. - Solution: Changing
DIUN_NOTIF_GOTIFY_ENDPOINT
to gotify's local docker url fix the issue, I am using docker compose and both gotify and diun is in same docker networks, I just set it tohttp://gotify:80
.
Hopefully this can helps.