Common issues and solutions for gac.
- Authentication Issues
- Permission Issues
- File Permission Warnings
- Domain Configuration Issues
- Input Validation Errors
- API Rate Limiting
- Getting Help
Solution:
- Verify your OAuth2 credentials are correctly set up in Google Cloud Console
- Check that the client secret file exists and has correct permissions:
ls -l ~/.credentials/client_secret.json chmod 600 ~/.credentials/client_secret.json
- Ensure you're authenticating with a Google Workspace admin account
- Verify the required APIs are enabled in Google Cloud Console:
- Admin SDK API
- Google Calendar API
- Groups Settings API
Solution:
# Delete the cached token and re-authenticate
rm ~/.credentials/gac.json
gac user listSolution:
- Check that your OAuth consent screen is configured in Google Cloud Console
- Ensure your app is set to "Internal" for Google Workspace domains
- Verify all required scopes are added to the consent screen
- Try deleting and recreating the OAuth client ID
Solution:
- Verify the authenticated account has Google Workspace admin privileges
- Check that all required OAuth2 scopes are granted (see Authentication Guide)
- Try deleting and re-creating your OAuth2 credentials in Google Cloud Console
- Ensure you have the specific admin role needed:
- User Admin - For user operations
- Groups Admin - For group operations
- Organizational Units Admin - For OU operations
Solution:
- Verify the Groups Settings API is enabled in Google Cloud Console
- Check that the scope
https://www.googleapis.com/auth/apps.groups.settingsis included - Delete cached token and re-authenticate:
rm ~/.credentials/gac.json gac group-settings list <group-email>
Solution:
# Fix credential directory permissions
chmod 700 ~/.credentials
# Fix credential file permissions
chmod 600 ~/.credentials/*.jsonSolution:
# Ensure credentials directory exists
mkdir -p ~/.credentials
# Fix directory permissions
chmod 700 ~/.credentials
# Verify you have write access
ls -la ~/.credentialsSolution:
-
Set your domain in configuration:
# Via environment variable export GAC_DOMAIN=example.com # Via config file echo "domain: example.com" > ~/.google-admin.yaml # Via command-line flag gac --domain example.com user list
-
Verify domain is correct:
# Check what domain is being used gac user list | head -1
Solution:
- Use full email format:
team@example.cominstead of justteam - Or set the domain globally so short names work:
export GAC_DOMAIN=example.com gac group list team # Now works
Solution:
- Emails must be valid RFC 5322 format:
user@example.com - No spaces, special characters in local part
- Must include
@and valid domain
Valid examples:
john.doe@example.com
jane-smith@example.com
user+tag@example.com
Invalid examples:
john doe@example.com # No spaces
@example.com # No local part
user@ # No domain
Solution:
- Format as
type:number - Supported types:
mobile,work,home - Extensions:
work:555-123-4567,555 - Multiple phones:
mobile:555-555-5555; work:555-123-4567,555
Valid examples:
mobile:555-555-5555
work:555-123-4567,555
mobile:555-555-5555; work:555-123-4567
Solution:
- Use
uuidgento generate valid UUIDs:gac user update --id $(uuidgen) user@example.com - UUID format:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Solution:
-
Implement delays between bulk operations:
for user in $(cat users.txt); do gac user create $user sleep 1 # Wait 1 second between calls done
-
Reduce frequency of API calls:
- Use batch operations when possible
- Cache results locally instead of re-fetching
-
Check quotas in Google Cloud Console:
- Go to APIs & Services > Quotas
- Look for Admin SDK API quotas
- Consider requesting quota increases
-
Use exponential backoff:
# Retry with exponential backoff retry_count=0 max_retries=3 while [ $retry_count -lt $max_retries ]; do if gac user create user@example.com; then break fi retry_count=$((retry_count + 1)) sleep $((2 ** retry_count)) done
Solution:
- Reduce concurrency in batch operations
- Run operations sequentially instead of in parallel
- Add delays between requests
Possible causes:
- Email already exists
- Invalid email format
- Missing required permissions
- Domain not allowed
Solution:
# Check if user exists
gac user list user@example.com
# Verify email format
# Must be: user@example.com
# Check your permissions
# Need User Admin rolePossible causes:
- Wrong group email
- Missing Groups Settings API scope
- Insufficient permissions
Solution:
# Use full email format
gac group-settings list team@example.com
# Check settings were applied
gac group-settings list team@example.com --format json
# Re-authenticate with correct scopes
rm ~/.credentials/gac.json
gac group-settings list team@example.comPossible causes:
- Calendar API not enabled
- Wrong calendar email
- Invalid date format
Solution:
- Enable Calendar API in Google Cloud Console
- Use correct date formats:
- All-day:
2025-10-15 - Timed:
2025-10-15T09:00:00-04:00(RFC3339)
- All-day:
- Verify calendar email exists
-
Check documentation:
- Authentication Guide - OAuth setup
- User Guide - User operations
- Command Reference - All commands
-
Review examples:
- Examples directory - Working scripts
- Examples README - Scenario walkthroughs
-
Verify setup:
# Test authentication gac user list # Check configuration cat ~/.google-admin.yaml # Verify credentials ls -la ~/.credentials/
If you encounter issues not covered here:
-
Search existing issues:
- Check GitHub Issues
- Look for similar problems and solutions
-
Open a new issue with:
- Command you ran - Exact command that failed
- Error message - Full error output
- Your configuration - Redact sensitive info (tokens, emails)
- Steps to reproduce - Minimal example that shows the issue
- Environment - OS, Go version, gac version
-
Include diagnostic info:
# Version info gac version # Check file permissions ls -la ~/.credentials/ # Verify domain config cat ~/.google-admin.yaml
For verbose output, use environment variables:
# Enable debug logging (if implemented)
export GAC_DEBUG=true
gac user list
# Check what API calls are being made
# (Requires modifying code to add logging)