Crash Dump
Butler SOS can create crash dump files when it encounters unrecoverable errors. These files capture diagnostic information at the exact moment of a crash, making it easier to diagnose what went wrong.
Sensitive config fields (passwords, tokens, IPs) are never written to crash dump files, and common secret patterns in error messages are redacted automatically.
Important — always review before sharing
While Butler SOS makes every effort to exclude sensitive data from crash dumps, automated redaction cannot catch all possible formats. Error messages from third-party libraries or unexpected secret formats may contain sensitive information that is not caught by automated redaction.
Before sharing any crash dump file with anyone outside your organization — including Butler SOS support — the Qlik Sense admin must review its contents to confirm no environment-specific or sensitive information is present. Restrict access to the crash dump directory to trusted users only.
When crash dumps are created
| Source | Description |
|---|---|
uncaughtException | A synchronous exception was not caught by any try/catch handler |
unhandledRejection | A rejected Promise had no .catch() handler |
logFatal | Butler SOS deliberately triggered a fatal error before exiting |
Startup failures
Changed in 15.1.0
Before Butler SOS 15.1.0, a Butler SOS that could not start stopped, but reported exit code zero — a clean exit — and wrote no crash dump.
When Butler SOS cannot start, it:
- Exits with code 1, so restart policies and monitoring see a genuine failure.
- Writes a crash dump to disk recording what went wrong (unless you have disabled crash dumps — see below).
- Logs the error, as before.
When a program finishes, it hands the operating system a number saying how it went. Zero means "finished normally"; anything else means "something went wrong". Restart policies rely on this number to decide whether to intervene.
If Butler SOS hit an unrecoverable problem while starting — an unreadable certificate file, a port already in use, an InfluxDB it could not reach at startup, a config file it could not make sense of — it used to stop, but report zero. The consequence:
- Docker
restart: on-failurenever restarted it. Docker saw a container that had completed its work and exited successfully, so it left it stopped. - systemd
Restart=on-failurenever restarted it. Same reasoning. - Monitoring that watched for a non-zero exit saw nothing.
Restart policies now behave the way you configured them to.
You may see a restart loop
If Butler SOS fails to start because of something that will not fix itself — a typo in the config file, a certificate path that does not exist, a port permanently occupied by another service — then under an automatic restart policy it will fail, restart, fail again, and keep going. A crash loop.
This is intended behaviour, not a regression. A service that visibly cannot start is far easier to notice and diagnose than one that is silently absent. The loop is the symptom surfacing, not the disease.
If you see Butler SOS restarting repeatedly:
- Do not assume the restart policy is misconfigured. It is working; it is telling you something.
- Read the log, or the crash dump, and find the underlying error. It will almost always be a configuration problem.
- Fix that, and the loop stops.
If you would rather it did not loop
Docker's restart: on-failure accepts a maximum retry count, and systemd offers StartLimitBurst and StartLimitIntervalSec for the same purpose. Either will stop a persistent failure from restarting indefinitely while still letting a transient one recover. That is a sensible thing to configure regardless.
For a problem in the config file, Butler SOS 15.4.0 and later can also report the problem once and stay up without starting any of its services. See Staying up on an invalid config file.
Crash dump files are named with a timestamp and a counter, so successive crashes do not overwrite each other. A crash loop will therefore accumulate files — another reason to cap restart attempts, and to check the directory after resolving a startup problem.
When the crash dump cannot be written
If the crash dump cannot be written — a directory that does not exist, or one the Butler SOS user cannot write to — Butler SOS does not treat that as a further error. It still exits with code 1 and the error is still in the log. This matters in Docker in particular, where the container runs as a non-root user that may not be able to write to the working directory. If you want crash dumps from a container, point crashFileDirectory at a mounted volume the container user can write to.
Changed in 15.4.0
Since Butler SOS 15.4.0 the Docker image has a /nodeapp/crash_dumps folder that the container user can write to, so the default ./crash_dumps works in a container. To keep crash dumps after the container is removed, mount a volume at /nodeapp/crash_dumps. See Log files and crash dumps in the container.
With enable: false, no crash dump is written. The exit code is still 1 and the error is still logged.
What has not changed
- Errors after a successful start. This is about startup failures. Once Butler SOS is up and running, a problem with a single destination — InfluxDB briefly unreachable, an MQTT broker restarting — is logged and Butler SOS keeps running.
- Normal shutdown. Stopping Butler SOS deliberately exits with code 0.
- Log output. Startup errors are logged as before. What changed is the exit code and the crash dump, not the logging.
Configuration Reference
The crashFile section is a mandatory top-level key under Butler-SOS.
Butler-SOS:
logDirectory: ./logs
crashFile:
enable: true # Default: true
crashFileDirectory: ./crash_dumps # Default: ./crash_dumps
crashFileCreateJson: true # Default: true
crashFileCreateText: true # Default: true| Setting | Default | Description |
|---|---|---|
enable | true | Master switch. Set to false to disable crash dump creation entirely. |
crashFileDirectory | ./crash_dumps | Directory where crash files are written. Relative paths are resolved from Butler SOS's working directory; absolute paths are supported. An empty string uses the working directory. |
crashFileCreateJson | true | When true, creates a machine-readable JSON crash dump file. |
crashFileCreateText | true | When true, creates a human-readable plain-text crash dump file. |
Plain-text files only
crashFile:
enable: true
crashFileDirectory: ./crash_dumps
crashFileCreateJson: false
crashFileCreateText: trueDisabled
crashFile:
enable: false
crashFileDirectory: ./crash_dumps
crashFileCreateJson: true
crashFileCreateText: trueFile formats
Filename pattern
Both file types use the same naming convention, which includes a timestamp, the process ID, and a per-process incrementing counter to guarantee uniqueness even when multiple crashes occur within the same millisecond:
crash_dump_<YYYYMMDD>_<HHMMSS>_<mmm>_<PID>_<counter>.<ext>- Timestamp is local time
mmmis milliseconds (3 digits, zero-padded)PIDis the operating system process IDcounteris a per-process integer starting at 1- Extension is
.jsonor.txt
Example: crash_dump_20260509_143045_123_12345_1.json
Files are never overwritten — each crash produces uniquely named files. The exclusive-create flag (flag: 'wx') prevents any silent overwrites if a filename were somehow reused.
JSON format
{
"version": "1.0",
"timestamp": "2026-05-09T14:30:45.123Z",
"app": {
"name": "butler-sos",
"version": "14.0.0"
},
"runtime": {
"nodeVersion": "22.10.0",
"platform": "darwin/arm64",
"isSea": true
},
"error": {
"type": "Error",
"message": "Connection refused",
"stack": "at Function.foo (src/lib/foo.js:123)\n at Module._compile (node:internal/modules/cjs-loader:456)"
},
"context": {
"exitCode": 1,
"source": "uncaughtException"
},
"config": {
"logLevel": "info",
"fileLogging": true,
"logDirectory": "./logs",
"anonTelemetry": false,
"systemInfoEnable": true,
"userEventsEnable": true,
"influxdbEnable": true,
"influxdbVersion": 2,
"prometheusEnable": false,
"mqttEnable": false,
"auditEventsEnable": false
}
}JSON field descriptions
| Field | Description |
|---|---|
version | Crash dump format version (currently "1.0") |
timestamp | ISO 8601 UTC timestamp of when the dump was created |
app.name | Always "butler-sos" |
app.version | Butler SOS version from package.json |
runtime.nodeVersion | Node.js version |
runtime.platform | process.platform/process.arch (e.g. "linux/x64") |
runtime.isSea | true when running as a packaged SEA binary |
error.type | Error constructor name (e.g. "Error", "TypeError") |
error.message | Error message |
error.stack | Sanitized stack trace — absolute paths are stripped |
context.exitCode | Always 1 |
context.source | "uncaughtException", "unhandledRejection", or "logFatal" |
config | Non-sensitive configuration snapshot (log level, feature enable flags, InfluxDB version) |
Plain-text format
====================================
BUTLER SOS CRASH REPORT
====================================
Generated: 2026-05-09T14:30:45.123Z
=== APPLICATION INFO ===
Butler SOS Version: 14.0.0
Node.js Version: 22.10.0
Platform: darwin/arm64
Executable: SEA (packaged) | Node.js
=== CRASH INFO ===
Error Type: Error
Source: uncaughtException
Exit Code: 1
=== ERROR MESSAGE ===
Connection refused
=== STACK TRACE ===
at Function.foo (src/lib/foo.js:123)
at Module._compile (node:internal/modules/cjs-loader:456)
...
====================================
END OF CRASH REPORT
====================================Sensitive data handling
Crash dumps are designed to be safe to share externally. Two layers of protection are applied:
Config fields
Sensitive config fields are never written to crash dump files:
| Category | Examples |
|---|---|
| IP addresses / hostnames | Server hosts, client IPs, broker hosts |
| Credentials | Passwords, passphrases, client cert passphrases |
| API keys & tokens | New Relic keys, InfluxDB tokens |
| Account information | Account names, account IDs, organizations |
| Certificate paths & contents | clientCert, clientCertKey, clientCertCA |
| HTTP headers | Authorization headers |
| MQTT topics | Base topics |
| Usernames | Auth usernames |
| Storage bucket names | InfluxDB buckets |
Only non-sensitive config fields are captured in the config section of the JSON dump (log level, file logging, feature enable flags, InfluxDB version).
Error content: best-effort redaction
Error messages and stack traces are included to aid debugging. Butler SOS applies best-effort redaction of common sensitive patterns found in error messages:
| Pattern | Example input | After redaction |
|---|---|---|
| URL with embedded credentials | mqtt://admin:secret@broker.example.com | mqtt://[REDACTED]@broker.example.com |
| Authorization header tokens | Bearer eyJhbGci... | Bearer [REDACTED] |
| Key-value secret pairs | password=hunter2 | password=[REDACTED] |
| JSON-style secret fields | "token": "abc123" | "token": "[REDACTED]" |
Best-effort only — restrict access and review before sharing
Redaction is best-effort only. Error messages generated by third-party libraries or unexpected secret formats may not be caught by automated redaction. Treat crash dump files as potentially sensitive — restrict access to the crashFileDirectory accordingly, and always review the contents before sharing with anyone outside your organization.
Troubleshooting
Where to find crash dumps
By default, crash dump files are created in ./crash_dumps/ relative to the directory from which Butler SOS was started. Use Butler-SOS.crashFile.crashFileDirectory to change this location.
How to interpret the contents
- Open the
.txtfile for a quick human-readable summary. - Open the
.jsonfile for machine-readable data that can be processed by support tooling. - The
error.messageanderror.stackfields identify where the crash originated. - The
context.sourcefield tells you whether the crash was caused by an uncaught exception, unhandled rejection, or explicit fatal error. - The
configsection shows which major features were enabled at the time of the crash.
Crash dumps are not being created
- Verify
Butler-SOS.crashFile.enableistrue. - Verify
Butler-SOS.crashFile.crashFileCreateJsonorButler-SOS.crashFile.crashFileCreateText(or both) aretrue. - Check that Butler SOS has write permission to the
crashFileDirectory. - If
crashFileDirectoryis a relative path, it is resolved from the process working directory, which may differ from the installation directory.