aws / amazon-redshift-python-driver

Redshift Python Connector. It supports Python Database API Specification v2.0.
Apache License 2.0
202 stars 72 forks source link

Connection with IAM authentication leads to "Assuming cluster is using NLB/custom domain name" Error #181

Closed Kareeno closed 9 months ago

Kareeno commented 11 months ago

Driver version

^2.0.913

Redshift version

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.54052

Client Operating System

AWS Lambda x86_64 Architecture

Python version

Python 3.10

Table schema

Problem description

  1. Expected behaviour: Connection and querying from Redshift Cluster
  2. Actual behaviour: Querying Succeeds but an Error is logged.
  3. Error message/stack trace: [ERROR] 2023-08-10T07:58:00.747Z adb51ef0-a89c-49c0-8338-ec38fb684189 User provided cluster_identifier. Assuming cluster is using NLB/custom domain name. Using cluster_identifier
  4. Any other details that can be helpful: The error is related to custom domain name, however a custom domain name has NOT been configured for the Redshift cluster.

Python Driver trace logs

Reproduction code

conn = redshift_connector.connect(
            cluster_identifier=REDSHIFT_CLUSTER_IDENTIFIER,
            database=REDSHIFT_DATABASE,
            db_user=REDSHIFT_DB_USER,
            iam=True,
            db_groups=[REDSHIFT_DB_GROUP],
            auto_create=True,
        )
cursor = conn.cursor()
res = cursor.execute('SELECT 1;')
Brooke-white commented 11 months ago

@Kareeno, are you seeing issue connecting? looks like this is incorrectly being logged with the level error and should be using debug instead.

Kareeno commented 10 months ago

Hi @Brooke-white, indeed there is no issue actually connecting, only the logging of the error.

Brooke-white commented 10 months ago

Thanks, @Kareeno , understood. Apologies for the inconvenience. We will address this is our next release.

Kareeno commented 10 months ago

Thanks!!

Brooke-white commented 9 months ago

Fixed in 2.0.914