Half of data my workflows are not saved in DB after reboot

Describe the problem/error/question

I am using Proxmox server and docker to selfhost n8n server.
Sometime I need to restart server and everything is ok, but last week, when i reboot the server, A half of data (workflow and execution) is lost, all data from Thurday 25/9 to Sunday 28/9 is lost

I have trace the sqlite db file and see data in these days is missing and I can’t rollback it.
I have read this topic but seem cannot trace bug, have anyone suggest idea to trace and fix in the future

Information on your n8n setup

  • n8n version: 1.111.0
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 20.04 (Proxmox node)

Hello DragonPow, what you’re seeing is almost always a storage/volume config issue, not n8n “losing“ data.

When n8n is run in Docker with SQLite or Postgres, data is only safe if the database files are on a persistent volume. If the container writes to its own ephemeral FS and you reboot/replace it, any writes after the last persistence point are gone.

Maybe there are several solution that i can suggest you:

  1. You can check you docker-compose.yml or docker run env:
environment:
  - DB_TYPE=postgresdb   # or sqlite if you use it
  - DB_POSTGRESDB_HOST=postgres
  - DB_POSTGRESDB_DATABASE=n8n
  - DB_POSTGRESDB_USER=n8n
  - DB_POSTGRESDB_PASSWORD=xxxx

if you dont tsee DB_TYPE=postgresdb, you’re still on SQLite

  1. You can add persistent volumes for Postgres:
services:
  postgres:
    image: postgres:15
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
  1. Create a test workflow, restart, and then check its still there. Check the actual Postgres container has your tables populated (workflows_entity, execution_entity).
  2. If you using Postgres, set up pg_dump or volume-level backups.

Maybe thats all i can suggest you, hope this will be works :blush::raising_hands:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.