Files
calypso/CHECK-BACKEND-LOGS.md
2025-12-25 09:01:49 +00:00

1.4 KiB

Cara Cek Backend Logs

Lokasi Log File

Backend logs ditulis ke: /tmp/backend-api.log

Cara Melihat Logs

1. Lihat Logs Real-time (Live)

tail -f /tmp/backend-api.log

2. Lihat Logs Terakhir (50 baris)

tail -50 /tmp/backend-api.log

3. Filter Logs untuk Error ZFS Pool

tail -100 /tmp/backend-api.log | grep -i "zfs\|pool\|create\|error\|failed"

4. Lihat Logs dengan Format JSON yang Lebih Readable

tail -50 /tmp/backend-api.log | jq '.'

5. Monitor Logs Real-time untuk ZFS Pool Creation

tail -f /tmp/backend-api.log | grep -i "zfs\|pool\|create"

Restart Backend

Backend perlu di-restart setelah perubahan code untuk load route baru:

# 1. Cari process ID backend
ps aux | grep calypso-api | grep -v grep

# 2. Kill process (ganti PID dengan process ID yang ditemukan)
kill <PID>

# 3. Restart backend
cd /development/calypso/backend
export CALYPSO_DB_PASSWORD="calypso123"
export CALYPSO_JWT_SECRET="test-jwt-secret-key-minimum-32-characters-long"
go run ./cmd/calypso-api -config config.yaml.example > /tmp/backend-api.log 2>&1 &

# 4. Cek apakah backend sudah running
sleep 3
tail -20 /tmp/backend-api.log

Masalah yang Ditemukan

Dari logs, terlihat:

  • Status 404 untuk POST /api/v1/storage/zfs/pools
  • Route sudah ada di code, tapi backend belum di-restart
  • Solusi: Restart backend untuk load route baru