# PostgreSQL Memory Jail Troubleshooting

Use this file when the `db` jail is created successfully but still is not ready
for PostgreSQL installation.

## Common failure signatures

### `hostname` is still `db`

Likely cause:
- the jail was created successfully
- the hostname was not yet updated after creation

Response:
- apply the intended hostname with Bastille config
- restart the jail before treating hostname mismatch as a deeper failure

### `vnet0` has `192.168.100.2/24` but `netstat -rn` has no `default`

Likely cause:
- Bastille VNET create path omitted the explicit Warden gateway

Observed pattern:
- jail creation succeeds
- `vnet0` has the expected address
- the routing table only shows the local subnet

Response:
- recreate or provision with:
  - `-g 192.168.100.1`
- do not rely on a manual `route add default 192.168.100.1` as the final fix

### Bastille console log shows `add net default: gateway 51.83.197.1 ... Invalid argument`

Likely cause:
- Bastille inferred the host uplink gateway instead of the Warden gateway
- this is a provisioning defect for the VNET jail, not a PostgreSQL problem

Interpretation:
- host bridge and jail creation may still be correct
- but the jail routing model is wrong

Response:
- treat this as evidence the create command is missing:
  - `-g 192.168.100.1`

### Bastille destroy prints `Note: jail console logs archived.`

Interpretation:
- expected and useful
- archived console logs under `/var/log/bastille/` are a valid troubleshooting source

Recommended use:
- capture meaningful signatures from the archived logs into skill references
- avoid treating the raw log archive as the long-term knowledge store

### `initdb` fails with `could not create shared memory segment`

Likely cause:
- the jail does not yet allow the IPC path PostgreSQL needs during initialization

Observed shape:
- `shmget(...): Function not implemented`

Response:
- set:
  - `allow.sysvipc 1`
- restart the jail
- rerun `service postgresql initdb`
