[v3 Enterprise] PachaTree cannot recover from zero-byte checkpoint/WAL files after ungraceful shutdown
InfluxDB 3 Enterprise fails to recover after ungraceful shutdown due to zero-byte PachaTree checkpoint and WAL files
Environment
- InfluxDB 3 Enterprise: 3.11.4
- License: Home
- OS: Debian GNU/Linux 12 (bookworm)
- Deployment: Debian LXC container running on Proxmox VE
- Storage engine: PachaTree
- Object store: local filesystem (
--object-store file) - Data directory:
/var/lib/influxdb3/data - Node mode:
ingest,query,compact - Single-node deployment
- 2 licensed cores
- 4 GB memory available to the container
- Service managed by systemd
- Primary workload: Home Assistant time-series data, queried by Grafana
Relevant startup parameters reported by InfluxDB:
node-id=influxdb-ha-node
cluster-id=home-assistant-cluster
data-dir=/var/lib/influxdb3/data
object-store=file
mode=ingest,query,compact
num-cores=2Summary
Following an unexpected power outage / ungraceful shutdown, InfluxDB 3 Enterprise was unable to recover automatically.
The shutdown appears to have left:
- One zero-byte PachaTree V2 checkpoint file.
- Two zero-byte PachaTree WAL files.
The zero-byte checkpoint caused InfluxDB startup to fail repeatedly.
After manually moving that checkpoint out of the active checkpoint directory, InfluxDB started, but continuously retried processing the two zero-byte WAL files.
After moving those two WAL files out of the active WAL paths as well, InfluxDB recovered successfully, PachaTree compaction resumed, a new V2 checkpoint was generated, and all historical data became accessible again.
No apparent data loss was observed.
Initial failure
InfluxDB repeatedly failed during PachaTree Compact initialization with:
server initialization failed with retryable error
failed to initialize write buffer:
Failed to setup `compact` mode:
failed to start standby compaction consumer:
Internal error: Failed to decompress V2 checkpoint:
expected another byte, found noneThe service continuously restarted. At one point systemd reported:
restart counter is at 2458The catalog itself loaded correctly and the object store was reachable, but initialization consistently failed when the V2 compaction consumer attempted to read the checkpoint.
Investigation
The following checkpoint files existed:
28K 00000000000000135566.ptv2chk.lz4
28K 00000000000000135567.ptv2chk.lz4
0 00000000000000135568.ptv2chk.lz4The latest checkpoint was therefore a zero-byte file:
/var/lib/influxdb3/data/home-assistant-cluster/cv2/checkpoints/
00000000000000135568.ptv2chk.lz4Its modification time corresponded approximately to the time of the power interruption.
Two zero-byte WAL files were also found:
/var/lib/influxdb3/data/65c/0/pt_wal/
00000000000000218317.pt
/var/lib/influxdb3/data/9ed/0/pt_wal/
00000000000000218318.ptThe preceding WAL files had normal non-zero sizes.
Recovery step 1: checkpoint
InfluxDB was stopped.
The zero-byte checkpoint was preserved but moved out of the active namespace by renaming it:
00000000000000135568.ptv2chk.lz4
->
00000000000000135568.ptv2chk.lz4.badThe two preceding valid checkpoints were left untouched.
InfluxDB was restarted.
After this change, InfluxDB successfully started and listened on its HTTP port.
This strongly indicates that the zero-byte checkpoint was responsible for the startup failure.
Secondary failure: WAL processing
After startup, InfluxDB continuously produced warnings for WAL IDs 218317 and 218318:
WAL file process error, will retry
node_id="influxdb-ha-node"
wal_id=218317
error=Failed to read header: File too small for headerand:
WAL file process error, will retry
node_id="influxdb-ha-node"
wal_id=218318
error=Failed to read header: File too small for headerThese retries occurred approximately four times per second and continued indefinitely.
Both referenced WAL files were zero bytes.
Recovery step 2: WAL files
InfluxDB was stopped again.
The two zero-byte WAL files were preserved by renaming them:
00000000000000218317.pt
->
00000000000000218317.pt.badand:
00000000000000218318.pt
->
00000000000000218318.pt.badInfluxDB was restarted.
The following errors then disappeared completely:
Failed to decompress V2 checkpointFile too small for headerWAL file process errorPachaTree subsequently resumed normal processing.
Most importantly, InfluxDB successfully generated a new checkpoint:
published V2 checkpoint sequence=135573Grafana was subsequently able to query the database normally and historical data appears intact.
Expected behavior
InfluxDB should recover gracefully from an interrupted checkpoint or WAL write caused by an ungraceful shutdown.
In particular, a zero-byte or otherwise incomplete checkpoint/WAL file should ideally be detected as incomplete and handled automatically.
Possible recovery behavior could include:
- Ignore an invalid latest checkpoint and fall back to the previous valid checkpoint.
- Validate checkpoint integrity before making the checkpoint authoritative.
- Write checkpoints atomically using a temporary file followed by an atomic rename.
- Detect zero-length or incomplete WAL segments during recovery and quarantine or ignore them where safe.
- Avoid indefinitely retrying a permanently invalid zero-byte WAL file.
- Produce a clear recovery-oriented error explaining which file is invalid and what automated recovery action was taken.
Actual behavior
A single zero-byte checkpoint prevented the entire InfluxDB server from starting.
Once the checkpoint was manually removed from the active path, two zero-byte WAL segments caused continuous retry loops.
Manual filesystem intervention was required to restore service.
Why this may be important
Power loss, host crashes, kernel panics, VM/LXC host failures, and forced shutdowns are realistic failure scenarios for a database.
An interrupted filesystem write should not ideally leave InfluxDB in a state where:
- the server cannot start,
- systemd continuously restarts it thousands of times,
- recovery requires identifying internal PachaTree files manually,
- and malformed WAL entries are retried indefinitely.
The fact that simply excluding the three zero-byte files allowed the database to recover, regenerate a valid checkpoint, and expose all historical data suggests the underlying persisted data remained usable.
It may therefore be possible for InfluxDB to detect and perform this recovery automatically.
Approximate sequence of events
2026-09-18 13:07:16 Last normal/non-empty WAL activity
2026-09-18 13:07:20 WAL 218317 created with size 0
2026-09-18 13:07:23 WAL 218318 created with size 0
2026-09-18 13:07:23 V2 checkpoint 135568 created with size 0
Unexpected power interruption around this period
2026-09-19 Host restarted
InfluxDB fails to initialize PachaTree
Continuous systemd restart loop
Manual recovery:
- quarantine checkpoint 135568
- InfluxDB starts
- quarantine WAL 218317 and 218318
- WAL errors disappear
- PachaTree resumes processing
- new V2 checkpoint 135573 generated
- Grafana queries work normallyAdditional observations
After successful recovery, some warnings such as the following appeared during compaction:
Unexpected call to cache.add_file for existing keyHowever, compaction plans continued completing successfully and a new V2 checkpoint was published.
I have retained the three zero-byte files as .bad files in case their filenames, metadata, or surrounding directory structure would be useful for investigation.
I can also provide the complete systemd journal covering:
- failed startup,
- PachaTree checkpoint decompression failure,
- systemd restart loop,
- successful startup after checkpoint quarantine,
- WAL retry loop,
- successful startup after WAL quarantine,
- and successful creation of a new V2 checkpoint.
Source: influxdata/influxdb