Troubleshooting Guide

This guide covers common issues and their solutions when using Pilaf.

Connection Issues

RCON Connection Refused

Symptom:

[ERROR] Failed to connect to RCON server: Connection refused

Cause: The Minecraft server is not running or RCON is not enabled.

Solution:

  1. Verify the server is running:

    docker ps | grep minecraft
  2. Check server logs:

    docker-compose -f docker-compose.pilaf.yml logs
  3. Ensure RCON is enabled in server properties:

    enable-rcon=true
    rcon.port=25575
    rcon.password=dragon123

Mineflayer Bridge Not Responding

Symptom:

[ERROR] Health check failed: Connection refused to localhost:3000

Cause: The Mineflayer bridge server is not running.

Solution:

  1. Start the Mineflayer bridge:

    cd mineflayer-bridge
    npm install
    node server.js
  2. Check if the service is healthy:

    curl http://
    localhost:3000/health
  3. Verify port configuration in pilaf.yaml:

    client:
      port: 3000

Docker Container Won’t Start

Symptom:

[ERROR] Container failed to start: Exit code 1

Cause: Various issues including port conflicts or insufficient resources.

Solution:

  1. Check container logs:

    docker logs pilaf-minecraft-1
  2. Check if ports are already in use:

    lsof -i :255
    65
    lsof -i :25575
  3. Stop conflicting services:

    docker-compose -f docker-compose.pilaf.yml down

YAML Parsing Errors

Invalid YAML Syntax

Symptom:

[ERROR] Failed to parse story: mapping values are not allowed

Cause: YAML syntax error in the story file.

Solution:

  1. Validate YAML syntax using a YAML linter

  2. Check for:

    • Inconsistent indentation (use spaces, not tabs)

    • Missing colons after keys

    • Unclosed quotes

# Correct
steps:
- action: "send_chat"
player: "test_player"
message: "hello"

# Incorrect (missing colon)
steps:
- action "send_chat"   # Missing colon after action
player: "test_player"

Unknown Action Type

Symptom:

[ERROR] Unknown action type: "invalid_action"

Cause: The action type is misspelled or not supported.

Solution:

  1. Check the action type against Command Reference

  2. Common mistakes:

    • send_message instead of send_chat

    • check_inventory instead of check_player_inventory

  3. Ensure the backend supports the action

Missing Required Field

Symptom:

[ERROR] Missing required field: 'player' for action 'send_chat'

Cause: The action requires a field that is not provided.

Solution:

  1. Review the action documentation for required fields

  2. Add the missing field to your story:

    steps:
      - action: "send_chat"
        player: "test_player"  # This field is required
        message: "hello"

Backend Issues

Docker Backend Timeout

Symptom:

[ERROR] Backend initialization timed out after 120 seconds

Cause: Server took too long to start.

Solution:

  1. Increase timeout in configuration:

    backend:
      initialization_timeout: 300  # 5 minutes
  2. Check server resources:

    docker stats
  3. Reduce server view distance for faster startup:

    docker:
      environment:
        VIEW_DISTANCE: 4
        DIFFICULTY: peaceful

Mineflayer Player Connection Failed

Symptom:

[ERROR] Failed to connect player: Authentication failed

Cause: Invalid credentials or offline mode not enabled.

Solution:

  1. Configure offline mode:

    server:
      online_mode: false
  2. Verify server is in offline mode:

    docker exec pilaf-minecraft-1 cat server.properties | grep online-mode

Backend Type Not Supported

Symptom:

[ERROR] Unsupported backend type: 'mybackend'

Cause: Invalid backend type specified.

Solution:

  1. Use one of the supported backend types:

    • docker

    • mineflayer

    • headlessmc

  2. Check your configuration:

    backend:
      type: docker  # Correct

Test Execution Issues

Assertion Failed

Symptom:

[ERROR] Assertion failed: Expected pattern 'diamond_sword' not found

Cause: The assertion condition was not met.

Solution:

  1. Review the test story logic

  2. Check if the expected event actually occurred

  3. Increase wait time before assertion:

    steps:
      - action: "give_item"
        player: "test_player"
        item: "diamond_sword"
      - action: "wait"
        seconds: 5  # Increase wait time
      - action: "check_inventory"
        player: "test_player"
        item: "diamond_sword"

Story Variable Not Found

Symptom:

[ERROR] Variable 'previous_state' not found in state store

Cause: The variable was not stored before being referenced.

Solution:

  1. Ensure capture_state is called before assert_state:

    steps:
      - action: "capture_state"
        variable: "before_give"
        target: "inventory"
      - action: "give_item"
        player: "test_player"
        item: "bow"
      - action: "capture_state"
        variable: "after_give"
        target: "inventory"
      - action: "assert_state"
        expected: "before_give"
        actual: "after_give"
        assertion:
          type: "assert_not_equal"

Cleanup Action Failed

Symptom:

[WARN] Cleanup action failed: deop test_player

Cause: The player was never opped or doesn’t exist.

Solution:

  1. Make cleanup actions optional:

    cleanup:
      - action: "execute_rcon_command"
        command: "deop test_player"
        optional: true  # Ignore failures
  2. Verify the player exists before cleanup

Performance Issues

Slow Test Execution

Symptom: Tests take longer than expected to complete.

Cause: Long wait times or inefficient test design.

Solution:

  1. Reduce wait times to minimum necessary:

    - action: "wait"
      seconds: 1  # Use minimum necessary
  2. Use event-based waiting instead of time-based:

    # Instead of
    - action: "wait"
      seconds: 5
    
    # Use
    - action: "wait_for_log"
      pattern: "Player spawned"
      timeout: 5
  3. Run tests in parallel (future feature)

High Memory Usage

Symptom: Out of memory errors or slow system performance.

Cause: Too many concurrent tests or large server instances.

Solution:

  1. Limit server resources:

    docker:
      memory: "2g"
      cpu_shares: 1024
  2. Clean up after each test:

    cleanup:
      - action: "execute_rcon_command"
        command: "kill @e[type=item]"

Getting More Help

Enable Debug Mode

Run with verbose logging:

./gradlew run --args="--verbose --backend docker demo-story.yaml"

Check Logs

View detailed logs:

tail -f target/pilaf-reports/*.log

Report Issues

If you can’t resolve an issue:

  1. Check existing GitHub Issues

  2. Create a new issue with:

    • Steps to reproduce

    • Expected behavior

    • Actual behavior

    • Full error output

    • Configuration files (remove sensitive data)


Back to top

Copyright © 2025 Pilaf Contributors. Open source under the MIT license.

This site uses Just the Docs, a documentation theme for Jekyll.