stefanprodan / podinfo

Go microservice template for Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"error":"dial tcp: missing address","server":"podinfo-redis:6379"

mikescholl-sysdig opened this issue · comments

Issue

Attempting to test some redis monitoring and the podinfo main application can't seem to connect to the redis pods,

values.yml

cache: "podinfo-redis:6379"
# Redis deployment
redis:
  enabled: true
  repository: redis
  tag: 6.0.8

deployment logs

❯ kubectl logs -n podinfo deployment/podinfo
Found 2 pods, using pod/podinfo-65d549885d-f8d2j
{"level":"info","ts":"2022-04-11T23:02:22.027Z","caller":"podinfo/main.go:150","msg":"Starting podinfo","version":"6.1.2","revision":"","port":"9898"}
{"level":"info","ts":"2022-04-11T23:02:22.032Z","caller":"api/server.go:265","msg":"Starting HTTP Server.","addr":":9898"}
{"level":"warn","ts":"2022-04-11T23:02:22.032Z","caller":"api/cache.go:159","msg":"cache server is offline","error":"dial tcp: missing address","server":"podinfo-redis:6379"}
{"level":"warn","ts":"2022-04-11T23:02:52.032Z","caller":"api/cache.go:159","msg":"cache server is offline","error":"dial tcp: missing address","server":"podinfo-redis:6379"}
{"level":"warn","ts":"2022-04-11T23:03:22.036Z","caller":"api/cache.go:159","msg":"cache server is offline","error":"dial tcp: missing address","server":"podinfo-redis:6379"}
{"level":"warn","ts":"2022-04-11T23:03:52.032Z","caller":"api/cache.go:159","msg":"cache server is offline","error":"dial tcp: missing address","server":"podinfo-redis:6379"}

I'm able to nslookup the podinfo-redis service which returns the correct address. I also spun up a test redis-cli container and was able to connect successfully.

redis-cli test

root@redis-cli:/data# redis-cli -h podinfo-redis -p 6379
podinfo-redis:6379> exit
root@redis-cli:/data# redis-cli -h podinfo-redis -p 6379 --stat
------- data ------ --------------------- load -------------------- - child -
keys       mem      clients blocked requests            connections          
1          866.85K  2       0       7556 (+0)           641         
1          866.85K  2       0       7569 (+13)          642         
1          866.85K  2       0       7573 (+4)           642         
1          866.85K  2       0       7580 (+7)           642         
1          866.85K  2       0       7584 (+4)           642         
1          866.85K  2       0       7588 (+4)           642         
1          866.85K  2       0       7592 (+4)           642         
1          866.85K  2       0       7596 (+4)           642  

@stefanprodan I believe adding tcp:// in front of my cache definition may have resolved this as I'm getting cache hits now. May be something to fix in the helm chart docs or in code

I guess #180 broke it. Thanks for digging into it.