Common issues and solutions when using the workload-exporter tool.
Cause: Cannot reach the CockroachDB cluster.
Solutions:
- Verify the cluster is running
- Check the host and port in your connection string
- Ensure network connectivity (firewall rules, security groups)
- Verify you're using the correct port (default: 26257)
Example:
# Verify connection with psql or cockroach sql
cockroach sql --url "postgresql://user:password@host:26257/database?sslmode=verify-full"Cause: SSL mode mismatch or certificate issues.
Solutions:
- For secure clusters, use
sslmode=verify-fullorsslmode=require - For local/dev clusters, you might use
sslmode=disable(not recommended for production) - Ensure CA certificates are properly configured
Examples:
# Secure cluster with certificate verification
workload-exporter export -c "postgresql://user:password@host:26257/?sslmode=verify-full&sslrootcert=/path/to/ca.crt"
# Local dev cluster (insecure)
workload-exporter export -c "postgresql://user:password@localhost:26257/?sslmode=disable"Cause: Incorrect username or password.
Solutions:
- Verify credentials
- Check if user exists in the cluster
- Ensure password is properly URL-encoded in connection string
Example:
# If password contains special characters, URL-encode them
# Password with @ symbol: p@ssword -> p%40ssword
workload-exporter export -c "postgresql://user:p%40ssword@host:26257/?sslmode=verify-full"Cause: User lacks required permissions to read system tables.
Required Permissions:
- Read access to
crdb_internaltables - Read access to system settings
- Read access to all user databases (for schema export)
Solutions:
- Grant admin role:
GRANT admin TO username; - Or grant specific permissions:
GRANT SELECT ON crdb_internal.* TO username; GRANT SELECT ON system.* TO username;
Cause: The allow_unsafe_internals setting is required in CockroachDB 26.1+.
Solution: This is handled automatically by the exporter. If you still see this error:
- Ensure you're using the latest version of the exporter
- Manually set the session variable before exporting:
SET allow_unsafe_internals = true;
Cause: Incorrect time format for --start or --end flags.
Required Format: RFC3339 format
Examples:
# Correct formats
--start "2025-04-18T13:25:00Z" # UTC
--start "2025-04-18T13:25:00-05:00" # With timezone offset
--start "2025-04-18T13:25:00.000Z" # With milliseconds
# Incorrect formats
--start "2025-04-18 13:25:00" # Missing 'T' and timezone
--start "04/18/2025 13:25:00" # Wrong formatCause: Time range doesn't contain any data.
Solutions:
- Check the time range covers when your cluster had activity
- Verify statistics are being collected (check cluster settings)
- Adjust
--startand--endflags to capture the desired period - Default is last 2 hours - adjust if needed
Example:
# Export last 24 hours
workload-exporter export -c "connection-string" \
-s "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" \
-e "$(date -u +%Y-%m-%dT%H:%M:%SZ)"Cause: Insufficient permissions or disk space.
Solutions:
- Check write permissions in the output directory
- Verify sufficient disk space
- Ensure the output path is valid
- Try specifying a different output location
Example:
# Specify custom output location
workload-exporter export -c "connection-string" -o "/tmp/my-export.zip"Cause: Export was interrupted or failed.
Solutions:
- Re-run the export
- Check logs for errors during export
- Enable debug logging to see detailed progress:
workload-exporter export -c "connection-string" --debug
Cause: Large dataset or slow network.
Solutions:
- Reduce the time range to export less data
- Export during off-peak hours
- Check network bandwidth to the cluster
- Large exports may take several minutes - this is normal
Cause: Very large datasets being processed.
Solutions:
- Reduce the time range
- Run on a machine with more available memory
- Close other applications
For detailed information about what the exporter is doing:
workload-exporter export -c "connection-string" --debugThis will show:
- Connection attempts
- Each query being executed
- Files being created
- Progress of the export
To verify what was exported:
# List files in the export
unzip -l workload-export.zip
# Extract and examine
unzip workload-export.zip -d export-contents
cd export-contents
cat metadata.json | jq .
head crdb_internal.statement_statistics.csvNo known version-specific issues.
No known version-specific issues.
The allow_unsafe_internals setting must be enabled. The exporter handles this automatically, but ensure you're using the latest version of the tool.
If you continue to experience issues:
- Run with
--debugflag and save the output - Check the GitHub Issues
- Open a new issue with:
- CockroachDB version
- Exporter version
- Full command you ran (redact sensitive info)
- Error message or unexpected behavior
- Debug output (if available)
Before running a full export, test your connection:
cockroach sql --url "postgresql://user:password@host:26257/?sslmode=verify-full" -e "SELECT version();"# Last 2 hours (default)
workload-exporter export -c "connection-string"
# Last hour
workload-exporter export -c "connection-string" \
-s "$(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%SZ)"# Export a full day
workload-exporter export -c "connection-string" \
-s "2025-04-18T00:00:00Z" \
-e "2025-04-18T23:59:59Z" \
-o "april-18-export.zip"