Troubleshooting
Solutions to common issues and debugging techniques.
Common Issues
-
API Key not configured
Error: API key not configuredSolution: Set
DELIVERY_API_KEYor add toenv.config.json -
Network connection failed
Error: Failed to connect to API serverSolution: Check network connection and API URL configuration
-
Machine not found
Error: Machine 'invalid-id' not foundSolution: Use
search-machinesto find valid machine IDs
Debug Mode
Enable detailed logging:
# Show HTTP traces
delivery-cli --trace <command>
# Export as curl for manual testing
delivery-cli --dump <command>
Error Handling
The CLI provides clear error messages and appropriate exit codes:
0- Success1- General error2- Configuration error3- Network/API error4- Invalid input
Example error handling in scripts:
#!/bin/bash
if ! delivery-cli get-machine --machine-id test-001; then
echo "Failed to get machine details"
exit 1
fi