> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sertifikasitrainer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Masalah umum saat setup, dev lokal, dan deploy.

## `./thub doctor` menunjukkan error merah

| Pesan                             | Solusi                                                |
| --------------------------------- | ----------------------------------------------------- |
| `.env shared belum ada`           | `./thub setup`                                        |
| `apps/api/.env belum di-merge`    | `./thub env merge`                                    |
| `DATABASE_URL tidak bisa connect` | Pastikan Postgres jalan; cek `.env.development.local` |
| `BETTER_AUTH_SECRET kosong`       | `./thub setup` atau isi manual di `.env`              |

## API tidak start — error Scalev

Pastikan override dev:

```bash theme={null}
# .env.development.local
PAYMENT_PROVIDER=manual
```

Lalu `./thub env merge` dan restart `./thub dev`.

## `./thub dev` — port sudah dipakai

Dev server mungkin sudah jalan. Cek:

```bash theme={null}
curl http://127.0.0.1:3739/api/health
```

Stop proses di port `3739` / `5757`, atau ganti port di `.env.development.local`.

## Web blank / tidak connect ke API

1. Cek `apps/web/.env.development.local`:
   ```bash theme={null}
   VITE_API_URL=http://localhost:3739/api
   ```
2. `./thub env merge`
3. Restart `./thub dev`

## `./thub secrets check` gagal

Isi key **wajib** di `.env` shared:

* `BETTER_AUTH_SECRET`
* `DEEPSEEK_API_KEY`
* `AWS_ACCESS_KEY_ID`
* `AWS_SECRET_ACCESS_KEY`

Key opsional yang kosong hanya peringatan.

## Deploy gagal — DATABASE\_URL

Buat `.env.production.local` dengan `DATABASE_URL=postgresql://...` valid.

Atau legacy: baris `psql=...` di `.env.production`.

## Smoke prod gagal

```bash theme={null}
curl https://app.sertifikasitrainer.com/api/health
```

Kalau `200` tapi smoke gagal, cek openapi title (harus mengandung `Hono API`).

## `docs.sertifikasitrainer.com` minta login

Bukan dari kode repo — **Mintlify Dashboard** mengaktifkan site **Private**.

**Perbaikan:** Authentication → Site visibility → **Public** → Save. Detail: [Docs Mintlify (publik)](/guides/mintlify).

## Dokumentasi ini

```bash theme={null}
cd apps/docs
bun run dev
```

Preview di [http://localhost:3333](http://localhost:3333) (tanpa login)
