← Holocron Logs

The Night n8n Forgot Everything: A Bind Mount Postmortem

n8n came back from a container rebuild with zero workflows. 38 workflows, months of automation, gone from the UI. The root cause was a Docker storage assumption I never verified. This is the postmortem.

Why this matters beyond the homelab: Stateful container storage failures are one of the most common production incidents in containerized environments. Verifying persistence assumptions before you need them is the difference between a restore and a rebuild.


The Incident

n8n is the automation glue of the Alliance Fleet. Nightly documentation exports, Discord alerting, job search automation, SIEM enrichment. When I rebuilt the container after a routine update, the UI came back clean. Not clean as in healthy. Clean as in empty.

Zero workflows. Zero credentials. Zero execution history.

38 workflows representing months of iterative automation work were no longer visible to the application. The first sixty seconds of an incident like this are about resisting the urge to “fix” anything before you understand what actually happened, because the wrong fix here (recreating the container again, reinitializing the database) is exactly how recoverable data becomes unrecoverable.


Timeline


Root Cause

The compose file defined a volume, but the path syntax created a named Docker volume instead of the host bind mount I intended. Every workflow I had built was being written to Docker-managed storage that did not survive the way I assumed it would across a rebuild done with cleanup flags.

The deeper root cause is more uncomfortable: I had never tested the restore path. The data was “persisted” in the sense that it existed, but persistence you have not verified through an actual restore is a hypothesis, not a backup strategy.


Resolution

Three changes came out of this incident:

  1. Explicit bind mounts for every stateful container. Absolute host paths, no ambiguity, verified with docker inspect after deployment. If I cannot ls the data from the host, it does not count as persisted.
  2. Workflow exports as code. n8n workflows now export to JSON on a schedule and land in Git. The application database is no longer the only copy of the automation logic. This is the same principle as infrastructure-as-code: the running state should be reproducible from version control.
  3. Restore drills. The Alliance Fleet backup architecture (Proxmox snapshots, NFS, Azure offsite via azcopy) already existed when this happened. It did not help, because n8n’s data was not in any of those paths. Backup coverage is now audited against a service inventory, not assumed.

Key Takeaways

← Back to Holocron Logs