Skip to content

Unhelpful raft unseal error and outdated documentation #8864

@mishak87

Description

@mishak87

Describe the bug
Vault starts but on last unseal key vault returns 500 and confusing error message because of raft configuration error.

{"errors":["strconv.Atoi: parsing \"1\\n\": invalid syntax"]}

To Reproduce
Steps to reproduce the behavior:

  1. Start vault 1.4.0 cluster with raft storage
  2. Change node configuration performance_multiplier to 1 (integer not string)
  3. Restart vault node
  4. Try to unseal

Expected behavior
Helpful error message or behavior according to documentation.

Additional context

Documentation refers to performance_multiplier as int https://www.vaultproject.io/docs/configuration/storage/raft#performance_multiplier
Tests use string and strconv.Atoi

"performance_multiplier": "5",

Environment:

#deploy> docker stack deploy -c ${file} vault
version: "3.7"
services:
  vault-a: &service
    image: vault:1.4.0
    command: server
    environment: &environment
      #
      # NODE settings
      #
      VAULT_API_ADDR: "http://vault-a:8200"
      VAULT_CLUSTER_ADDR: https://vault-a:8201
      VAULT_RAFT_NODE_ID: vault-raft-a
      #
      # GLOBAL settings
      #
      # disable setcap in entrypoint cap_add is not supported by docker swarm
      # see: https://docs.docker.com/compose/compose-file/#cap_add-cap_drop
      SKIP_SETCAP: "1"
      # enable vault UI
      VAULT_UI: "1"
      VAULT_RAFT_PATH: /vault/file
      # !!! fix is to pass performance_multiplier value as a string "1" !!!
      VAULT_LOCAL_CONFIG: |
        {
            "listener": [{"tcp": {
                "address": "0.0.0.0:8200",
                "tls_disable": true,
                "cluster_address": "0.0.0.0:8201"
            }}],
            "disable_mlock": true,
            "storage": [{"raft": {
                "path": "/vault/file",
                "performance_multiplier": !!! 1 !!!,
                "retry_join": [
                    { "leader_api_addr": "http://vault-a:8200" },
                    { "leader_api_addr": "http://vault-b:8200" },
                    { "leader_api_addr": "http://vault-c:8200" }
                ]
            }}]
        }

  vault-b:
    <<: *service
    environment:
      <<: *environment
      VAULT_API_ADDR: "http://vault-b:8200"
      VAULT_CLUSTER_ADDR: https://vault-b:8201
      VAULT_RAFT_NODE_ID: vault-raft-b
    volumes:
      - vault-b-data:/vault/file

  vault-c:
    <<: *service
    environment:
      <<: *environment
      VAULT_API_ADDR: "http://vault-c:8200"
      VAULT_CLUSTER_ADDR: https://vault-c:8201
      VAULT_RAFT_NODE_ID: vault-raft-c
    volumes:
      - vault-c-data:/vault/file

volumes:
  vault-a-data: {}
  vault-b-data: {}
  vault-c-data: {}

Metadata

Metadata

Assignees

Labels

bugUsed to indicate a potential bugcore/config

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions