Files
openclaw/docs/mariadb-permanent-fix-2026-02-17.md
Clawd Bot ca9b510922 chore: align with upstream openclaw/openclaw and overlay local additions
- Reset master to upstream/main (16,697 commits)
- Overlay 2,271 local-only files (skills, tools, workspace, configs, apps)
- Restore IDENTITY.md and USER.md templates
- Build verified, gateway running, Discord working

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 07:40:46 +01:00

3.6 KiB

MariaDB Permanent Fix Summary

Date: 2026-02-17 Status: COMPLETE

Changes Applied

1. Service Masking (PERMANENT)

  • Localhost: systemctl mask mariadb mysql
  • Pi: systemctl mask mariadb mysql
  • Result: Services CANNOT be started (even manually)

2. Global Configuration

  • Created: /etc/openclaw/mariadb.conf
  • Purpose: Single source of truth for all MariaDB connections
  • Permissions: 600 (secure)

3. Health Check Update

  • Updated: /home/alex/clawd/tools/jarvis-health-check.sh
  • Checks: Synology MariaDB only (no localhost/Pi)
  • Config: Uses /etc/openclaw/mariadb.conf

4. Auto-Heal Update

  • Updated: /home/alex/clawd/tools/jarvis-auto-heal.sh
  • Removed: Local MariaDB restart logic
  • Added: Synology health check (read-only, no restart)

5. Documentation

  • Updated: /home/alex/clawd/TOOLS.md
  • Added: Permanent architecture section
  • Warnings: Do not start local MariaDB

6. Cron Schedule

  • Health check: Every hour
  • Auto-delegation: Every 2 hours (reduced from 30 min)
  • GitHub scanner: Daily at 16:00

Architecture

┌─────────────────────────────────────────┐
│  Synology NAS (192.168.1.113:3307)     │
│  MariaDB 10.3.32 - PRODUCTION          │
│                                         │
│  Databases:                             │
│  • kanban_board                         │
│  • homeassistant                        │
│  • tilbudgivern                         │
│  • ordrestyring_local                   │
│  • osticket                             │
│  • deathwatch                           │
└─────────────────────────────────────────┘
            ▲
            │ All connections
            │
   ┌────────┴──────────┐
   │                   │
┌──┴───┐          ┌────┴─────┐
│ Loca │          │    Pi    │
│ host │          │ (raspii) │
│      │          │          │
│ ❌    │          │ ❌        │
│masked│          │ masked   │
└──────┘          └──────────┘

Verification

# Check masked services
systemctl status mysql  # Should show "masked"

# Check Synology connection
source /etc/openclaw/mariadb.conf
mysql -h $MARIADB_HOST -P $MARIADB_PORT -u $KANBAN_USER -p"$KANBAN_PASS" $KANBAN_DB -e "SELECT 1;"

# Run health check
/home/alex/clawd/tools/jarvis-health-check.sh

What You'll Never See Again

"MariaDB down on localhost" "systemctl restart mariadb failed" Auto-heal trying to restart local MariaDB Health checks failing on localhost MariaDB

What You WILL See

"MariaDB (Synology) healthy" All databases centralized on NAS Reduced auto-heal noise (every 2 hours instead of 30 min) Single config file for all services

Backups (Safe to Delete)

  • Localhost: /var/lib/mysql.backup-20260217 (109MB)
  • Pi: /var/lib/mysql.backup-synology-20260217 (1.2GB)

Recommendation: Keep for 30 days, then delete

If you MUST restore local MariaDB:

# Unmask service
sudo systemctl unmask mariadb

# Restore backup
sudo systemctl stop mariadb
sudo rm -rf /var/lib/mysql
sudo mv /var/lib/mysql.backup-20260217 /var/lib/mysql
sudo systemctl start mariadb

But DON'T do this - Synology is the permanent solution!