# How to Fix SQLITE_BUSY: database is locked (2026 Verified Ubuntu/Docker Fix)

- URL: https://nodebudget.dev/errors/n8n-sqlite-busy-database-locked/
- Category: Database · Severity: High
- Author: Yuanqiang Leng (https://github.com/a895047059)
- Updated: 2026-11-26

## Exact Log Signature
`QueryFailedError: SQLITE_BUSY: database is locked | n8n webhook timeout`

## Root Cause
Default SQLite database cannot handle concurrent writes when multiple webhooks or AI agent sub-workflows fire simultaneously.

## Verified Fix Commands
```bash
# Switch .env to PostgreSQL 16 (only 31 MB idle RSS):
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgres
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
```

## Permanent Production Prevention
Always deploy n8n with PostgreSQL 16 from day one using NodeBudget Blueprint Generator.

---
Source: NodeBudget (https://nodebudget.dev/tools/error-decoder/)
