aws / amazon-redshift-jdbc-driver

Redshift JDBC Driver. It supports JDBC 4.2 specification.
Apache License 2.0
63 stars 31 forks source link

Redshift okta authentication - localhost url get's connection reset in browser #102

Closed alonomri closed 1 year ago

alonomri commented 1 year ago

Driver version

2.1.0.18

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.58814

Client Operating System

OSX 13.3.1

JAVA/JVM version

openjdk 17.0.8 2023-07-18 OpenJDK Runtime Environment Temurin-17.0.8+7 (build 17.0.8+7) OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (build 17.0.8+7, mixed mode)

Table schema

not an issue in Redshift DB

Problem description

when trying to connect to Redshift using okta, sometimes, I can't login, and getting ERR_CONNECTION_RESET error in the browser.

  1. Expected behaviour: To get the "Thank you for using amazon redshift" web page in the localhost redirect url.
  2. Actual behaviour: Getting the chrome error page ERR_CONNECTION_RESET page.
  3. Error message/stack trace: nothing but the error above, the driver returns a timeout error.
  4. Any other details that can be helpful:

JDBC trace logs

2023-11-07 16:24:44,948 [2498785] INFO - #c.i.d.d.DatabaseConnectionEstablisher - Connecting to: jdbc:redshift:iam:// 2023-11-07 16:24:44,949 [2498786] INFO - #c.i.d.d.DatabaseConnectionEstablisher - Auth provider: user-pass 2023-11-07 16:24:44,955 [2498792] INFO - #c.i.d.d.DatabaseCredentialsAuthProvider - Connecting as: omri.alon 2023-11-07 16:24:44,965 [2498802] INFO - #c.i.e.r.RemoteProcessSupport - SSL MODE is REQUIRE 2023-11-07 16:24:44,965 [2498802] INFO - #c.i.e.r.RemoteProcessSupport - Setting ssl to true 2023-11-07 16:24:51,052 [2504889] INFO - #c.i.o.a.i.PopupMenuPreloader - 7288 ms since showing to preload popup menu '' at 'StructureViewPopup(preload-bgt)' in 17 ms 2023-11-07 16:25:01,053 [2514890] INFO - #c.i.e.r.RemoteProcessSupport - Terminating: 127.0.0.1:46437/RemoteDriverImpl5b649d57 2023-11-07 16:25:01,129 [2514966] INFO - #c.i.e.r.RemoteProcessSupport - Process finished with exit code 137 (interrupted by signal 9: SIGKILL) 2023-11-07 16:25:01,129 [2514966] WARN - #c.i.d.d.DatabaseConnectionEstablisher - Error unmarshaling return header; nested exception is: java.io.EOFException 2023-11-07 16:25:01,129 [2514966] INFO - #c.i.d.d.DatabaseConnectionEstablisher - Connecting to (rewritten): jdbc:redshift:iam:// 2023-11-07 16:25:01,130 [2514967] WARN - #c.i.d.d.DatabaseConnectionEstablisher - Connecting to: jdbc:redshift:iam:// 2023-11-07 16:25:01,130 [2514967] WARN - #c.i.d.d.DatabaseConnectionEstablisher - Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused 2023-11-07 16:25:04,805 [2518642] INFO - #c.i.o.a.i.PopupMenuPreloader - 2750 ms since showing to preload popup menu '' at 'StructureViewPopup(preload-bgt)' in 3 ms 2023-11-07 16:25:11,135 [2524972] INFO - #c.i.d.d.s.DbSrcModificationSession$CountedThreadExecutor - DbSrcWriter

Reproduction code

bhvkshah commented 1 year ago

@alonomri thanks for opening the issue. Can you please provide the complete DEBUG level driver logs (level 6)?

alonomri commented 1 year ago

@bhvkshah Hi, not sure how to set this using datagrip.

bhvkshah commented 1 year ago

@alonomri you can set up logging by setting connection options as part of your jdbc url. Instructions can be found here: https://docs.aws.amazon.com/redshift/latest/mgmt/jdbc20-configuring-logging.html

bhvkshah commented 1 year ago

Hi @alonomri were you able to get the driver logs?

alonomri commented 1 year ago

Hi, i upgraded to the latest version and the error disappeared.Thank you!On 21 Nov 2023, at 19:05, Bhavik Shah @.***> wrote: Hi @alonomri were you able to get the driver logs?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bhvkshah commented 1 year ago

Thank you for bringing this up and contributing to the Redshift JDBC driver!