Unable to connect to redshift from dbt: Database Error ('communication error', OSError('Int or String expected'))

I have a database in aws redshift. I can read the data from my ec2 using credentials (username/ pass etc.) But when I am trying to connect (from same ec2) to redshift using dbt, the dbt debug command shows this error

1 check failed: 08:08:12 dbt was unable to connect to the specified database. The database returned the following error:

Database Error (‘communication error’, OSError(‘Int or String expected’))

Check your database credentials and try again. For more information, visit: Connection profiles | dbt Developer Hub

I double/ triple checked the credentials, they are correct.

also profile name is correct. my profiles.yml looks like :

  target: dev
      dbname: dev
      host: aws_host_name
      password: xxx
      port: 1111
      schema: staging
      threads: 1
      type: redshift
      user: awsuser
      region: eu-west-x
      cluster_id: xxxx

Can someone help me to fix this issue and connect to my db?

if you happen to have version 1.5.5 of dbt-redshift at that moment that could be why. You could either do the following:

  1. downgrade to version 1.4
  2. update dbt-redshift to the latest possible (1.5.8)

Here’s the Github issue created for this