Skip to content

etcd snapshot restore command is invalid in libetcd.sh #92968

@geeky-akshay

Description

@geeky-akshay

Name and Version

bitnami/etcd:3.6.4

What steps will reproduce the bug?

  1. create 3 node etcd cluster using bitnami/etcd helm chart
  2. enable disaster recovery feature and enable bitnami debug logs (BITNAMI_DEBUG=true)
  3. Wait for etcd-snapshotter-job to take first snapshot (you can set cron schedule to take more fruquent backup )
  4. now, scale etcd replica count to 0 (kubectl scale --replicas 0 sts/<your-etcd-sts-name>)
  5. wait for all 3 pod to get terminated
  6. scale etcd pods back to 3 again and immediately tail the logs of any etcd pod (kubectl logs -f <pod-name>)
  7. you'll see that snapshot restore command is wrong. see below error
etcd 04:25:56.33 INFO  ==> Restoring etcd cluster from snapshot /snapshots/db-2026-05-08_04-25
Error: unknown flag: --name
NAME:
  snapshot - Manages etcd node snapshots

USAGE:
  etcdctl snapshot <subcommand> [flags]

API VERSION:
  3.6

Examples:
  # Save snapshot to a given file
  etcdctl snapshot save /backup/etcd-snapshot.db

  # Get snapshot from given address and save it to file
  etcdctl snapshot save --endpoints=127.0.0.1:3000 /backup/etcd-snapshot.db

  # Get snapshot from given address with certificates
  etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.crt --cert=/etc/etcd/etcd.crt --key=/etc/etcd/etcd.key snapshot save /backup/etcd-snapshot.db

  # Get snapshot wih certain user and password
  etcdctl --user=root --password=password123 snapshot save /backup/etcd-snapshot.db

  # Get snapshot from given address with timeout
  etcdctl --endpoints=https://127.0.0.1:2379 --dial-timeout=20s snapshot save /backup/etcd-snapshot.db

  # Save snapshot with desirable time format
  etcdctl snapshot save /mnt/backup/etcd/backup_$(date +%Y%m%d_%H%M%S).db

COMMANDS:
  save  Stores an etcd node backend snapshot to a given file

OPTIONS:
  -h, --help[=false]    help for snapshot

GLOBAL OPTIONS:
      --cacert=""                               verify certificates of TLS-enabled secure servers using this CA bundle
      --cert=""                                 identify secure client using this TLS certificate file
      --command-timeout=5s                      timeout for short running command (excluding dial timeout)
      --debug[=false]                           enable client-side debug logging
      --dial-timeout=2s                         dial timeout for client connections
  -d, --discovery-srv=""                        domain name to query for SRV records describing cluster endpoints
      --discovery-srv-name=""                   service name to query when using DNS discovery
      --endpoints=[127.0.0.1:2379]              gRPC endpoints
      --hex[=false]                             print byte strings as hex encoded strings
      --insecure-discovery[=true]               accept insecure SRV records describing cluster endpoints
      --insecure-skip-tls-verify[=false]        skip server certificate verification (CAUTION: this option should be enabled only for testing purposes)
      --insecure-transport[=true]               disable transport security for client connections
      --keepalive-time=2s                       keepalive time for client connections
      --keepalive-timeout=6s                    keepalive timeout for client connections
      --key=""                                  identify secure client using this TLS key file
      --max-recv-bytes=0                        client-side response receive limit in bytes (if 0, it defaults to "math.MaxInt32")
      --max-request-bytes=0                     client-side request send limit in bytes (if 0, it defaults to 2.0 MiB (2 * 1024 * 1024).)
      --password=""                             password for authentication (if this option is used, --user option shouldn't include password)
      --user=""                                 username[:password] for authentication (prompt if password is not supplied)
  -w, --write-out="simple"                      set the output format (fields, json, protobuf, simple, table)

What is the expected behavior?

the command to restore snapshot is etcdutl snapshot restore

What do you see instead?

in the libetcd.sh etcdctl snapshot restore command is used.
See: https://github.com/bitnami/containers/blob/main/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/libetcd.sh#L681

                        debug_execute etcdctl snapshot restore "${latest_snapshot_file}" \
                            --name "$ETCD_NAME" \
                            --data-dir "$ETCD_DATA_DIR" \
                            --initial-cluster "$ETCD_INITIAL_CLUSTER" \
                            --initial-cluster-token "$ETCD_INITIAL_CLUSTER_TOKEN" \
                            --initial-advertise-peer-urls "$ETCD_INITIAL_ADVERTISE_PEER_URLS"

Additional information

No response

Metadata

Metadata

Assignees

Labels

etcdsolvedstale15 days without activitytech-issuesThe user has a technical issue about an applicationtriageTriage is needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions