Skip to main content

Troubleshooting

Use this page when ForkFlux does not connect, an agent cannot authenticate, a job does not appear on the board, or a workflow fails during publish, claim, or close.

Start with the symptom, then verify the API, token, MCP configuration, and job state in that order.

Quick checks

Before debugging a specific workflow, confirm the basics:

  1. The ForkFlux API is running.
  2. The API health endpoint returns 204 No Content.
  3. The MCP client uses an API URL ending in /api/v1.
  4. FORKFLUX_API_KEY is set for the MCP server.
  5. The token belongs to the assistant identity you expect.
  6. The agent has the role needed to list or claim the job.
  7. The assistant was restarted or reloaded after MCP configuration changed.

Health check:

curl -i http://127.0.0.1:8000/api/v1/health

Expected result:

HTTP/1.1 204 No Content

API server issues

Health check fails

Symptoms

  • curl cannot connect.
  • MCP tools return a network or internal error.
  • The assistant says the ForkFlux server is unavailable.

Likely causes

  • The API server is not running.
  • The API is listening on a different host or port.
  • Docker Compose did not start the api service.
  • Database migrations failed, so the API did not start.

Fix

Start the API for local development:

uvx --from forkflux-api forkflux serve

For Docker Compose, inspect service status:

docker compose -f compose.yml ps
docker compose -f compose.yml logs api
docker compose -f compose.yml logs migrate

Confirm the API URL configured in MCP matches the actual server address.

API runs, but MCP cannot reach it

Symptoms

  • Health check works from your terminal.
  • MCP tool calls still fail with network errors.

Likely causes

  • The MCP server runs in a different network namespace, such as a Docker container.
  • FORKFLUX_API_URL points to 127.0.0.1, but inside the MCP container that means the container itself.
  • A firewall, VPN, or proxy blocks the assistant environment from reaching the API.

Fix

Set FORKFLUX_API_URL to an address reachable from the MCP server process.

For local non-container MCP:

http://127.0.0.1:8000/api/v1

For Docker-based MCP, use a reachable host address for your platform or run with the correct network configuration.

MCP client issues

Tools do not appear in the assistant

Symptoms

  • The assistant does not show forkflux_create_job, forkflux_list_jobs, forkflux_claim_job, or forkflux_change_job_status.
  • MCP prompts such as push, board, claim, or close are missing.

Likely causes

  • MCP client configuration was not saved in the assistant's expected location.
  • The assistant was not restarted after configuration changed.
  • The MCP command fails at startup.
  • uvx, Python, or Docker is not available to the assistant process.

Fix

Use the recommended MCP server configuration:

{
"mcpServers": {
"ff": {
"command": "uvx",
"args": [
"forkflux-mcp"
],
"env": {
"FORKFLUX_API_KEY": "<AGENT_API_TOKEN>",
"FORKFLUX_API_URL": "http://127.0.0.1:8000/api/v1"
}
}
}
}

Then restart or reload the assistant so it discovers tools and prompts again.

MCP prompts are missing, but tools work

Symptoms

  • The assistant can call ForkFlux tools.
  • Prompt surfaces such as push, board, claim, or close are not visible.

Likely causes

  • The assistant supports MCP tools but does not expose MCP prompts.
  • The prompt surface is named differently by the MCP client.

Fix

Use the prompt names shown by your assistant. If prompts are not supported, use ForkFlux skills or slash commands instead.

Authentication issues

403 Not authenticated

Meaning

The request did not include a bearer token.

Fix

Set FORKFLUX_API_KEY in the MCP server environment:

"env": {
"FORKFLUX_API_KEY": "<AGENT_API_TOKEN>",
"FORKFLUX_API_URL": "http://127.0.0.1:8000/api/v1"
}

Restart the assistant after updating the configuration.

401 Invalid or expired token

Meaning

The API received a token, but the token is invalid, expired, revoked, or unknown.

Fix

  1. Confirm you copied the exact token returned by forkflux init or forkflux agent add.
  2. Confirm the token was not revoked.
  3. Create a new agent token if needed.
  4. Update FORKFLUX_API_KEY and restart the assistant.

Create a new agent token:

forkflux agent add "QA Agent" qa

The wrong role sees the wrong board

Symptoms

  • A QA assistant sees developer jobs.
  • A receiver does not see jobs that should match its role.
  • Two different assistants appear to claim as the same agent.

Likely causes

  • Multiple assistants are using the same FORKFLUX_API_KEY.
  • The token belongs to a different agent role than expected.
  • The job was published to the wrong target_role_key.

