CiscoCloud / marathon-consul

bridge Marathon information to Consul KV
Apache License 2.0
85 stars 18 forks source link

Error using marathon location args as consul service name #19

Closed Neuw84 closed 8 years ago

Neuw84 commented 8 years ago

EDIT: Was misconfiguration problem

Running this marathon-consul in one of my Mesos slaves slaves does not work using the consul dns service.

sudo docker run -i -t ciscocloud/marathon-consul --marathon-location=marathon.service.consul:8080  --registry=http://consul.service.consul:8500       --registry=http://consul.service.consul:8500 --log-level=debug

I get the following


DEBU[0000] asking Marathon for its version               location=marathon.service.consul:8080
INFO[0000] syncing apps                                 
DEBU[0000] asking Marathon for apps                      location=marathon.service.consul:8080
ERRO[0003] Get http://:@marathon.service.consul:8080/v2/info: dial tcp: lookup marathon.service.consul: no such host  location=marathon.service.consul:8080 protocol=http statusCode=???
WARN[0003] version parsing failed, assuming >= 0.9.0     error=Get http://:@marathon.service.consul:8080/v2/info: dial tcp: lookup marathon.service.consul: no such host
INFO[0003] detected Marathon events endpoint             version=0.9.0
ERRO[0003] Get http://:@marathon.service.consul:8080/v2/apps: dial tcp: lookup marathon.service.consul: no such host  location=marathon.service.consul:8080 protocol=http statusCode=???
ERRO[0003] HTTP request for /v2/events failed!           error=Get http://:@marathon.service.consul:8080/v2/events: dial tcp: lookup marathon.service.consul: no such host
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x402a74]

goroutine 1 [running]:
main.SubscribeToEventStream(0xc20808c300, 0x7ffe4aee0ef4, 0x1c, 0x7895c0, 0x4, 0xc20803ad80, 0x0, 0xc20801cd80)
    /go/src/github.com/CiscoCloud/marathon-consul/main.go:65 +0x1264
main.main()
    /go/src/github.com/CiscoCloud/marathon-consul/main.go:54 +0xa05

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1

Any hints on building dynamically this URL?

If I use one of the Marathon Masters IPs, it resolves the consul IP correctly, then resolving this should be easy (if a am sending the marathon URL correctly)