Skip to main content

Troubleshooting

Solutions to common issues and debugging techniques.

Common Issues

  1. API Key not configured

    Error: API key not configured

    Solution: Set DELIVERY_API_KEY or add to env.config.json

  2. Network connection failed

    Error: Failed to connect to API server

    Solution: Check network connection and API URL configuration

  3. Machine not found

    Error: Machine 'invalid-id' not found

    Solution: Use search-machines to 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 - Success
  • 1 - General error
  • 2 - Configuration error
  • 3 - Network/API error
  • 4 - 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