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

Error: "invalid character '<' looking for beginning of value" #1007

Open
2 of 3 tasks
sNiXx opened this issue Oct 22, 2023 · 1 comment
Open
2 of 3 tasks

Error: "invalid character '<' looking for beginning of value" #1007

sNiXx opened this issue Oct 22, 2023 · 1 comment

Comments

@sNiXx
Copy link
Sponsor

sNiXx commented Oct 22, 2023

Support guidelines

I've found a bug and checked that ...

  • ... 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

  1. Install a self-hosted ntfy instance
  2. Make necessary adjustment to DIUN configuration to point to ntfy
  3. Execute diun notif test from the command line
  4. 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.

@rizkyzhang
Copy link

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 to http://gotify:80.

Hopefully this can helps.

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

3 participants