Context cancelled in migrating from file to raft storage

Hello,

I’m trying to migrate from a standalone instance with file storage to ha instance with raft storage. All this in a Kubernetes cluster using th helm chart.

I’ve tried a lot of things and the procedure is not cleat at all for me.

In the mounted volume I copied all files from /vault/data/standalone and configured my ha cluster to get data from /vault/data/raft

The last thing I tried is migrate with the following conf :

storage_source "file" {
  path    = "/vault/data/standalone"
}

storage_destination "raft" {
  path = "/tmp/vault" # I use a temporary path as it is apparently just used to copy files
}

cluster_addr = "https://vault-internal.common.svc.cluster.local:8200"

Here are the logs :

2024-07-30T07:46:47.212Z [DEBUG] fsm: time to open database: elapsed=2.153026ms path=/tmp/vault/vault.db
2024-07-30T07:46:47.221Z [INFO]  creating Raft: config="&raft.Config{ProtocolVersion:3, HeartbeatTimeout:5000000000, ElectionTimeout:5000000000, CommitTimeout:50000000, MaxAppendEntries:64, BatchApplyCh:true, ShutdownOnRemove:true, TrailingLogs:0x2800, SnapshotInterval:120000000000, SnapshotThreshold:0x2000, LeaderLeaseTimeout:2500000000, LocalID:\"d7d2cdcb-9888-81f1-e8a5-83734745928f\", NotifyCh:(chan<- bool)(0xc0033fbab0), LogOutput:io.Writer(nil), LogLevel:\"DEBUG\", Logger:(*hclog.intLogger)(0xc00347f8c0), NoSnapshotRestoreOnStart:true, skipStartup:false}"
2024-07-30T07:46:47.222Z [INFO]  initial configuration: index=1 servers="[{Suffrage:Voter ID:d7d2cdcb-9888-81f1-e8a5-83734745928f Address:vault-internal.common.svc.cluster.local:8200}]"
2024-07-30T07:46:47.222Z [INFO]  entering follower state: follower="Node at d7d2cdcb-9888-81f1-e8a5-83734745928f [Follower]" leader-address= leader-id=
2024-07-30T07:46:54.013Z [WARN]  heartbeat timeout reached, starting election: last-leader-addr= last-leader-id=
2024-07-30T07:46:54.013Z [INFO]  entering candidate state: node="Node at d7d2cdcb-9888-81f1-e8a5-83734745928f [Candidate]" term=2
2024-07-30T07:46:54.015Z [DEBUG] voting for self: term=2 id=d7d2cdcb-9888-81f1-e8a5-83734745928f
2024-07-30T07:46:54.017Z [DEBUG] calculated votes needed: needed=1 term=2
2024-07-30T07:46:54.017Z [DEBUG] vote granted: from=d7d2cdcb-9888-81f1-e8a5-83734745928f term=2 tally=1
2024-07-30T07:46:54.017Z [INFO]  election won: term=2 tally=1
2024-07-30T07:46:54.017Z [INFO]  entering leader state: leader="Node at d7d2cdcb-9888-81f1-e8a5-83734745928f [Leader]"
2024-07-30T07:46:54.029Z [INFO]  copied key: path=auth/3d45521e-b7c5-3bd9-5d41-abeb8e001fb4/role/core
2024-07-30T07:46:54.029Z [INFO]  copied key: path=auth/3d45521e-b7c5-3bd9-5d41-abeb8e001fb4/role/certification
2024-07-30T07:46:54.029Z [INFO]  copied key: path=auth/2dd402ff-1038-1f2c-de1e-e9816ca4c85d/config
[...]
2024-07-30T07:47:07.234Z [INFO]  copied key: path=backup/data/sys/expire/id/database/client/trace/mariadb/creds/module/rrfQM7L8c2BJK4b9gQ3mJKd8
2024-07-30T07:47:07.234Z [INFO]  copied key: path=backup/data/sys/expire/id/database/client/trace/mariadb/creds/module/ruEciwLnbQZBLnet8V7zAvzV
Error migrating: context canceled

I don’t get any idea on why I got the context canceled error, all I’ve seen related to this error doesn’t match my case.

Anyone have any idea?

Please, someone can help, we are stuck on this