Command Not Found
Error: gws: command not found
Cause: The CLI is not installed or not in your PATH.
Solution for npm/npx installation
Solution for npm/npx installation
If you installed via npm:Verify installation:If Add it to your PATH in Reload your shell:
which gws returns nothing:
Your npm global bin directory is not in your PATH.Find the npm bin path:~/.bashrc, ~/.zshrc, or equivalent:Solution for Cargo installation
Solution for Cargo installation
If you installed via Cargo:Ensure Add to your shell config (
~/.cargo/bin is in your PATH:~/.bashrc or ~/.zshrc) to make it permanent.JSON Parsing Errors
Error: Failed to parse JSON
Cause: Invalid JSON syntax in --params or --json arguments.
Common JSON mistakes
Common JSON mistakes
Problem: Single quotes inside JSON stringsSolution: Use single quotes for the shell, double quotes for JSON:Problem: Trailing commasSolution: Remove trailing commas:
Validate JSON before using
Validate JSON before using
Use If
jq to validate your JSON:jq returns formatted JSON, it’s valid.Build complex JSON with jq:Error: Missing required field
Cause: Your JSON is missing a required parameter for the API method.
Solution: Use gws schema to inspect the method’s required fields:
Rate Limiting
Error: 429 Too Many Requests
Short-term solutions
Short-term solutions
- Wait and retry: Most quotas reset daily or per minute
- Use pagination delay: Add
--page-delayto slow down requests: - Reduce page size: Request fewer items per page:
Long-term solutions
Long-term solutions
Request a quota increase:
- Go to Google Cloud Console > IAM & Admin > Quotas
- Filter by the API service (e.g., “Gmail API”)
- Select the quota metric you need to increase
- Click Edit Quotas and submit a request
Network Errors
Error: Connection timeout or DNS resolution failed
Causes:
- No internet connection
- Firewall blocking Google API domains
- Proxy configuration needed
Solutions
Solutions
Check connectivity:Configure proxy (if behind corporate firewall):Verify DNS:If DNS fails, check your network settings or try a different DNS server (e.g., Google DNS:
8.8.8.8).Error: SSL certificate problem
Cause: SSL/TLS certificate verification failed.
Solution:
-
Update your system’s CA certificates:
- If behind a corporate proxy with SSL inspection, install your organization’s root CA certificate.
Discovery Document Errors
Error: Failed to fetch discovery document
Cause: Cannot retrieve the API specification from Google’s Discovery Service.
Solutions
Solutions
Check network connectivity (see Network Errors above)Clear cache: Discovery documents are cached for 24 hours:Verify the service name:Check Google API status: Visit Google Workspace Status Dashboard to verify the API is operational.
Pagination Issues
Error: Page token invalid
Cause: Page tokens expire after a short period (typically 15-60 minutes).
Solution: Restart pagination from the beginning. Don’t save and reuse page tokens across sessions.
Issue: --page-all returns fewer results than expected
Cause: The --page-limit default is 10 pages.
Solution: Increase the page limit:
File Upload Errors
Error: File not found or Permission denied
Cause: The file path is incorrect or not readable.
Solution:
Error: Invalid multipart request
Cause: The API method doesn’t support file uploads, or the request body is malformed.
Solution: Ensure you’re using an upload-capable method:
Platform-Specific Issues
Windows: PowerShell JSON escaping
Windows: PowerShell JSON escaping
PowerShell treats JSON quotes differently:Use backticks to escape inner quotes:Or use a here-string:
macOS: Keychain access denied
macOS: Keychain access denied
Error:
Failed to access keychainCause: The CLI cannot access the macOS Keychain to store/retrieve encrypted credentials.Solution:- Open Keychain Access app
- Search for “gws”
- Delete any existing gws entries
- Run
gws auth loginagain and approve keychain access when prompted
Linux: libsecret not installed
Linux: libsecret not installed
Error:
Secret service not availableCause: The Linux Secret Service backend is missing.Solution: Install the required package:Getting Help
If you’re still experiencing issues:Built-in Help
Report Issues on GitHub
File a bug report at github.com/googleworkspace/cli/issues. Include:- CLI version:
gws --version - Operating system and version
- Exact command you ran
- Full error output (redact sensitive information)
- Steps to reproduce
Dry Run for Debugging
Preview the request without executing:- HTTP method and URL
- Request headers
- Request body
- Authentication status
Community Support
Check existing GitHub issues for similar problems:Additional Resources
- Authentication Guide - Detailed auth setup
- API Not Enabled Errors - Fix
accessNotConfigurederrors - Authentication Errors - OAuth and credential issues
- Google Workspace Status Dashboard - API availability