Error initializing storage of type raft: failed to create fsm: failed to open bolt file: open /data/vault.db: ped

Heya all :wave:

Having trouble even spinning up the simplest of Vault using Docker Swarm on Docker for Mac.

Here’s my docker-stack.yml:

---
version: "3.8"

services:
  vault:
    image: vault:latest
    environment:
      VAULT_LOCAL_CONFIG: >-
        ui = true
        disable_mlock = true
        storage "raft" {
          path = "/data"
          node_id = "raft_node_1"
        }
        listener "tcp" {
          address = "vault:8200"
        }
        api_addr = "http://valt:8201"
        cluster_addr = "http://vault:8201"
    command: server
    volumes:
      - vault:/data
    networks:
      - vault
    ports:
      - 8200:8200/tcp
    deploy:
      resources:
        reservations:
          cpus: '.25'
          memory: 256M
        limits:
          cpus: '.50'
          memory: 512M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
      update_config:
        order: stop-first

networks:
  vault:
    driver: overlay

volumes:
  vault:
    driver: local

If you google around for that error you end up with (incorrectly) references to things talking about “shared volumes”. This isn’t the case here. This is something else and the error “ped” is really unhelpful.

Anyone run into this?

Kind regards

James

Hey James,

Not much experience with Docker, but that Vault config looks a bit odd: normally your cluster address is a +1 of your api address (so, typically, your api_addr is on 8200/tcp). Also, there’s a typo in the api_addr of valt.

Not sure whether that’s your problem, though.

JJ

I’m more concerned with the Bolt error at the moment :grin:

1 Like

did you ever solve this? put you raft data into /vault/file and mount that with a volume seems to work.

I don’t recall sadly.

Sorry :confused:

cheers
James

I could get an answer by looking at the docker readme.
So the docker image already exposes a persistent volume for data storage. Path is /vault/file. Use the same in raft config.


storage "raft" {
  path    = "/vault/file"
  node_id = "node1"
}
1 Like

It’s seems a bit misleading though. The documentation says the /vault/file volume is to be used when using the file storage plugin:

/vault/file , to use for writing persistent storage data when using the file data storage plugin.

It does indeed work when raft is configured though.