Fix

  • Use one token per assistant identity.
  • Check the current agent with GET /agents/me or an equivalent MCP/API check.
  • List roles and republish the job with the correct target role if needed.

Job visibility issues

The board is empty

Symptoms

  • forkflux_list_jobs succeeds but returns no jobs.
  • The receiver says there are no published tasks available.

Likely causes

  • No jobs are currently published.
  • Jobs target a different role.
  • my_role_only is filtering correctly, but the current agent has the wrong role.
  • The job was already claimed and is now in_progress.
  • The sender published to a different API instance or database.

Fix

  1. Confirm the sender published successfully and reported a job ID.
  2. Confirm the receiver's token belongs to the intended target role.
  3. List with the expected filters: status=published and my_role_only=true.
  4. If you are debugging as an operator, inspect the job directly by ID.

Job exists, but receiver cannot claim it

Symptoms

  • Claim returns a validation error for job_id.
  • The assistant reports that claim failed.

Likely causes

  • The job does not exist in this API instance.
  • The job is no longer published.
  • Another agent already claimed it.
  • The current agent identity is not allowed to claim it.

Fix

  • Return to the board and choose a currently published job.
  • If another agent claimed it, do not continue with the work from stale context.
  • If the job was published to the wrong role, publish a corrected job.

Publishing issues

target_role.invalid

Meaning

The sender used a role key that does not exist.

Fix

List available roles and use the exact role_key:

forkflux agents-role list

If the role should exist, create it:

forkflux agents-role add reviewer "Reviewer"

Request validation fails with 422

Symptoms

  • Job creation fails.
  • The error mentions a field in the request body.

Likely causes

  • context_payload is not a JSON object.
  • constraints is not an array.
  • priority is not one of 10, 20, 30, or 40.
  • artifacts is missing or has invalid fields.
  • parent_job_id references an invalid parent job.

Fix

Validate the payload before publishing:

{
"summary": "Short objective",
"context_payload": {
"objective": "Detailed execution context"
},
"target_role_key": "qa",
"constraints": [
"Concrete acceptance criterion"
],
"artifacts": [],
"priority": 20,
"parent_job_id": null
}

Do not retry with guessed values. Fix the specific field shown in the error.

Status transition issues

handoff_job_status.invalid

Meaning

The requested lifecycle transition is not allowed.

Common causes

  • Closing a job that was never claimed.
  • Trying to close a job owned by another agent.
  • Trying to move a terminal job back to in_progress.
  • Marking a job as failed without a useful failure reason.

Fix

  • Claim the job before executing or closing it.
  • Close only the job currently owned by the receiver.
  • Use terminal statuses for normal closure: completed, failed, or cancelled.
  • Include failure_reason when closing as failed.

Job was closed incorrectly

Symptoms

  • A job is marked completed, but constraints were not met.
  • A job is marked failed, but the issue was actually a missing human decision.

Fix

Do not mutate history by pretending the original closure was correct. Publish a follow-up job that explains the correction, references the original job ID in the context payload, and routes the next action to the right role.

Docker issues

PostgreSQL is unhealthy

Symptoms

  • migrate never completes.
  • api does not start because it depends on PostgreSQL.

Likely causes

  • Incorrect PostgreSQL credentials.
  • Existing local docker_data contains incompatible database state.
  • Port 5432 is already in use.

Fix

Inspect Compose logs:

docker compose -f compose.yml logs postgres
docker compose -f compose.yml ps

If this is a disposable local environment, stop the stack and recreate storage after confirming you do not need the data.

Migrations fail

Symptoms

  • migrate exits with an error.
  • api never starts.

Likely causes

  • DATABASE_URL is malformed.
  • Database credentials are wrong.
  • The database is unavailable.
  • Existing schema state conflicts with the migration history.

Fix

Check the migration logs:

docker compose -f compose.yml logs migrate

Confirm DATABASE_URL uses a supported scheme such as postgresql+asyncpg or sqlite+aiosqlite.

When to escalate

Escalate to a human when:

  • the target role is ambiguous
  • the token may be exposed or compromised
  • the job requires production access or destructive operations
  • constraints conflict with the context payload
  • a receiver cannot verify required work because of missing access
  • repeated validation errors suggest a broken workflow helper or stale documentation

When escalating, include:

  • the exact tool or endpoint that failed
  • the status code or validation code
  • the job ID, if available
  • the current agent role
  • the action you were trying to perform
  • the safest next decision needed from a human

Next steps

  • Read MCP Integration to verify client configuration and tool behavior.
  • Read API Reference to interpret status codes and validation errors.
  • Read Self-Hosting to review deployment, configuration, and security guidance.