Documentation

Common Errors

Troubleshoot common GoMask CLI errors

Common Errors

Solutions for frequently encountered GoMask CLI errors.


Authentication Errors

"Authentication required"

Cause: CLI is not configured with API credentials.

Solution:

# Initialize with your API secret
gomask init

Get your API secret from datafactory.gomask.ai/settings/api-keys.


"Invalid API secret"

Cause: The API secret is incorrect or expired.

Solution:

  1. Verify your secret at datafactory.gomask.ai/settings/api-keys
  2. Generate a new key if needed
  3. Reinitialize:
gomask init --force

"Permission denied reading gomask.toml"

Cause: File permissions are too restrictive.

Solution:

chmod 600 gomask.toml

Connection Errors

"Unable to connect to database"

Cause: Database connection failed.

Solutions:

  1. Test the connection:
gomask connectors test my-connector
  1. Verify connection details:
gomask connectors show my-connector
  1. Check network connectivity:
# For PostgreSQL
pg_isready -h hostname -p 5432
  1. Verify firewall/security group rules

"Connection refused"

Cause: Database server is not accepting connections.

Solutions:

  • Verify the database is running
  • Check the port number
  • Ensure the host is correct (localhost vs. actual hostname)
  • Check if SSL is required
gomask connectors create \
  --name my-db \
  --type postgresql \
  --host localhost \
  --port 5432 \
  --database mydb \
  --username user \
  --ssl-mode require

"Connector not found"

Cause: The referenced connector doesn't exist.

Solutions:

  1. List available connectors:
gomask connectors list
  1. Check the connector_id in your YAML:
routine:
  connector_id: 1  # Use ID from 'gomask connectors list'

Validation Errors

"Invalid YAML syntax"

Cause: YAML file has syntax errors.

Solutions:

  1. Check for common issues:

    • Missing colons after keys
    • Incorrect indentation (use spaces, not tabs)
    • Unclosed quotes
  2. Validate with detailed output:

gomask validate routine.yaml --detailed

"Required field missing"

Cause: A required field is not present.

Example error:

Error: routine.name is required

Solution: Add the missing field:

routine:
  name: "My Routine"        # Required
  type: synthetic           # Required: synthetic or masking
  connector_id: 1           # Required

"Unknown function"

Cause: The specified function doesn't exist.

Solutions:

  1. List available functions:
gomask functions list --search function_name
  1. Check spelling and use exact function names:
columns:
  - column_name: email
    generation_function: generate_email  # Correct

"Environment variable not set"

Cause: A required environment variable is missing.

Example error:

Error: Environment variable DB_PASSWORD is required but not set
  Message: Database password required

Solutions:

  1. Set the variable:
export DB_PASSWORD="your-password"
  1. Or use a .env file:
gomask validate routine.yaml --env-file .env
  1. Or provide a default in YAML:
password: ${DB_PASSWORD:-default_value}

Execution Errors

"Foreign key violation"

Cause: Child records reference non-existent parent records.

Solutions:

  1. Check hierarchy levels - parents must be lower:
tables:
  - table_name: customers
    hierarchy_level: 0    # Parent - generates first
  - table_name: orders
    hierarchy_level: 1    # Child - generates after
  1. Ensure parent tables are included in the routine

  2. Configure foreign key columns correctly:

columns:
  - column_name: customer_id
    is_foreign_key: true
    referenced_table: customers
    referenced_column: id

"Table not found"

Cause: The specified table doesn't exist in the database.

Solutions:

  1. Verify table exists with correct schema:
tables:
  - table_name: users
    schema_name: public  # Check schema name
  1. Check case sensitivity (PostgreSQL is case-sensitive for quoted identifiers)

"Column not found"

Cause: The specified column doesn't exist.

Solutions:

  1. Verify column name matches database exactly
  2. Check for typos
  3. Verify the column hasn't been renamed

"Execution timeout"

Cause: Execution exceeded the timeout limit.

Solutions:

  1. Increase timeout:
gomask run routine.yaml --timeout 7200  # 2 hours
  1. Reduce record count
  2. Split into smaller routines

"Out of memory"

Cause: Too many records being processed.

Solutions:

  1. Reduce batch size:
settings:
  batch_size: 500  # Smaller batches
  1. Reduce record count
  2. Run tables separately

Import/Export Errors

"Routine already exists"

Cause: A routine with the same unique_id already exists.

Solutions:

  1. Update the existing routine:
gomask import routine.yaml --update
  1. Or change the unique_id in your YAML

"Export failed: Routine not found"

Cause: The specified routine doesn't exist.

Solutions:

  1. List available routines:
gomask routines list
  1. Use correct identifier (ID or unique_id):
gomask export 123            # By numeric ID
gomask export my-routine-id  # By unique_id

Getting Help

Enable Debug Mode

For more detailed error information:

export GOMASK_DEBUG=true
gomask run routine.yaml

Check Execution Logs

gomask executions show <execution-id> --logs

Contact Support


See Also