Skip to content

Operations Runbook

CraftyAI Agent edited this page May 26, 2026 · 5 revisions

Operations Runbook

Structured reference for common operational tasks. Each entry: symptom → cause → command → expected output.


Table of Contents

  1. Drain a Server for Maintenance
  2. Undrain a Server
  3. Check Circuit Breaker State
  4. Verify Routing Distribution
  5. Force a Health Check Refresh
  6. Interpret /vn status Output
  7. Rollback a Config Change
  8. Check for Updates Manually
  9. Handle "No Lobby Found" Errors

Drain a Server for Maintenance

When: You need to take a server offline for updates, restarts, or maintenance.

Steps:

  1. Mark the server as drained — no new players will be routed to it:

    /vn drain lobby-2
    
  2. Verify the drain is active:

    /vn drain status
    
  3. Expected output:

    Drained servers: lobby-2
    

    Or via /vn status, the server will show as [DRAINED].

  4. Wait for existing players to leave naturally, or kick them to another lobby first.

  5. When ready, proceed with your maintenance.

Notes:

  • Draining is in-memory only — it does not persist across proxy restarts
  • Drained servers are excluded from ALL routing algorithms
  • Existing players on the drained server are not kicked automatically

Undrain a Server

When: Maintenance is complete and you want the server to receive traffic again.

Steps:

  1. Remove the drain flag:

    /vn undrain lobby-2
    
  2. Verify:

    /vn drain status
    
  3. Expected output:

    No servers are currently drained.
    
  4. The server will immediately be eligible for routing again.


Check Circuit Breaker State

When: A server seems to be skipped by routing, or you suspect it's been marked as unhealthy.

Steps:

  1. Check server health and circuit breaker state:

    /vn debug server lobby-2
    
  2. Expected output includes:

    Server: lobby-2
    Registered: true
    Online: true
    Cached: true
    Checked at: 2025-05-17T12:00:00Z
    Sample age: 5s ago
    Players connected: 23
    Circuit breaker: CLOSED
    Drain status: active
    
  3. Circuit breaker states:

    • CLOSED — Normal operation. Server is included in routing.
    • OPEN — Server has failed too many health checks. Excluded from routing.
    • HALF_OPEN — Server is being tested with limited traffic to see if it recovered.
  4. To manually reset a circuit breaker (if you know the server is healthy):

    /vn reload
    

    This resets all circuit breaker states. There is no per-server reset command.


Verify Routing Distribution

When: You want to confirm that players are being spread evenly across your lobbies.

Steps:

  1. Check the status dashboard:

    /vn status
    
  2. Expected output includes a routing distribution section:

    Routing Distribution (last 60s):
      lobby-1: 45 connections
      lobby-2: 43 connections
      lobby-3: 42 connections
    
  3. If distribution is uneven:

    • Check if some servers are drained: /vn drain status
    • Check circuit breaker states: /vn debug server <name>
    • Verify your selection mode is appropriate (see Routing Algorithms)
    • If using weighted_round_robin, check that weights are set correctly
  4. For programmatic monitoring, use the Developer API:

    Map<String, Long> distribution = api.getRoutingDistribution();

Force a Health Check Refresh

When: You've just restarted a backend server and want the proxy to detect it immediately (instead of waiting for the cache to expire).

Steps:

  1. The health check cache runs on the interval set by cache_seconds (default: 60s). The cache warming task runs at 80% of the TTL to ensure fresh data is always available. To force a refresh:

    /vn reload
    

    This clears the health check cache, forcing fresh pings on the next routing request.

  2. Alternatively, reduce cache_seconds temporarily:

    [health_checks]
    cache_seconds = 2

    Then reload and change it back when done.

  3. Expected result: Within 2–10 seconds, the server should appear as healthy in /vn debug server <name>.


Interpret /vn status Output

When: You need a quick overview of the plugin's state.

Command:

/vn status

What each section means:

Section What It Shows
Version Installed VelocityNavigator version
Routing Mode Current selection algorithm
Default Lobbies Configured lobby servers with player counts
Circuit Breaker Summary of breaker states (e.g., "2 CLOSED, 1 OPEN")
Drained Servers List of servers currently drained (or "None")
Routing Distribution Connection counts per server over the last 60 seconds
Health Checks Status of the health check system
Contextual Routing Whether contextual routing is enabled

Rollback a Config Change

When: A config change caused issues and you need to revert.

Steps:

  1. VelocityNavigator automatically creates a .bak backup when it migrates or overwrites the config. Check for it:

    ls plugins/velocitynavigator/
  2. You should see:

    navigator.toml        ← current config
    navigator.toml.bak    ← backup from before last write
    
  3. To rollback:

    cp plugins/velocitynavigator/navigator.toml.bak plugins/velocitynavigator/navigator.toml
  4. Reload the config:

    /vn reload
    
  5. Verify: Check that the old settings are active:

    /vn status
    

Best practice: Before making manual config changes, always create your own backup:

cp navigator.toml navigator.toml.manual-backup

Check for Updates Manually

When: You want to see if a new version is available.

Steps:

  1. Run the update check command:

    /vn updatecheck
    
  2. Expected output (if update available):

    A new version of VelocityNavigator is available!
     Current: v4.1.0 | Latest: v4.2.0
    Download: https://modrinth.com/plugin/velocitynavigator
    
  3. Expected output (if up to date):

     VelocityNavigator is up to date! (v4.1.0)
    

Note: v4.1 re-introduced the periodic update checker with scheduled checks and exponential HTTP 429 backoff (up to 4 hours). Use /vn updatecheck for manual checks at any time.


Handle "No Lobby Found" Errors

When: Players see the "No lobby found" message when using /lobby.

Diagnosis:

  1. Check server health:

    /vn debug server lobby-1
    /vn debug server lobby-2
    
  2. Check circuit breaker states:

    /vn status
    
  3. Check if servers are drained:

    /vn drain status
    
  4. Check the proxy console for errors

Common causes and fixes:

Cause Fix
All lobby servers are offline Start the backend servers
All circuit breakers are OPEN Run /vn reload to reset breakers, then investigate why servers are failing
Lobby servers don't match velocity.toml Ensure server names in default_lobbies exactly match velocity.toml
Health check timeout too low Increase timeout_ms in [health_checks]
All servers are drained Run /vn undrain <server>
Degradation mode disabled Enable [degradation] to fall back to random when all health checks fail
max_players cap reached Increase max_players in LobbyEntry or set to -1 (uncapped)
  1. Quick fix for emergencies: Enable degradation mode so the plugin picks a random server even if health checks fail:
    [degradation]
    enabled = true
    mode = "random"

→ See also: Troubleshooting Guide | Configuration Guide | FAQ

Clone this wiki locally