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

Nomad provider errors out with "invalid memory address or nil pointer dereference" #1074

Open
3 tasks done
axsuul opened this issue Jan 13, 2024 · 2 comments
Open
3 tasks done
Assignees
Labels

Comments

@axsuul
Copy link

axsuul commented Jan 13, 2024

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

I'm unable to run Diun with the Nomad provider since it errors out.

Expected behaviour

Run without errors

Actual behaviour

Errors out

goroutine 1 [running]:
github.com/crazy-max/diun/v4/internal/provider/nomad.(*Client).listTaskImages(0xc0009e4900)
	github.com/crazy-max/diun/v4/internal/provider/nomad/task.go:37 +0xdf
github.com/crazy-max/diun/v4/internal/provider/nomad.(*Client).ListJob(0xc0009e4900)
	github.com/crazy-max/diun/v4/internal/provider/nomad/nomad.go:35 +0x45
github.com/crazy-max/diun/v4/internal/app.(*Diun).Run(0x19f4b40?)
	github.com/crazy-max/diun/v4/internal/app/diun.go:181 +0xa7c
github.com/crazy-max/diun/v4/internal/app.(*Diun).Start(0xc0003808c0)
	github.com/crazy-max/diun/v4/internal/app/diun.go:107 +0xb9
main.(*ServeCmd).Run(0x2da7168, 0xc0001dd9e0)
	github.com/crazy-max/diun/v4/cmd/serve.go:93 +0xb5f
reflect.Value.call({0x19e27c0?, 0x2da7168?, 0x450276?}, {0x1c57c11, 0x4}, {0xc00071f1a0, 0x1, 0x1?})
	reflect/value.go:586 +0xb07
reflect.Value.Call({0x19e27c0?, 0x2da7168?, 0x1a21b60?}, {0xc00071f1a0?, 0x1c506c0?, 0x40e3ea?})
	reflect/value.go:370 +0xbc
github.com/alecthomas/kong.callFunction({0x19e27c0?, 0x2da7168?, 0x93561c?}, 0x0?)
	github.com/alecthomas/kong@v0.8.0/callbacks.go:98 +0x445
github.com/alecthomas/kong.callMethod({0x1c56dc8, 0x3}, {0x1b6ece0?, 0x2da7168?, 0x3?}, {0x19e27c0?, 0x2da7168?, 0x0?}, 0x0?)
	github.com/alecthomas/kong@v0.8.0/callbacks.go:132 +0x76
github.com/alecthomas/kong.(*Context).RunNode(0xc000998080, 0xc0001b61e0, {0xc000513e00, 0x1, 0x1})
	github.com/alecthomas/kong@v0.8.0/context.go:762 +0x60f
github.com/alecthomas/kong.(*Context).Run(0x191abc0?, {0xc000513e00?, 0xc000513e90?, 0x7?})
	github.com/alecthomas/kong@v0.8.0/context.go:787 +0x14e
main.main()
	github.com/crazy-max/diun/v4/cmd/main.go:59 +0x636
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x1821dff]

Steps to reproduce

Use Docker image crazymax/diun:4.26.0 with the following config file

notif:
  webhook:
    endpoint: https://example.com
    method: POST

providers:
  nomad:
    address: "http://${attr.unique.network.ip-address}:4646"
    tlsInsecure: true

    # Requires `diun.enable = true` in job's meta or service tags
    watchByDefault: false

Diun version

4.26.0

Docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
  scan: Docker Scan (Docker Inc., v0.23.0)

Server:
 Containers: 107
  Running: 107
  Paused: 0
  Stopped: 0
 Images: 52
 Server Version: 20.10.22
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  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 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 78f51771157abb6c9ed224c22013cdf09962315d
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.0-83-generic
 Operating System: Ubuntu 22.04.1 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.24GiB
 Name: cloud1
 ID: 5CEL:QS5C:PJJ3:KHPF:AEKV:CQ7P:SAQS:UMKQ:VN7T:WI5C:KRDT:7CL7
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false


### Docker Compose config

_No response_

### Logs

```text
See above

Additional info

No response

@IamTheFij
Copy link
Contributor

If I look at that line, I can see that it’s failing to set config.TLSConfig.Insecure because config.TLSConfig must be null.

This is a bug, but one that shouldn’t impact you. Your URL is using HTTP and not TLS, so you can remove the line from your config.

@IamTheFij
Copy link
Contributor

@crazy-max you can assign this one to me to fix. I know what needs to be done, but it may take some time for me to get around to.

This also becomes even lower priority in the next release because the new socket API is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants