{"id":48089045,"url":"https://github.com/vmware/etcd-diagnosis","last_synced_at":"2026-04-04T15:27:07.641Z","repository":{"id":321034119,"uuid":"1082759591","full_name":"vmware/etcd-diagnosis","owner":"vmware","description":" A diagnostic tool for etcd that helps identify and resolve cluster issues efficiently","archived":false,"fork":false,"pushed_at":"2026-02-19T10:09:06.000Z","size":111,"stargazers_count":22,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-08T19:59:34.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T18:15:24.000Z","updated_at":"2026-02-19T10:09:03.000Z","dependencies_parsed_at":"2025-10-27T13:21:10.390Z","dependency_job_id":null,"html_url":"https://github.com/vmware/etcd-diagnosis","commit_stats":null,"previous_names":["vmware/etcd-diagnosis"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vmware/etcd-diagnosis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fetcd-diagnosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fetcd-diagnosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fetcd-diagnosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fetcd-diagnosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware","download_url":"https://codeload.github.com/vmware/etcd-diagnosis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware%2Fetcd-diagnosis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T15:27:03.655Z","updated_at":"2026-04-04T15:27:06.971Z","avatar_url":"https://github.com/vmware.png","language":"Go","readme":"# etcd-diagnosis\n\netcd-diagnosis is a low-level etcd diagnosis tool. See the detailed usage below.\n\n```\n$ ./etcd-diagnosis -h\nA comprehensive etcd diagnosis tool\n\nUsage:\n  etcd-diagnosis [command]\n\nAvailable Commands:\n  bbolt            A simple command line tool for inspecting bbolt databases\n  commit-index     commit-index reads the commit index from data directory.\n  completion       Generate the autocompletion script for the specified shell\n  consistent-index consistent-index reads consistent_index from the meta bucket in the db file.\n  hash             hash computes the hash of db file.\n  help             Help about any command\n  iterate-bucket   iterate-bucket lists key-value pairs in reverse order.\n  list-bucket      list-bucket lists all buckets.\n  log              log dumps the log from data directory.\n  report           report generates a diagnostic report for a running etcd cluster.\n  version          Prints the version of etcd-diagnosis\n\nFlags:\n  -h, --help               help for etcd-diagnosis\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n\nUse \"etcd-diagnosis [command] --help\" for more information about a command.\n```\n\nNote that `report` is the only online command that requires a running\netcd cluster. All other commands are offline and should be executed only\nwhen all etcd instances are stopped. The tool is expected to be executed\non one of the nodes hosting etcd.\n\n- Online commands\n  - [report](#report)\n- Offline commands\n  - [list-bucket](#list-bucket)\n  - [iterate-bucket](#iterate-bucket)\n  - [hash](#hash)\n  - [log](#log)\n  - [consistent-index](#consistent-index)\n  - [commit-index](#commit-index)\n  - [bbolt](#bbolt)\n\n## list-bucket\n`list-bucket` command lists all top-level buckets in an etcd db file.\nThe parameter can be either the path to the etcd data directory or the\ndatabase file itself.\n\nUsage,\n```\n$ ./etcd-diagnosis list-bucket -h\nlist-bucket lists all buckets.\n\nUsage:\n  etcd-diagnosis list-bucket [data dir or db file path] [flags]\n\nFlags:\n  -h, --help   help for list-bucket\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExample,\n```\n$ ./etcd-diagnosis list-bucket ~/tmp/etcd/default.etcd/member/snap/db\nalarm\nauth\nauthRoles\nauthUsers\ncluster\nkey\nlease\nmembers\nmembers_removed\nmeta\n```\n\n## iterate-bucket\n`iterate-bucket` command lists key-value pair of a given bucket in an\netcd db file in reverse order. The first parameter can be either the\npath to the etcd data directory or the database file itself. The second\nparameter is the bucket name.\n\nUsage,\n```\n$ ./etcd-diagnosis iterate-bucket -h\niterate-bucket lists key-value pairs in reverse order.\n\nUsage:\n  etcd-diagnosis iterate-bucket [data dir or db file path] [bucket name] [flags]\n\nFlags:\n      --decode       true to decode Protocol Buffer encoded data\n  -h, --help         help for iterate-bucket\n      --limit uint   max number of key-value pairs to iterate (0 to iterate all)\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExamples,\n```\n$ ./etcd-diagnosis iterate-bucket ~/tmp/etcd/default.etcd/ key --decode\nrev={Revision:{Main:4 Sub:0} tombstone:false}, value=[key \"k3\" | val \"v3\" | created 4 | mod 4 | ver 1]\nrev={Revision:{Main:3 Sub:0} tombstone:false}, value=[key \"k2\" | val \"v2\" | created 3 | mod 3 | ver 1]\nrev={Revision:{Main:2 Sub:0} tombstone:false}, value=[key \"k1\" | val \"v1\" | created 2 | mod 2 | ver 1]\n\n$ ./etcd-diagnosis iterate-bucket ~/tmp/etcd/default.etcd/ meta --decode\nkey=\"term\", value=2\nkey=\"consistent_index\", value=7\nkey=\"confState\", value=\"{\\\"voters\\\":[10276657743932975437],\\\"auto_leave\\\":false}\"\n\n$ ./etcd-diagnosis iterate-bucket ~/tmp/etcd/infra1.etcd/ members --decode\nkey=\"fd422379fda50e48\", value=\"{\\\"id\\\":18249187646912138824,\\\"peerURLs\\\":[\\\"http://127.0.0.1:32380\\\"],\\\"name\\\":\\\"infra3\\\",\\\"clientURLs\\\":[\\\"http://127.0.0.1:32379\\\"]}\"\nkey=\"91bc3c398fb3c146\", value=\"{\\\"id\\\":10501334649042878790,\\\"peerURLs\\\":[\\\"http://127.0.0.1:22380\\\"],\\\"name\\\":\\\"infra2\\\",\\\"clientURLs\\\":[\\\"http://127.0.0.1:22379\\\"]}\"\nkey=\"8211f1d0f64f3269\", value=\"{\\\"id\\\":9372538179322589801,\\\"peerURLs\\\":[\\\"http://127.0.0.1:12380\\\"],\\\"name\\\":\\\"infra1\\\",\\\"clientURLs\\\":[\\\"http://127.0.0.1:2379\\\"]}\"\n\n#  What data is consuming most of the storage space?\n$ ./etcd-diagnosis iterate-bucket ~/box/open_source/etcd/data/k8s_1.21.5/db key --decode | egrep -o '\"/registry.*' | cut -d'|' -f1 | grep -v ^$ | awk -F '/'  '{ h[$3]++ } END {for (k in h) print h[k], k}' | sort -nr\n722 leases\n79 clusterroles\n65 clusterrolebindings\n58 nsx.vmware.com\n57 secrets\n51 serviceaccounts\n42 apiregistration.k8s.io\n36 masterleases\n21 pods\n14 configmaps\n13 rolebindings\n12 services\n12 podsecuritypolicy\n11 roles\n11 flowschemas\n11 apiextensions.k8s.io\n9 replicasets\n9 deployments\n7 prioritylevelconfigurations\n7 namespaces\n6 minions\n6 endpointslices\n4 cns.vmware.com\n3 daemonsets\n3 csinodes\n3 controllerrevisions\n2 ranges\n2 priorityclasses\n1 vmware.com\n1 validatingwebhookconfigurations\n1 storageclasses\n1 persistentvolumes\n1 persistentvolumeclaims\n1 jobs\n1 csidrivers\n```\n\n## hash\n`hash` command computes the hash of the db file. The parameter can be\neither the path to the etcd data directory or the database file itself.\n\nUsage,\n```\n$ ./etcd-diagnosis hash -h\nhash computes the hash of db file.\n\nUsage:\n  etcd-diagnosis hash [data dir or db file path] [flags]\n\nFlags:\n  -h, --help   help for hash\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExample,\n```\n$ ./etcd-diagnosis hash ~/tmp/etcd/default.etcd/\ndb path: /Users/wachao/tmp/etcd/default.etcd/member/snap/db\nHash: 1099832664\n```\n\n## log\n`log` dumps the log from data directory. The parameter must be the\npath to the etcd data directory.\n\nUsage,\n```\n$ ./etcd-diagnosis log -h\nlog dumps the log from data directory.\n\nUsage:\n  etcd-diagnosis log [data dir] [flags]\n\nFlags:\n      --end-index uint      the index to stop dumping (exclusive) (default 18446744073709551615)\n      --entry-type string   If set, filters output by entry type. Must be one or more than one of:\n                            ConfigChange, Normal, Request, InternalRaftRequest,\n                            IRRRange, IRRPut, IRRDeleteRange, IRRTxn,\n                            IRRCompaction, IRRLeaseGrant, IRRLeaseRevoke, IRRLeaseCheckpoint (default \"Normal,ConfigChange\")\n  -h, --help                help for log\n      --raw                 read the logs in the low-level form\n      --start-index uint    the index to start dumping (inclusive). If unspecified, dumps from the index of the last snapshot\n      --start-snap string   the base name of snapshot file to start dumping\n      --wal-dir string      if set, dumps WAL from the informed path, rather than following the standard 'data_dir/member/wal/' location\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExample,\n```\n$ ./etcd-diagnosis log ~/tmp/etcd/infra1.etcd/\nSnapshot:\nempty\nStart dumping log entries from snapshot.\nWAL metadata:\nnodeID=8211f1d0f64f3269 clusterID=ef37ad9dc622a7c4 term=2 commitIndex=22 vote=91bc3c398fb3c146\nWAL entries: 23\nlastIndex=23\nterm\t     index\ttype\tdata\n   1\t         1\tconf\tmethod=ConfChangeAddNode id=8211f1d0f64f3269\n   1\t         2\tconf\tmethod=ConfChangeAddNode id=91bc3c398fb3c146\n   1\t         3\tconf\tmethod=ConfChangeAddNode id=fd422379fda50e48\n   2\t         4\tnorm\n   2\t         5\tnorm\tmethod=PUT path=\"/0/members/91bc3c398fb3c146/attributes\" val=\"{\\\"name\\\":\\\"infra2\\\",\\\"clientURLs\\\":[\\\"http://127.0.0.1:22379\\\"]}\"\n   2\t         6\tnorm\tmethod=PUT path=\"/0/members/8211f1d0f64f3269/attributes\" val=\"{\\\"name\\\":\\\"infra1\\\",\\\"clientURLs\\\":[\\\"http://127.0.0.1:2379\\\"]}\"\n   2\t         7\tnorm\tmethod=PUT path=\"/0/members/fd422379fda50e48/attributes\" val=\"{\\\"name\\\":\\\"infra3\\\",\\\"clientURLs\\\":[\\\"http://127.0.0.1:32379\\\"]}\"\n   2\t         8\tnorm\tmethod=PUT path=\"/0/version\" val=\"3.5.0\"\n   2\t         9\tnorm\theader:\u003cID:3632602622773439492 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        10\tnorm\theader:\u003cID:3632602622773439493 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        11\tnorm\theader:\u003cID:3632602622773439494 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        12\tnorm\theader:\u003cID:3632602622773439495 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        13\tnorm\theader:\u003cID:3632602622773439496 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        14\tnorm\theader:\u003cID:3632602622773439497 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        15\tnorm\theader:\u003cID:3632602622773439498 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        16\tnorm\theader:\u003cID:3632602622773439499 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        17\tnorm\theader:\u003cID:3632602622773439500 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        18\tnorm\theader:\u003cID:3632602622773439501 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        19\tnorm\theader:\u003cID:3632602622773439502 \u003e put:\u003ckey:\"k1\" value:\"v1\" \u003e\n   2\t        20\tnorm\theader:\u003cID:13926986946012262662 \u003e alarm:\u003c\u003e\n   2\t        21\tnorm\theader:\u003cID:3632602622773439505 \u003e alarm:\u003c\u003e\n   2\t        22\tnorm\theader:\u003cID:1029240563176583429 \u003e alarm:\u003c\u003e\n   2\t        23\tnorm\theader:\u003cID:3632602622773439508 \u003e compaction:\u003crevision:12 physical:true \u003e\n\nEntry types (Normal,ConfigChange) count is : 23\n```\n\n## consistent-index\n`consistent-index` reads the consistent_index from the meta bucket in\nthe db file. The parameter can be either the path to the etcd data\ndirectory or the database file itself.\n\nUsage,\n```\n$ ./etcd-diagnosis consistent-index -h\nconsistent-index reads consistent_index from the meta bucket in the db file.\n\nUsage:\n  etcd-diagnosis consistent-index [data dir or db file path] [flags]\n\nFlags:\n  -h, --help   help for consistent-index\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExample,\n```\n$ ./etcd-diagnosis consistent-index ~/tmp/etcd/infra1.etcd/\n23\n```\n\n## commit-index\n`commit-index` reads the commit index from data directory.\nThe parameter must be the path to the etcd data directory.\n\nUsage,\n```\n$ ./etcd-diagnosis commit-index -h\ncommit-index reads the commit index from data directory.\n\nUsage:\n  etcd-diagnosis commit-index [data dir] [flags]\n\nFlags:\n  -h, --help             help for commit-index\n      --wal-dir string   path to the dedicated wal directory, defaults to '${data_dir}/member/wal/' if not set\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExample,\n```\n$ ./etcd-diagnosis commit-index ~/tmp/etcd/infra1.etcd/\n23\n```\n\n## report\n`report` generates a diagnostic report for a running etcd cluster.\nNote the `report` command requires the etcd cluster to be running\nto generate diagnostic reports, unlike other commands that operate\non the data directory or database file and require the cluster to\nbe stopped.\n\nIt reuses most of the `etcdctl` global flags, offering a familiar\nexperience to etcdctl users. See detailed usage below,\n\n```\n$ ./etcd-diagnosis report -h\nreport generates a diagnostic report for a running etcd cluster.\n\nUsage:\n  etcd-diagnosis report [flags]\n\nFlags:\n      --cacert string                  verify certificates of TLS-enabled secure servers using this CA bundle\n      --cert string                    identify secure client using this TLS certificate file\n      --cluster                        use all endpoints from the cluster member list\n      --command-timeout duration       command timeout (excluding dial timeout) (default 5s)\n      --dial-timeout duration          dial timeout for client connections (default 2s)\n  -d, --discovery-srv string           domain name to query for SRV records describing cluster endpoints\n      --discovery-srv-name string      service name to query when using DNS discovery\n      --endpoints strings              comma separated etcd endpoints (default [127.0.0.1:2379])\n      --etcd-storage-quota-bytes int   etcd storage quota in bytes (the value passed to etcd instance by flag --quota-backend-bytes) (default 2147483648)\n  -h, --help                           help for report\n      --insecure-discovery             accept insecure SRV records describing cluster endpoints (default true)\n      --insecure-skip-tls-verify       skip server certificate verification (CAUTION: this option should be enabled only for testing purposes)\n      --insecure-transport             disable transport security for client connections (default true)\n      --keepalive-time duration        keepalive time for client connections (default 2s)\n      --keepalive-timeout duration     keepalive timeout for client connections (default 5s)\n      --key string                     identify secure client using this TLS key file\n      --output string                  file path to write the online diagnosis report (default \"etcd_diagnosis_report.json\")\n      --password string                password for authentication (if this option is used, --user option shouldn't include password)\n      --user string                    username[:password] for authentication (prompt if password is not supplied)\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n```\n\nExample,\n```\n./etcd-diagnosis report --endpoints=https://10.200.6.179:2379,https://10.200.6.187:2379,https://10.200.6.188:2379\n```\n\nNote if the endpoints are HTTPS URLs, and you do not specify values for\n`--cacert`, `--cert` and `key`, then the following default values are used,\n```\n--cacert=/etc/kubernetes/pki/etcd/ca.crt\n--cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt\n--key=/etc/kubernetes/pki/etcd/healthcheck-client.key\n```\n\n\nCheck the [example report](./commands/report/examples/etcd_diagnosis_report.json) generated by the command.\n\n## bbolt\n`bbolt` integrates all CLI commands implemented in [go.etcd.io/bbolt/cmd/bbolt/command](https://github.com/etcd-io/bbolt/tree/main/cmd/bbolt/command).\n\nUsage,\n```\n$ ./etcd-diagnosis bbolt -h\nA simple command line tool for inspecting bbolt databases\n\nUsage:\n  etcd-diagnosis bbolt [command]\n\nAvailable Commands:\n  bench       run synthetic benchmark against bbolt\n  buckets     print a list of buckets in bbolt database\n  check       verify integrity of bbolt database data\n  compact     creates a compacted copy of the database from source path to the destination path, preserving the original.\n  dump        prints a hexadecimal dump of one or more pages of bbolt database.\n  get         get the value of a key from a (sub)bucket in a bbolt database\n  info        prints basic information about the bbolt database.\n  inspect     inspect the structure of the database\n  keys        print a list of keys in the given (sub)bucket in bbolt database\n  page        page prints one or more pages in human readable format.\n  page-item   print a page item key and value in a bbolt database\n  pages       print a list of pages in bbolt database\n  stats       print stats of bbolt database\n  surgery     surgery related commands\n  version     print the current version of bbolt\n\nFlags:\n  -h, --help      help for bbolt\n  -v, --version   version for bbolt\n\nGlobal Flags:\n      --timeout duration   time to wait to obtain a file lock on db file, 0 to block indefinitely (default 10s)\n\nUse \"etcd-diagnosis bbolt [command] --help\" for more information about a command.\n```\n\nFor more detailed document, refer to [here](https://github.com/etcd-io/bbolt/tree/main/cmd/bbolt).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware%2Fetcd-diagnosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware%2Fetcd-diagnosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware%2Fetcd-diagnosis/lists"}