Debugging workflow
When a connector fails, follow this diagnostic sequence:- Check logs - What error message?
- Inspect output - Did sync produce a .c1z file?
- Verify config - Are credentials valid?
- Test API access - Can you hit the target API directly?
- Isolate the issue - Which resource type fails?
Enable debug logging
debug, info, warn, error
Inspect sync output
Use thebaton CLI to inspect what was synced:
Common errors
Pagination loop detected
Error:next page token is the same as the current page token
Cause: Your List(), Entitlements(), or Grants() method returned the same pagination token it received.
Authentication failed
Error:401 Unauthorized or 403 Forbidden
Causes:
- Invalid or expired credentials
- Missing required scopes/permissions
- Wrong API endpoint
Rate limited
Error:429 Too Many Requests or slow sync performance
Solutions:
-
Reduce page size (more pages, smaller requests):
-
The SDK handles backoff automatically via
uhttp: -
Add explicit delays if needed:
Resource type mismatch
Error: Grants reference principals that don’t exist Cause: TheResourceId in a grant doesn’t match any synced resource.
Empty sync results
Error: Sync completes but produces no resources Causes:- API returns empty results (permissions issue)
- Pagination starts past end of data
- Filter too restrictive
Connection refused
Error:connection refused or no such host
TLS certificate errors
Error:x509: certificate signed by unknown authority
For testing only - skip TLS verification:
Performance issues
Slow sync
Memory issues
Daemon mode issues
Task polling failures
Error:failed to poll for tasks or authentication error
Connector not receiving tasks
Symptoms: Daemon runs but never processes anything Check:- Connector registered in C1 admin UI
- Sync scheduled
- Correct connector ID
Provisioning issues
Grant/revoke failures
Error:error: provisioner not found for resource type
Cause: Declared provisioning capability but didn’t implement the interface.
Duplicate objects after sync
Symptom
After running a sync, you see duplicate resources in C1: one created via Terraform/API and a separate one discovered by the connector.Causes
- RawId not set - Connector doesn’t include the
RawIdannotation - ID format mismatch - Connector uses a different ID format than expected
- match_baton_id value incorrect - Terraform resource has wrong ID value
- Case sensitivity - IDs may be case-sensitive
Resolution
Step 1: Verify the connector outputs RawId annotation:
Step 3: Update Terraform to use the exact match:
Diagnostic commands
Getting help
If you’ve tried these steps and still have issues:- Search existing issues on the connector’s GitHub repo
- Check SDK issues at baton-sdk issues
- Open a new issue with:
- Connector name and version
- Error message (full text)
- Debug logs (sanitized of credentials)
- Steps to reproduce