Kubernetes - Unable to initialize control-plane - docker

Can someone please help
I'm getting the following error when I run 'kubeadm init'
[init] Using Kubernetes version: v1.25.0
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.25.0: output: E0901 16:50:43.675142 4165 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-apiserver/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-apiserver:v1.25.0"
time="2022-09-01T16:50:43-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-apiserver/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-controller-manager:v1.25.0: output: E0901 16:53:14.264007 4564 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-controller-manager/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-controller-manager:v1.25.0"
time="2022-09-01T16:53:14-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-controller-manager/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-scheduler:v1.25.0: output: E0901 16:55:44.364804 4922 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-scheduler/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-scheduler:v1.25.0"
time="2022-09-01T16:55:44-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-scheduler/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-proxy:v1.25.0: output: E0901 16:58:14.769855 5295 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-proxy:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-proxy:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-proxy/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-proxy:v1.25.0"
time="2022-09-01T16:58:14-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-proxy:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-proxy:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-proxy/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/etcd:3.5.4-0: output: E0901 17:03:14.966455 6024 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/etcd:3.5.4-0\": failed to resolve reference \"registry.k8s.io/etcd:3.5.4-0\": failed to do request: Head https://registry.k8s.io/v2/etcd/manifests/3.5.4-0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/etcd:3.5.4-0"
time="2022-09-01T17:03:14-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/etcd:3.5.4-0\": failed to resolve reference \"registry.k8s.io/etcd:3.5.4-0\": failed to do request: Head https://registry.k8s.io/v2/etcd/manifests/3.5.4-0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
I'm unable to initialize control-plane, made sure that docker is running.
kubectl, kubeadm is also working.
Does it look like issue on the K8 side, or did I do anything wrong.

As per output ,it does look like some connectivity issue due to following line , probably slow or no connectivity
failed to pull image registry.k8s.io******
can you check the connectivity to image registry with following
ping registry.k8s.io
You should get the response from server ,If you donot get the response back ,need to troubleshoot for network connectivity
PING registry.k8s.io(2600:1901:0:1013:: (2600:1901:0:1013::)) 56 data bytes
64 bytes from 2600:1901:0:1013:: (2600:1901:0:1013::): icmp_seq=1 ttl=56 time=69.1 ms
64 bytes from 2600:1901:0:1013:: (2600:1901:0:1013::): icmp_seq=2 ttl=56 time=83.9 ms
64 bytes from 2600:1901:0:1013:: (2600:1901:0:1013::): icmp_seq=3 ttl=56 time=83.4 ms

Look at the error message
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.25.0
The images are not getting pulled and hence the ImagePull error is thrown.
You should have internet connectivity from the machine where the initialize command was run.

Related

Hyperledger fabric - Cant connect peer to channel - endorser client failed to connect - connection refused

I created a testchannel and tried to join peer to it using the codes below.
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp
export CORE_PEER_ADDRESS=peer1.org1.example.com:7051
peer channel join -b testchannel.block
But connection error occured as below.
Error: error getting endorser client for channel: endorser client failed to connect to peer1.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 172.18.0.3:7051: connect: connection refused"
I tried the solutions mentioned in other similar posts such as changing the CORE_PEER_TLS_ENABLED but it still occured. How to solve it? Thanks!
You will need to check the docker log of the peer
docker logs <container id>
There is insufficient information provided to help you.

Hyperledger Fabric V2.3 Snapshot: failed to create new connection: context deadline exceeded

