You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to leverage AWS Keyspaces (Apache Cassandra compatible serverless implementation) as a backend, Vault is unable to establish an initial connection. When the connection is initially established, the consistency level is hard coded to Quorum for the connection and then is updated after the connection is established.
AWS Kesyspaces only supports the following consistency levels:
ONE
LOCAL_ONE
LOCAL_QUORUM
During the setup of the connection, the Cassandra backend verifies that the consistency is set and defaults to LOCAL_QUORUM which is supported by AWS Keyspaces however that default consistency is not passed to the gocql driver prior to starting the session. If the consistency is not passed to gocql prior to initialization, the client defaults to QUORUM which is not supported.
The configured consistency is validated with the cassandra.go physical package:
ifcs, ok:=conf["consistency"]; ok {
switchcs {
case"ANY":
consistency=gocql.Anycase"ONE":
consistency=gocql.Onecase"TWO":
consistency=gocql.Twocase"THREE":
consistency=gocql.Threecase"QUORUM":
consistency=gocql.Quorumcase"ALL":
consistency=gocql.Allcase"LOCAL_QUORUM":
consistency=gocql.LocalQuorumcase"EACH_QUORUM":
consistency=gocql.EachQuorumcase"LOCAL_ONE":
consistency=gocql.LocalOnedefault:
returnnil, fmt.Errorf("'consistency' must be one of {ANY, ONE, TWO, THREE, QUORUM, ALL, LOCAL_QUORUM, EACH_QUORUM, LOCAL_ONE}")
}
}
After validation however, the session is established prior to setting the consistency level within the gocql client:
2023/12/29 11:11:26 error: failed to connect to 3.234.248.236:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:26 error: failed to connect to 3.238.167.216:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:26 error: failed to connect to 3.238.167.154:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:26 error: failed to connect to 3.234.248.208:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:26 error: failed to connect to 3.234.248.227:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:26 error: failed to connect to 3.234.248.207:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:26 error: failed to connect to 3.238.167.151:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:27 error: failed to connect to 3.238.167.236:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:27 error: failed to connect to 3.234.248.220:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
2023/12/29 11:11:27 error: failed to connect to 3.234.248.253:9142 due to error: Consistency level QUORUM is not supported for this operation. Supported consistency levels are: ONE, LOCAL_QUORUM, LOCAL_ONE
Error initializing storage of type cassandra: no connections were made when creating the session
2023-12-29T11:11:25.625-0800 [INFO] proxy environment: http_proxy="" https_proxy="" no_proxy=""
Expected behavior
Vault should respect the configured consistency level and connect to the database successfully
Environment:
Vault Server Version (retrieve with vault status): N/A - Cannot Start due to failed connection
Vault CLI Version (retrieve with vault version): Vault v1.15.4 (9b61934559ba31150860e618cf18e816cbddc630), built 2023-12-04T17:45:28Z
Server Operating System/Architecture: Darwin/Arm64
While attempting to leverage AWS Keyspaces (Apache Cassandra compatible serverless implementation) as a backend, Vault is unable to establish an initial connection. When the connection is initially established, the consistency level is hard coded to
Quorum
for the connection and then is updated after the connection is established.AWS Kesyspaces only supports the following consistency levels:
During the setup of the connection, the Cassandra backend verifies that the consistency is set and defaults to
LOCAL_QUORUM
which is supported by AWS Keyspaces however that default consistency is not passed to thegocql
driver prior to starting the session. If the consistency is not passed togocql
prior to initialization, the client defaults toQUORUM
which is not supported.The configured consistency is validated with the
cassandra.go
physical package:After validation however, the session is established prior to setting the consistency level within the gocql client:
Within the
gocql
driver used for the underlying connection, the Consitency is defaulted toQuorum
if it is not set prior to callingCreateSession
:To Reproduce
Steps to reproduce the behavior:
Expected behavior
Vault should respect the configured consistency level and connect to the database successfully
Environment:
vault status
): N/A - Cannot Start due to failed connectionvault version
):Vault v1.15.4 (9b61934559ba31150860e618cf18e816cbddc630), built 2023-12-04T17:45:28Z
Vault server configuration file(s):
The text was updated successfully, but these errors were encountered: