Skip to main content
This guide covers common issues you may encounter when using Basecut, along with their solutions and debugging techniques.

Database Connection Issues

Connection Refused

Symptoms:
Solutions:
  1. Verify database is running:
  2. Check connection string format:
  3. Test connectivity:
  4. Check firewall rules:
    • Ensure port 5432 is open
    • For self-hosted agents, verify network security groups allow outbound connections

Host Not Found

Symptoms:
Solutions:
  1. Verify hostname resolves:
  2. Use IP address instead:
  3. For private databases without public access:
    • Use local execution (default) instead of agent execution
    • Or deploy self-hosted agents in the same VPC

Permission Denied

Symptoms:
Solutions:
  1. Grant SELECT permissions:
  2. Verify user permissions:

SSL/TLS Connection Errors

Symptoms:
Solutions:
  1. For databases requiring SSL:
  2. For self-signed certificates:
  3. Disable SSL verification (dev only, not recommended for production):

Authentication Failures

Invalid API Key

Symptoms:
Solutions:
  1. Verify API key is set:
  2. Re-authenticate:
  3. Check API key format:
    • Live keys: bc_live_*
    • Test keys: bc_test_*
    • Ensure no extra spaces or newlines
  4. For CI/CD, verify secret is correctly set:
  5. Check API key in dashboard:
    • Login to basecut.dev
    • Navigate to Settings → API Keys
    • Verify key hasn’t been revoked

whoami Command Fails

Symptoms:
Solutions:
  1. Login again:
  2. Check credentials file:
  3. Use the profile you logged into:

Snapshot Creation Issues

Extraction Limits Reached

Symptoms:
Solutions:
  1. Increase limits in basecut.yml:
  2. Add more specific WHERE clauses:
  3. Use table-specific limits:

Foreign Key Constraint Violations

Symptoms:
Solutions:
  1. This shouldn’t happen! Basecut automatically ensures referential integrity. If you see this:
  2. Workaround - increase upstream depth:

Timeout on Large Extractions

Symptoms:
Solutions:
  1. Use self-hosted agents instead of local execution:
  2. Reduce snapshot scope:
  3. Use sampling:

Snapshot Restore Issues

Schema Validation Failures

Symptoms:
Solutions:
  1. Run migrations first:
  2. Force restore (skip validation):
    Only use --force if you understand the schema differences. Missing columns or type changes can still fail during insert.
  3. Inspect the exact snapshot reference you’re restoring:

Duplicate Key Violations

Symptoms:
Solutions:
  1. Use —reset flag to truncate tables first:
    --reset is destructive. It truncates all tables included in the snapshot before restoring.
  2. Manually truncate conflicting tables:
  3. Restore to empty database:

Foreign Key Cycle / Non-Deferrable Constraint Block

Symptoms:
This usually means your restore scope includes self-referential tables or FK cycles, and at least some of those constraints are NOT DEFERRABLE. Solutions:
  1. Run FK preflight analysis first (recommended):
    Use the output to identify blocking tables/constraints and whether nullable fallback is available.
  2. If nullable fallback is available, run restore normally: Basecut will automatically use a two-phase strategy (INSERT with temporary NULLs, then backfill) for eligible nullable FK cycles.
  3. Make blocking FK constraints deferrable (recommended long-term):
  4. Use unsafe bypass only as a last resort:
    --unsafe-disable-fk-checks disables FK enforcement during restore. Use only in controlled environments and validate integrity after restore.

Restore Too Slow

Symptoms:
  • Restore takes several minutes for small snapshots
  • Progress bar stuck at 0%
Solutions:
  1. Check database connectivity:
  2. Use local database for faster restore:
  3. Disable triggers during restore (advanced):

Storage Issues

S3 Access Denied

Symptoms:
Solutions:
  1. Verify AWS credentials:
  2. Check IAM policy grants s3:PutObject, s3:GetObject, and s3:ListBucket on your bucket. See Storage Providers for the full policy.
  3. Use correct credentials:

S3 Region/Endpoint Errors (Common with --async)

Symptoms:
Why this happens:
  • Local runs can succeed using your local AWS profile region
  • --async runs execute on a self-hosted agent, which may not have the same region config
Solutions:
  1. Set region in basecut.yml for S3 output:
  2. For Cloudflare R2 / S3-compatible endpoints, set both endpoint and region:
  3. If you cannot set output.region, ensure AWS_REGION is set on the agent environment.

GCS Permission Errors

Symptoms:
Solutions:
  1. Verify GCS credentials:
  2. Check service account permissions:
  3. Use correct credentials:

Snapshot Not Found

Symptoms:
Solutions:
  1. List available snapshots:
  2. Check snapshot name spelling:
  3. Verify storage provider configuration:

Self-Hosted Agent Issues

Agent Not Picking Up Jobs

Symptoms:
  • Jobs submitted with --async never complete
  • Agent logs show no activity
Solutions:
  1. Check agent logs:
  2. Verify API key format and org access:
  3. Check network connectivity to Basecut API:
  4. Verify agent registration:
    • Check dashboard for registered agents
    • Ensure agent is in “Active” state

Agent Database Connection Failures

Symptoms:
Solutions:
  1. Test database access from agent:
  2. Check network security groups:
    • Verify agent’s security group allows outbound to database port
    • Verify database’s security group allows inbound from agent
  3. Use private IP for database in same VPC:

Performance Issues

Slow Extractions

Symptoms:
  • Snapshot creation takes hours
  • “Extracting…” stuck at same table count
Solutions:
  1. Check database indexes:
  2. Use sampling instead of full extraction:
  3. Reduce traversal depth:
  4. Use agent execution for large datasets:

Debugging Techniques

Check Configuration Parsing

Verify YAML syntax:

Test Individual Components

Test database connection:
Test storage access:

Getting Help

If you’ve tried the solutions above and still have issues:
  1. Check the logs:
    • Agent: docker logs basecut-agent
  2. File a GitHub issue:
  3. Contact support:

Next Steps

Environment Variables

Complete configuration reference

Agent Deployment

Self-hosted agent setup and debugging

CLI Reference

Complete command documentation