From 62b9e8227b2c93f9ec76b65400b4181657e45611 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Thu, 5 Feb 2026 21:18:39 +0000 Subject: [PATCH] docs: Explain enabling backtraces at runtime --- docs/troubleshooting.mdx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.mdx b/docs/troubleshooting.mdx index c5a68eae..87b3726c 100644 --- a/docs/troubleshooting.mdx +++ b/docs/troubleshooting.mdx @@ -139,7 +139,7 @@ much possible corruption is restored ## Debugging -Note that users should not really be debugging things. If you find yourself +Note that users should not really need to debug things. If you find yourself debugging and find the issue, please let us know and/or how we can fix it. Various debug commands can be found in `!admin debug`. @@ -178,6 +178,31 @@ server performance on either side as that endpoint is completely unauthenticated and simply fetches a string on a static JSON endpoint. It is very low cost both bandwidth and computationally. +### Enabling backtraces for errors + +Continuwuity can capture backtraces (stack traces) for errors to help diagnose +issues. Backtraces show the exact sequence of function calls that led to an +error, which is invaluable for debugging. + +To enable backtraces, set the `RUST_BACKTRACE` environment variable before starting Continuwuity: + +```bash +# For both panics and errors +RUST_BACKTRACE=1 ./conduwuit + +``` + +For systemd deployments, add this to your service file: + +```ini +[Service] +Environment="RUST_BACKTRACE=1" +``` + +Backtrace capture has a performance cost. Avoid leaving it on. +You can also enable it only for panics by setting +`RUST_BACKTRACE=1` and `RUST_LIB_BACKTRACE=0`. + ### Allocator memory stats When using jemalloc with jemallocator's `stats` feature (`--enable-stats`), you