I'm running Fabric v2.3 test network, and I'm trying to take a snapshot of the ledger.
When I run:
# peer snapshot submitrequest -c mychannel -b 0 --peerAddress peer0.org1.example.com:7051 --tlsRootCertFile /opt/gopath/src/github.com/hyperledger/fabric/peer/o
rganizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
I obtain:
Error: failed to retrieve snapshot client: snapshot client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
The cli container can connect to peer1. Inspecting the orderer logs, it seems that a connection to 172.19.0.1 (on variable ports) is not successful: https://gist.github.com/RafaelAPB/962477f9bab5f34076add1a3b9f63588
Part of it:
2021-10-04 00:31:54.519 UTC [common.deliver] Handle -> WARN 066 Error reading from 172.19.0.8:53714: rpc error: code = Canceled desc = context canceled
By inspecting the logs of peer0.org1, it really seems that the problem is the connection with the orderer (in particular the TLS handshake): https://gist.github.com/RafaelAPB/6adf0c6e702387e4e0edd8de0dcf0a76
Part of it:
2021-10-04 00:52:03.595 UTC [comm.grpc.server] 1 -> INFO e6d unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.19.0.1:52374 grpc.code=OK grpc.call_duration=4.028085ms
2021-10-04 00:52:04.293 UTC [core.comm] ServerHandshake -> ERRO e6e Server TLS handshake failed in 33.508µs with error tls: first record does not look like a TLS handshake server=PeerServer remoteaddress=172.19.0.8:58532
2021-10-04 00:52:04.419 UTC [gossip.privdata] StoreBlock -> INFO e6f Received block [505] from buffer channel=mychannel
No configurations were added to the configtx.yaml regarding the snapshotting feature.
Any ideas on how to run the snapshot command successfully?

grpc: RPC failed fast due to transport failure when starting the peer node for fabric

I tried to build the development environment of fabric using the guide at https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/devenv.md
After vagrant ssh into the VM, I wanted to start a peer node to test the example chaincode to verify if I have set the environment correctly, so with the guide at https://github.com/hyperledger/fabric/blob/master/docs/Setup/Chaincode-setup.md
I make peer, and started the peer node by peer node start --peer-chaincodedev, but error appeared:
[crypto] Errorf -> ERRO 008 [validator.vp] Failed requesting read certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
[crypto] Errorf -> ERRO 009 [validator.vp] Failed requesting ECA certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
[crypto] Errorf -> ERRO 00a [validator.vp] Failed getting ECA certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
[crypto] Errorf -> ERRO 00b [validator.vp] Failed retrieving ECA certs chain [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
[crypto] Errorf -> ERRO 00c [validator.vp] Failed registering node crypto engine [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
[crypto] Errorf -> ERRO 00d [validator.vp] Failed registering peer [vp]: [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure]
[crypto] Errorf -> ERRO 00e [validator.vp] Failed registering [vp]: [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure]
grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::1]:7054: getsockopt: connection refused"; Reconnecting to {"localhost:7054" <nil>}
Failed to dial localhost:7054: grpc: the connection is closing; please retry.
I've also tried the optional step of security setup, make membersrvc and run it, but when running membersrvc, there is no output and no stop but just staying at there for several hours.
I have no idea why this appears and there seems no one else meeting the same problem with me after two-day searching. Please help me, thanks!

Docker option2, transport is closing error

I was trying the simple chain code, with membersvc and validation peer running in Docker for Mac. I got this error when running the chain code example 2:
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=localhost:30303 ./chaincode_example02
16:58:41.242 [shim] DEBU : Peer address: localhost:30303
16:58:41.244 [shim] DEBU : os.Args returns: [./chaincode_example02]
16:58:41.244 [shim] DEBU : Registering.. sending REGISTER
2016/08/22 16:58:41 transport: http2Client.notifyError got notified that the client transport was broken EOF.
16:58:41.245 [shim] ERRO : Received error from server: rpc error: code = 13 desc = "transport is closing", ending chaincode stream
Error starting Simple chaincode: rpc error: code = 13 desc = "transport is closing"
This issue is resolved with the latest docker build with the latest docker-compose file.

deisctl list command raises a timeout error what am I doing wrong

help in "deisctl list" I have just started with deis and am following the tutorial of using deis in vagrant
am stuck at the part am doing deisctl list am getting this as the output
INFO client.go:291: Failed getting response from http://127.0.0.1:4001/: ssh: rejected: connect failed (Connection refused)
Error: timeout reached
Your DEISCTL_TUNNEL value is either incorrect or unreachable due to networking/routing/firewall, etc...

Resources