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

# watchdog

> How Botify detects and relaunches accounts that failed to join the private server.

The Stale Join Watchdog monitors all bot accounts that are tracked as "running" (Roblox process is open) but are **not appearing in your ERLC private server** according to the PRC API. It catches accounts that launched successfully but failed to teleport or got stuck at a loading screen.

***

## How It Works

1. For every account tracked as "running" by the engine, Botify checks the PRC API `/server/players` response
2. If an account is missing from the server list after `stale_join_timeout` minutes (default: **10 minutes**), it is marked **stale**
3. An alert dialog is shown listing all stale accounts
4. Optionally, stale accounts are automatically relaunched with a configurable delay

<Note>
  The watchdog only fires while the engine is running (24/7 Alting or Normal Launch modes). It does **not** monitor accounts launched manually outside of the engine.
</Note>

***

## Stale Join Alert Dialog

When stale accounts are detected, a dialog appears:

```text theme={null}
⚠️  Stale Join Alert

The following accounts have been running for 10+ minutes
but are not detected in your private server:

  •  CoolAlt123   (running 14m)
  •  AltAccount7  (running 12m)

  [Relaunch All]      [Dismiss]
```

* Alerted accounts are **not alerted again** until they are relaunched and go stale a second time — preventing repeated popups for the same account
* The dialog shows each account's name and how long it has been running without joining

***

## Auto-Relaunch

Configure in **Settings → General** to automatically relaunch stale accounts without a dialog prompt:

| Setting                     | Key                    | Default | Range    |
| --------------------------- | ---------------------- | ------- | -------- |
| Not-in-Server Alert Timeout | `stale_join_timeout`   | 10 min  | 5–60 min |
| Stale Relaunch Delay        | `stale_relaunch_delay` | 5s      | 2–30s    |

The relaunch delay staggers relaunches to avoid flooding the server with simultaneous join requests.

***

## Jail Manager Integration

The watchdog integrates with ERLC's jail system via the PRC API:

* Monitors all active bot accounts for **jail status** in-game
* Tracks jail events alongside stale join events in the bot tracker
* Jailed bots are flagged in the Accounts table and can be optionally relaunched after release
* Jail events are logged to the Logs tab and `botify_logs` MongoDB collection

***

## Common Causes of Stale Joins

| Cause                      | Explanation                                              |
| -------------------------- | -------------------------------------------------------- |
| Teleport error 524         | VIP server is full or temporarily unavailable            |
| Teleport error 773         | Roblox failed to complete the teleport                   |
| Teleport error 279         | Connection error during join                             |
| Cookie expired mid-session | Account lost authentication during the teleport sequence |
| Region restriction         | Server or account is region-blocked                      |
| Ghost server               | Server appears active in PRC but is inaccessible         |

<Tip>
  If the same accounts repeatedly go stale, check their **Cookie Age** indicator in the Accounts tab. Yellow or red cookies should be refreshed immediately.
</Tip>
