Skip to content

CRITICAL: Database schema creation failed for /data/db/app.db. #1345

@HeyItsJono

Description

@HeyItsJono

Did I research?

The issue occurs in the following browsers. Select at least 2.

  • Firefox
  • Chrome
  • Other (unsupported) - PRs welcome
  • N/A - This is an issue with the backend

What I want to do

This error occurs on first run of NetAlertX via docker compose.

Relevant settings you changed

No response

docker-compose.yml

services:
  netalertx:
    container_name: netalertx
    image: "ghcr.io/jokob-sk/netalertx"
    network_mode: "host"
    cap_drop:                                       # Drop all capabilities for enhanced security
      - ALL
    cap_add:                                        # Add only the necessary capabilities
      - NET_ADMIN                                   # Required for ARP scanning
      - NET_RAW                                     # Required for raw socket operations
      - NET_BIND_SERVICE                            # Required to bind to privileged ports (nbtscan)
    restart: unless-stopped
    volumes:
      - /local_data_dir:/data
      - /etc/localtime:/etc/localtime
    environment:
      - PORT=20211
    tmpfs:
      - "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"

What installation are you running?

Production (netalertx)

app.log


| \ | | | | / _ | | | | \ \ / /
| | | | |/ /\ \ | ___ _ _| | \ V /
| . |/ _ \ __| _ | |/ _ \ __| __|/
| |\ | __/ |
| | | | | / | | |_/ /^\
_| _/_
|__| |/|___|| __/ /

\033[0m Network intruder and presence detector.
https://netalertx.com

Startup pre-checks
--> storage permission.sh
--> data migration.sh
--> mounts.py
Path | Writeable | Mount | RAMDisk | Performance | DataLoss
--------------------------+-----------+-------+---------+-------------+----------
/data | ✅ | ✅ | ➖ | ➖ | ✅
/data/db | ✅ | ✅ | ➖ | ➖ | ✅
/data/config | ✅ | ✅ | ➖ | ➖ | ✅
/tmp/run/tmp | ✅ | ✅ | ✅ | ✅ | ✅
/tmp/api | ✅ | ✅ | ✅ | ✅ | ✅
/tmp/log | ✅ | ✅ | ✅ | ✅ | ✅
/tmp/run | ✅ | ✅ | ✅ | ✅ | ✅
/tmp/nginx/active-config | ✅ | ✅ | ✅ | ✅ | ✅
--> first run config.sh
--> first run db.sh
══════════════════════════════════════════════════════════════════════════════
🆕 First run detected. Building initial database schema in /data/db/app.db.

Do not interrupt this step. Once complete, consider backing up the fresh
database before onboarding sensitive networks.

══════════════════════════════════════════════════════════════════════════════
Error: unable to open database "/data/db/app.db": unable to open database file
══════════════════════════════════════════════════════════════════════════════
❌ CRITICAL: Database schema creation failed for /data/db/app.db.

NetAlertX cannot start without a properly initialized database. This
failure typically indicates:

* Insufficient disk space or write permissions in the database directory
* Corrupted or inaccessible SQLite installation
* File system issues preventing database file creation

Check the logs for detailed SQLite error messages. Ensure the container
has write access to the database path and adequate storage space.

══════════════════════════════════════════════════════════════════════════════
\033[1;31m══════════════════════════════════════════════════════════════════════════════
❌ NetAlertX startup aborted: critical failure in first run db.sh.
https://github.com/jokob-sk/NetAlertX/blob/main/docs/docker-troubleshooting/troubleshooting.md
══════════════════════════════════════════════════════════════════════════════
\033[0m

Debug enabled

  • I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Docker 🐋Docker relatedSetup 📥These are probably setup or user environment related issues.Waiting for reply⏳Waiting for the original poster to respond, or discussion in progress.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions