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

etcdctl returning wrong exit code #12138

Closed
manjeetvk opened this issue Jul 14, 2020 · 1 comment
Closed

etcdctl returning wrong exit code #12138

manjeetvk opened this issue Jul 14, 2020 · 1 comment
Labels

Comments

@manjeetvk
Copy link

manjeetvk commented Jul 14, 2020

We are testing clients against etcd port blocking using iptables.
Here are the iptable details, blocking 2379 INPUT and OUTPUT ports:

Chain INPUT (policy ACCEPT 17776 packets, 2046K bytes)
pkts bytes target prot opt in out source destination
0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:2379

Chain OUTPUT (policy ACCEPT 26279 packets, 2279K bytes)
pkts bytes target prot opt in out source destination
521 29332 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:2379

So, when we are trying to access the key details in etcd, we are getting 4 as return code instead of 2.

$ /bin/sh -c 'etcdctl --debug get /test.com/foo;RC=$?; echo $RC'
start to sync cluster using endpoints(http://127.0.0.1:4001,http://127.0.0.1:2379)
cURL Command: curl -X GET http://127.0.0.1:4001/v2/members
cURL Command: curl -X GET http://127.0.0.1:2379/v2/members
got endpoints(http://127.0.0.1:4001,http://127.0.0.1:2379) after sync
Cluster-Endpoints: http://127.0.0.1:4001, http://127.0.0.1:2379
cURL Command: curl -X GET http://127.0.0.1:4001/v2/keys/test.com/foo?quorum=false&recursive=false&sorted=false
cURL Command: curl -X GET http://127.0.0.1:2379/v2/keys/test.com/foo?quorum=false&recursive=false&sorted=false
Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp 127.0.0.1:4001: connect: connection refused
; error #1: client: endpoint http://127.0.0.1:2379 exceeded header timeout

error #0: dial tcp 127.0.0.1:4001: connect: connection refused
error #1: client: endpoint http://127.0.0.1:2379 exceeded header timeout

4

etcdctl version:
$ etcdctl -v
etcdctl version: 3.3.20
API version: 2

@stale
Copy link

stale bot commented Oct 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 12, 2020
@stale stale bot closed this as completed Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant