Skip to content

CLI Troubleshooting

This guide provides solutions for common issues encountered when using the PaiTIENT Secure Model CLI.

Common Issues and Solutions

Authentication Issues

Issue: API Key Not Recognized

Error: Invalid API key provided. Please check your API key and try again.

Solutions:

  1. Verify that your API key is correct and active in the PaiTIENT dashboard
  2. Check that you're using the correct environment variables:
    bash
    echo $PAITIENT_API_KEY
  3. Try logging in again:
    bash
    secure-model login

Issue: Client ID Not Found

Error: Client ID not found. Please check your client ID and try again.

Solutions:

  1. Verify your client ID in the PaiTIENT dashboard
  2. Ensure the environment variable is set correctly:
    bash
    echo $PAITIENT_CLIENT_ID

Connection Issues

Issue: Cannot Connect to API

Error: Could not connect to PaiTIENT API. Connection timed out.

Solutions:

  1. Check your internet connection
  2. Verify that the API endpoint is correct:
    bash
    echo $PAITIENT_ENDPOINT
  3. If you're behind a corporate firewall, configure proxy settings:
    bash
    export HTTP_PROXY="http://proxy.example.com:8080"
    export HTTPS_PROXY="http://proxy.example.com:8080"

Issue: SSL Certificate Errors

Error: SSL certificate verification failed.

Solutions:

  1. Update your CA certificates:
    bash
    # Debian/Ubuntu
    sudo apt-get update && sudo apt-get install ca-certificates
    
    # macOS
    brew upgrade openssl
  2. As a temporary workaround (not recommended for production), disable SSL verification:
    bash
    export PAITIENT_VERIFY_SSL=false

Deployment Issues

Issue: Deployment Stuck in Pending State

Status: pending - Initializing secure model deployment

Solutions:

  1. Check deployment status for detailed information:
    bash
    secure-model status --deployment-id dep_12345abcde --verbose
  2. Look for errors in the logs:
    bash
    secure-model logs --deployment-id dep_12345abcde
  3. If the deployment has been pending for more than 15 minutes, try canceling and redeploying:
    bash
    secure-model cancel deployment --deployment-id dep_12345abcde
    secure-model deploy model --name ZimaBlueAI/HuatuoGPT-o1-8B

Issue: Deployment Failed

Status: failed - Error downloading model

Solutions:

  1. Check detailed logs for the specific error:
    bash
    secure-model logs --deployment-id dep_12345abcde
  2. Verify that the model name is correct:
    bash
    secure-model list models | grep HuatuoGPT
  3. Check account quotas in the PaiTIENT dashboard to ensure you have capacity for the deployment

Generation Issues

Issue: Timeout During Text Generation

Error: Request timed out after 30 seconds.

Solutions:

  1. Increase the timeout for the request:
    bash
    secure-model generate --deployment-id dep_12345abcde --prompt "..." --timeout 60
  2. For long-running generations, use streaming mode:
    bash
    secure-model generate --deployment-id dep_12345abcde --prompt "..." --stream
  3. Reduce the max_tokens parameter:
    bash
    secure-model generate --deployment-id dep_12345abcde --prompt "..." --max-tokens 300

Issue: Rate Limit Exceeded

Error: Rate limit exceeded. Please try again later.

Solutions:

  1. Implement exponential backoff in your scripts:
    bash
    #!/bin/bash
    
    BACKOFF=1
    MAX_RETRIES=5
    RETRY=0
    
    while [ $RETRY -lt $MAX_RETRIES ]; do
      secure-model generate --deployment-id dep_12345abcde --prompt "..."
      
      if [ $? -eq 0 ]; then
        # Success
        break
      fi
      
      # Calculate backoff with jitter
      JITTER=$(awk -v min=0 -v max=1 'BEGIN{srand(); print min+rand()*(max-min)}')
      SLEEP_TIME=$(echo "$BACKOFF + $JITTER" | bc)
      
      echo "Rate limit exceeded. Retrying in $SLEEP_TIME seconds..."
      sleep $SLEEP_TIME
      
      # Exponential backoff
      BACKOFF=$(echo "$BACKOFF * 2" | bc)
      RETRY=$((RETRY+1))
    done
  2. Contact support to request a rate limit increase

CLI Installation Issues

Issue: CLI Not Found After Installation

command not found: secure-model

Solutions:

  1. Verify the installation:
    bash
    which secure-model
  2. Ensure the installation directory is in your PATH:
    bash
    echo $PATH
  3. If installed via npm, verify global installation:
    bash
    npm list -g paitient-secure-model

Issue: Permission Denied

Error: EACCES: permission denied

Solutions:

  1. For npm installations, use proper permissions:
    bash
    sudo npm install -g paitient-secure-model
  2. For manual installations, check file permissions:
    bash
    chmod +x /path/to/secure-model

Version and Update Issues

Issue: CLI Version Mismatch

Warning: Your CLI version (1.0.0) is outdated. Latest version is 1.2.0.

Solutions:

  1. Update the CLI:
    bash
    npm update -g paitient-secure-model
  2. Force update when prompted:
    bash
    secure-model update

Issue: Incompatible API Version

Error: This CLI version is not compatible with the current API version.

Solutions:

  1. Update to the latest CLI version:
    bash
    npm install -g paitient-secure-model@latest
  2. If you need to use a specific API version:
    bash
    secure-model configure --api-version 2023-11-01

Debugging Tools

CLI Verbose Mode

Enable verbose output for detailed debugging information:

bash
secure-model deploy model --name ZimaBlueAI/HuatuoGPT-o1-8B --verbose

Collecting Diagnostic Information

Generate a diagnostic report for support:

bash
secure-model diagnostics > diagnostics.log

This collects system information, CLI configuration, and recent logs while redacting sensitive information.

HTTP Logging

Enable HTTP logging to see API requests and responses:

bash
export PAITIENT_HTTP_LOGGING=true
secure-model list deployments

Network Diagnostics

Test connectivity to the PaiTIENT API:

bash
secure-model diagnostics network

Getting Help

CLI Help Command

View help for specific commands:

bash
secure-model help deploy

Support Channels

  1. Documentation: Visit docs.paitient.ai
  2. Support Portal: Submit a ticket at support.paitient.ai
  3. Community Forum: Join discussions at community.paitient.ai

Feature Requests and Bug Reports

Submit feature requests and bug reports on our GitHub repository: github.com/paitient-ai/secure-model-cli

Next Steps

Released under the MIT License.