Worker Troubleshooting
Common worker issues and solutions.
"No API key found"
Fix: Set api_key in your YAML config, or set CUEAPI_API_KEY env var, or run cueapi login.
"At least one handler must be defined"
Your config file has no handlers or the handlers section is empty.
Fix: Add at least one handler to your config:
yaml
handlers:
my-task: "python3 handler.py"Worker running but not picking up executions
Common causes:
- Task mismatch —
payload.taskdoesn't match any handler key - No worker transport cues — Cues are using webhook transport, not worker
- Wrong API key — Worker is authenticated as a different user
Debug:
bash
# Check what's claimable
curl https://api.cueapi.ai/v1/executions/claimable \
-H "Authorization: Bearer cue_sk_YOUR_KEY"
# Verify your cue uses worker transport
cueapi get cue_xxxHandler script not found
Error: [Errno 2] No such file or directory: 'handler.py'
Fix: Use absolute paths or set cwd in the handler config:
yaml
handlers:
my-task:
cmd: "python3 handler.py"
cwd: "/home/user/scripts"Handler timeout
Error: Handler timed out after 300s
Fix: Increase the timeout in handler config:
yaml
handlers:
my-task:
cmd: "python3 slow_task.py"
timeout: 600 # 10 minutesTemplate variables not resolving
If {{ payload.field }} appears as a literal string in your env vars, check:
- Your payload contains the expected field
- The template syntax is correct (double curly braces, no spaces around dots)
- Nested fields use dot notation:
{{ payload.config.key }}
Connection errors
Error: Connection refused to api.cueapi.ai
Fix:
- Check your internet connection
- Verify the API is up:
curl https://api.cueapi.ai/status - Check if you need to configure a proxy
Worker heartbeat failures
If the worker can't send heartbeats, it will log warnings but continue running. Executions may not be routed to this worker.
Fix: Check network connectivity and API key validity.