Raft_protocol version 5 is not supported by this version of Consul

The version of consul in one of the images that I am working with was updated to 1.9.5 a few months ago. The version of raft_protocol that was set at that time was 5 (however, I don’t see any reference to a version 5 for raft_protocol - is there currently a version 5 for raft?). It has not caused an issue up until now - the following error appears, “raft_protocol version 5 is not supported by this version of Consul” (using this command: kubectl logs -f pod-name -c consulagent → consulagent runs as a sidecar of the main container) - it causes the pod to enter into a CrashLoopBackOff.

My question is, why only now has this issue popped up? I see in the docs that, “Consul 1.8 supported Raft protocols 2 and 3. Consul 1.9.0 now only supports Raft protocol 3” - is this a recent thing? If raft_protocol never had a version 5, why didn’t this cause an issue initially?

UPDATE: Thanks to @maxb the max version of raft seems to be 3 - since it was previously set to 5 for this image, why was this never validated before? Was this only added recently?

As described in this file:
the highest Raft protocol version in existence today is 3.

Perhaps the validation for the option was incorrect in the past.

Hey @maxb , thanks for that. Do you know how the version of raft is validated?

In current Consul, 3 is the only valid value and all others will give the error you see.

Hey @maxb do you know when this validation was introduced? We have been using consul 1.9.5 for a few months with the raft protocol set to 5 but it’s only recently that we encountered this issue

Judging from GitHub it appears to have been introduced in 1.9.0