Context deadline exceeded- ETCD cluster config

i was following this video from the kodekloud playlist- https://www.youtube.com/watch?v=5Rf1TnuOQXQ&list=PL2We04F3Y_41jYdadX55fdJplDvgNGENo&index=9

but when i type-
sudo ETCDCTL_API=3 etcdctl member list
–endpoints=https://127.0.0.1:2379
–cacert=/etc/etcd/ca.crt
–cert=/etc/etcd/etcd-server.crt
–key=/etc/etcd/etcd-server.key

it says-
{“level”:“warn”,“ts”:“2024-05-04T14:02:35.873462Z”,“logger”:“etcd-client”,“caller”:“[email protected]/retry_interceptor.go:62”,“msg”:“retrying of unary invoker failed”,“target”:“etcd-endpoints://0xc0000f48c0/127.0.0.1:2379”,“attempt”:0,“error”:“rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused"”}
Error: context deadline exceeded

the same issue has also been reported in the youtube video comments, how to fix that?
note: I have checked the service statue using- “systemctl status etcd” and it says active

The Kubernetes-The-Hardway videos are a little old; we’ve updated the repo they’re based upon recently, to make things easier to follow and try on your own. But the link to the repo is the same: GitHub - mmumshad/kubernetes-the-hard-way: Bootstrap Kubernetes the hard way on Vagrant on Local Machine. No scripts.

well, i also followed the repo instruction, but the issue persists, i checked the etcd service in both the my control plane, they are up and running , just couldnt figure out the issue

Have you tried using PRIMARY_IP instead of 127.0.0.1 for --endpoints?

yes, same result

Looks to me that etcd isn’t happy, or you have some sort of network issue.
The github code was last tested in March this year and was all good.

What does

journalctl -u etcd

say? Any obvious error messages?

here is the journalctl log-
left pane view-

Solution-

thanks for pointing out the log file. I was having issue with the environment variable https://${CONTROL01}:2380 in etcd.service. Fixed it. Thanks