Troubleshooting
Resolve common RunRL Python SDK issues.
Troubleshooting
Authentication
AuthenticationError
Cause: Missing or invalid API key. The client raises this immediately if neither the
constructor nor RUNRL_API_KEY
provides a token.
Fix:
Verify the key in the RunRL dashboard or rotate it if you suspect expiry.
AuthorizationError
Cause: Key exists but lacks scopes for the requested action (e.g., uploading files with a read-only key).
Fix: Regenerate the key with write
scope or call client.api_keys.update(key_id, scopes=[...])
.
File Uploads
ValidationError
(422)
Cause: Prompt JSONL is malformed or reward code doesn't define reward_fn
correctly.
Checklist:
- Each JSONL line parses individually.
- Prompt entries include a
prompt
field with message objects. - Reward function files define
def reward_fn(completion, **kwargs): ...
.
NotFoundError
Cause: Referencing a file that was deleted (soft deletes still hide it from the API).
Fix: Re-upload or list existing files: client.files.list().items
.
Run Creation
ValidationError
(missing fields)
Cause: Required parameters omitted (model
, prompt_file_id
, reward_file_id
, type
).
Ensure file IDs come from File.id
, not File.file_id
fields belonging to other users.
Futures Stuck Polling
If future.result()
appears to hang:
- Call
future.status()
to fetch the latest run state. - Check
client.runs.logs(run_id)
for setup errors. - Confirm billing status—runs can pause provisioning if billing validation fails.
RunFailedError
Raised when a run terminates in FAILED
. Inspect error_message
:
Network & Rate Limiting
Connection Issues (RunRLException
wrapping httpx.RequestError
)
- Check proxy/VPN settings.
- Increase timeout:
RunRLClient(timeout=60)
. - Retry manually; the client already performs exponential backoff.
RateLimitError
Indicates the key exceeded its hourly quota. Monitor the headers (X-RateLimit-Remaining
) or lower
polling frequency via poll_interval
.
Package Import Errors
- Install the SDK in the active environment:
pip install runrl
. - If running tests or examples, set
PYTHONPATH=. python -m pytest
so local modules resolve before publishing.
Getting Help
- For API responses not covered here, log the payload:
response.json()
usinghttpx
hooks. - Report SDK bugs or feature requests to
support@runrl.com
with stack traces and run IDs.