You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.9 KiB

  1. ---
  2. order: 1
  3. parent:
  4. title: Debugging
  5. order: 1
  6. ---
  7. # Debugging
  8. ## Tendermint debug kill
  9. Tendermint comes with a `debug` sub-command that allows you to kill a live
  10. Tendermint process while collecting useful information in a compressed archive.
  11. The information includes the configuration used, consensus state, network
  12. state, the node' status, the WAL, and even the stack trace of the process
  13. before exit. These files can be useful to examine when debugging a faulty
  14. Tendermint process.
  15. ```bash
  16. tendermint debug kill <pid> </path/to/out.zip> --home=</path/to/app.d>
  17. ```
  18. will write debug info into a compressed archive. The archive will contain the
  19. following:
  20. ```sh
  21. ├── config.toml
  22. ├── consensus_state.json
  23. ├── net_info.json
  24. ├── stacktrace.out
  25. ├── status.json
  26. └── wal
  27. ```
  28. Under the hood, `debug kill` fetches info from `/status`, `/net_info`, and
  29. `/dump_consensus_state` HTTP endpoints, and kills the process with `-6`, which
  30. catches the go-routine dump.
  31. ## Tendermint debug dump
  32. Also, the `debug dump` sub-command allows you to dump debugging data into
  33. compressed archives at a regular interval. These archives contain the goroutine
  34. and heap profiles in addition to the consensus state, network info, node
  35. status, and even the WAL.
  36. ```bash
  37. tendermint debug dump </path/to/out> --home=</path/to/app.d>
  38. ```
  39. will perform similarly to `kill` except it only polls the node and
  40. dumps debugging data every frequency seconds to a compressed archive under a
  41. given destination directory. Each archive will contain:
  42. ```sh
  43. ├── consensus_state.json
  44. ├── goroutine.out
  45. ├── heap.out
  46. ├── net_info.json
  47. ├── status.json
  48. └── wal
  49. ```
  50. Note: goroutine.out and heap.out will only be written if a profile address is
  51. provided and is operational. This command is blocking and will log any error.
  52. ## Tendermint Inspect
  53. Tendermint includes an `inspect` command for querying Tendermint's state store and block
  54. store over Tendermint RPC.
  55. When the Tendermint consensus engine detects inconsistent state, it will crash the
  56. entire Tendermint process.
  57. While in this inconsistent state, a node running Tendermint's consensus engine will not start up.
  58. The `inspect` command runs only a subset of Tendermint's RPC endpoints for querying the block store
  59. and state store.
  60. `inspect` allows operators to query a read-only view of the stage.
  61. `inspect` does not run the consensus engine at all and can therefore be used to debug
  62. processes that have crashed due to inconsistent state.
  63. To start the `inspect` process, run
  64. ```bash
  65. tendermint inspect
  66. ```
  67. ### RPC endpoints
  68. The list of available RPC endpoints can be found by making a request to the RPC port.
  69. For an `inspect` process running on `127.0.0.1:26657`, navigate your browser to
  70. `http://127.0.0.1:26657/` to retrieve the list of enabled RPC endpoints.
  71. Additional information on the Tendermint RPC endpoints can be found in the [rpc documentation](https://docs.tendermint.com/master/rpc).