Skip to content

AWS SCT CLI Connection to Redshift fails while UI connection succeeds with identical parameters

0

I'm experiencing an issue with AWS Schema Conversion Tool (SCT) where the connection to Redshift fails when using CLI mode, but works perfectly fine with the same parameters in the UI interface.

Environment Details: Source Database: Teradata Target Database: Amazon Redshift AWS SCT Version: 1.0 Build: 676 Operating System: Windows

Scenario: I'm trying to automate database schema conversion using AWS SCT CLI with the following commands:

AddTarget -name: '[REDACTED]' -vendor: 'REDSHIFT' -host: '[REDACTED]' -port: '5439' -database: 'dev' -user: 'admin' -password: '[REDACTED]' -profile: 'teradataprofile' /

AddServerMapping -sourceTreePath: 'Servers.[REDACTED]' -targetTreePath: 'Servers.[REDACTED]"' /

ConnectTarget -name: '[REDACTED]' -port: '5439' -database: 'dev' -user: 'admin' -password: '[REDACTED]' -profile: 'teradataprofile' /

Error Message: GENERAL ERROR Connection wasn't established. Check connection properties. GENERAL ERROR com.amazon.sct.dbloader.exceptions.DbLoaderHandledException: Connection wasn't established. Check connection properties. GENERAL ERROR AddTarget failed with exception. GENERAL ERROR Connection wasn't established. Check connection properties. GENERAL ERROR com.amazon.sct.dbloader.exceptions.DbLoaderHandledException: Connection wasn't established. Check connection properties. GENERAL ERROR ConnectTarget failed with exception.

Important Notes: The exact same connection parameters work perfectly in the AWS SCT UI The source Teradata connection works fine in both UI and CLI The schema conversion process completes successfully despite the connection failure Security groups and network access are properly configured (confirmed by successful UI connection)

What I've tried: Verified all connection parameters match between UI and CLI Confirmed network connectivity and security group settings Checked that the profile configuration is correct Verified credentials are valid (working in UI)

Questions: Why would the connection fail in CLI mode but succeed in UI mode with identical parameters? Are there additional connection parameters required specifically for CLI mode? Is there a way to enable more detailed connection logging to identify the specific cause of the failure? Are there known issues with special characters in passwords when using CLI mode?

Any assistance in resolving this connection issue would be greatly appreciated. Thank you!

2 Answers
0

The issue you're experiencing with AWS SCT CLI failing to connect to Redshift while the UI connection succeeds with identical parameters could be due to several factors:

  1. Authentication Method Differences: The CLI might be handling authentication differently than the UI. When connecting to Redshift, AWS SCT uses the password to connect only when you choose to connect to your database in a project. The CLI might require additional parameters or a different authentication approach.

  2. Profile Configuration: The 'teradataprofile' you're using might not be properly recognized in CLI mode. Ensure that the AWS profile is correctly set up and accessible to the CLI process.

  3. Connection Timeout: CLI operations might have different timeout settings compared to the UI. The "Connection wasn't established" error could indicate a timeout issue.

  4. Special Characters in Credentials: As you suspected, special characters in passwords can sometimes cause issues in CLI mode due to how they're escaped or interpreted.

  5. ODBC Driver Version Conflicts: There might be a version conflict between ODBC drivers. Some versions of ODBC drivers (1.x vs 2.x) don't allow connections to the same server/profile simultaneously.

Recommendations:

  1. Try using a simpler password temporarily to rule out special character issues.

  2. Check if there are any AWS credentials or profile conflicts. Ensure the profile is correctly configured and accessible.

  3. If you're using IAM authentication, verify that all necessary permissions are in place for the CLI operation.

  4. Enable more detailed logging by adding debug flags to your CLI commands if available.

  5. Check if there are any VPC endpoints that might be required for the connection that the UI is using automatically but the CLI isn't.

  6. Verify that the CLI is using the same ODBC driver version as the UI.

  7. Try specifying the connection parameters directly in the command rather than relying on the profile to see if that makes a difference.
    Sources
    Unable to Connect to Redshift ODBC Database - Error HY000 | AWS re:Post
    Glue Connection (Version 2) for redshift | AWS re:Post
    Connecting Amazon Redshift with the AWS Schema Conversion Tool - AWS Schema Conversion Tool

answered a year ago

AWS
EXPERT

reviewed 10 months ago

0

I’ve run into this exact issue before when using AWS SCT CLI with Redshift — the most common culprit turned out to be how the CLI handles special characters in passwords or parameters compared to the UI. Even if your password works in the UI, certain characters (!, &, $, ^, etc.) may need to be escaped or quoted differently when passed through the command line.

A couple of things you can try:

Wrap your password and other string parameters in double quotes and escape any special characters (PowerShell in particular can interpret characters differently than the SCT UI).

Enable verbose logging by adding -loglevel: debug or setting the AWS_SCT_LOG_LEVEL=DEBUG environment variable before running the CLI — this gives much more detailed output and may reveal whether it’s failing during authentication or connection initialization.

Compare the sct-cli.log file with the UI logs in %USERPROFILE%\aws-schema-conversion-tool\logs. Sometimes the CLI log will show a slightly different JDBC URL or driver behavior that can help pinpoint the problem.

If none of that resolves it, I’d suggest checking the exact SCT CLI version/build you’re using — a few builds had known issues with Redshift CLI connections that were later fixed. Upgrading to the latest version often clears this up.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.