[etcd] use clientv3 forcibly if user requested#5128
Conversation
etcd storage auto detects cluster version. Unfortunately though,
the auto detection sometimes detect v3 cluster as v2.
Worse, even if a user specifies the cluster version in HCL as
storage "etcd" {
etcd_api = "v3"
...
}
vault denies to start with this error message:
etcd3 is required: etcd2 is running
This commit eliminates this version check to work around the
auto detection problem because the check is in fact unnecessary
as the user explicitly requested to connect with v3 protocol.
|
Have you reported this to the etcd project? Feels like having this check in there is good, it's the cluster reporting the wrong version that should be solved. |
|
Not yet because we never use v2 protocol just as used in Vault when That said, I still think the version check code is not necessary here.
|
|
Additional note: We tested Vault with this patch in house and confirmed the problem just disappeared. |
|
I have investigated the problem further and find these things:
Verified that the problem occurs when etcd reports its cluster version as "3.0.0". I cannot find the reason why Vault requires >= 3.1.0 as it is just implemented so in #2299. |
|
@jefferai What are your thoughts on this? |
|
I think you should open up a bug with coreos and/or etcd. I agree that it would be nice for this to be fixed, but they wrote the Vault code in the first place, so if there is an incompatibility with their own software then it's clearly a workflow that needs to be sorted out. |
|
Also where do you see the 3.1 requirement? The check in Vault looks for a remote API version of 3. |
|
Thank you for the advise. I will open an issue with etcd.
Here: Line 97 in 6c6ead7 The function returns remote API as 2 for "3.0.0". |
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
|
I'm closing this because:
|
etcd storage auto detects cluster version. Unfortunately though,
the auto detection sometimes detect v3 cluster as v2 (I will open
another issue for this problem; edit #5129).
Worse, even if a user specifies the cluster version in HCL as:
vault denies to start with this error message:
This commit eliminates this version check to work around the
auto detection problem because the check is in fact unnecessary
as the user explicitly requested to connect with v3 protocol.