Bizarre Redshift Adapter Connection Issue

The problem I’m having

Using dbt-redshift 1.5, in a virtual environment running Python 3.11.4, on a newly setup Windows 10 machine, I’m repeatedly getting a very unhelpful Database Error when attempting to connect to Redshift. It reads, regardless of the profile tweaks I make or the dbt CLI command I try,

>Database Error ('communication error', OSError('Int or String Expected'))

The maddening thing is that I have no connection issues to this database through my SQL Client or through directly using the redshift-connector Python package that dbt-redshift started using in v 1.5.

The context of why I’m trying to do this

Setting up a new machine using the exact same repositories that worked on my old machine, which was running dbt-redshift 1.3.

What I’ve already tried

Everything I’ve tried has used the same core host, password, username, etc. One thing I’ve noted different from the dbt example docs is that my database endpoint is but I don’t know if that matters or not.

I’ve tried ‘dbt debug’ with all manner of different versions, adding my region to the profiles file, removing region from the profiles file, trying each one of the options for sslmode in the profiles file. Always the same result.

I’ve tried dbt-redshift 1.4 (works), multiple versions of dbt-redshift 1.5 (don’t work), the pre-release versions of 1.6 (don’t work). However, I have existing AWS CodeBuild projects that build this repository and that project does work with dbt-redshift 1.5 on a Linux (not Windows) image.

I’ve tried changing the “type” value in my profile from redshift to postgres. Connection tests work when I do that but I need the redshift engine to be able to make the other redshift-specific features of my project work, but it seems like an interesting datapoint.

The basic example from the redshift_connector documentation found here, running on my local Windows machine, which works.

I’ve connected to this database with dbeaver, a SQL client, as well.

I can make any of these connections concurrent with dbt failing to connect when called on the command line.

I’ve checked stl_connection_logs on the database itself and it doesn’t record any attempted authentication (neither failed nor successful) when these dbt failures occur. So it seems like whatever is happening is stopping up dbt before it gets to the database, even though the error message suggests otherwise.

Anybody have any ideas? I’m at the end of my rope.

I have got the exact same issue. Let me know if you found any solution

I know you got this response on your post (and thanks for that!) so I’m just putting this link on my post as well in case anyone comes along looking for the same issue.

There’s a quick fix of regressing the redshift-connector package to redshift_connector==2.0.911 as 2.0.912 is causing the break. There may be a fix to this incorporated into the adapter soon. All these details and more can be found on dbt’s Github at this link