Redshift connection issue: FATAL: password authentication failed for user

AFHood

We are connecting remotely to AWS Redshift instance.

We can successfully connect with Aginity workbench.

However, we cannot connect with a JDBC based tool (DBVisualizer).

We are using the Postgresql driver 8.4-703 (from Redshift docs).

SSL is required.

We use a non-standard port (1433).

Message returned is

FATAL: password authentication failed for user xxxx

JDBC string is

jdbc:postgresql://xxxxxxx.us-west-2.redshift.amazonaws.com:1433/dev?tcpKeepAlive=true

Debug is:

org.postgresql.util.PSQLException: FATAL: password authentication failed for user "xxxx"
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.onseven.dbvis.g.B.D.?(Z:1413)
    at com.onseven.dbvis.g.B.F$A.call(Z:1474)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
SQLException: SQLState(28000)

UPDATED: I added SSL=true to the JDBC string..

New string:

jdbc:postgresql://xxxxxxx.us-west-2.redshift.amazonaws.com:1433/dev?tcpKeepAlive=true&ssl=true

New debug is:

org.postgresql.util.PSQLException: The connection attempt failed.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:150)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.onseven.dbvis.g.B.D.?(Z:1413)
    at com.onseven.dbvis.g.B.F$A.call(Z:1474)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
SQLException: SQLState(08001)

Obviously we've quadruple checked the password.

Masashi Miyazaki

To enable SSL option for JDBC, you have to download a redshift certificate and add it to your Java system truststore on your machine.

Here is the step:

  • Download Amazon Redshift certificate file from here.

  • Register Redshift certificate to your Java system truststore.

    • Run ${JAVA_HOME}/bin/keytool -keystore ${JAVA_HOME}/lib/security/cacerts -import -alias <alias> -file <certificate_filename>
    • Run ${JAVA_HOME}/bin/keytool -keystore <keystore_name> -alias <alias> -import -file <certificate_filename> to create your own truststore, If you don't have a permission to access cacerts.
    • The default password is changeit
  • Specify the keystore and password in java VM properties
    • Open [DbVisualizer] -> [Preferences] -> [General] Tab -> [General]
    • Edit "Java VM Properties" section
      • -Djavax.net.ssl.trustStore=key_store_name_or_path
      • Djavax.net.ssl.trustStorePassword=password
    • Apply and restart

Some paths in the above commands might need to be changed for your environment. See Amazon Redshift Management Guide for details.

As for the authentication error, there might be unsupported password symbols in the Application level. It's worth a try to change a password to make it simple like containing only "_" for symbols.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

FATAL: password authentication failed for user "postgres"

From Dev

PostgreSQL SSPI authentication - FATAL: 2801: password authentication failed for user "xxx"

From Java

FATAL: password authentication failed for user "postgres" (postgresql 11 with pgAdmin 4)

From Dev

psql: FATAL: password authentication failed for user windows 8

From Dev

PG::ConnectionBad: FATAL: password authentication failed for user "alphauser"

From Dev

FATAL: password authentication failed for user "postgres" Ubuntu v20.10

From Dev

remote: Invalid username or password, fatal: Authentication failed for

From Dev

Rails 5 in prod: PG::ConnectionBad: FATAL: password authentication failed for user "postgres" with Docker

From Dev

psql: FATAL: password authentication failed for user error while trying to access psql

From Java

psql: FATAL: Peer authentication failed for user "dev"

From Dev

psql: FATAL: PAM authentication failed for user

From Dev

FATAL: Peer authentication failed for user "rails"

From Dev

FATAL: Peer authentication failed for user "shop"

From Java

Postgresql: password authentication failed for user "postgres"

From Dev

PSQL - password authentication failed for user "postgres"

From Dev

error: password authentication failed for user "myuser"

From Dev

jitterbit-password authentication failed for user "postgres"

From Dev

Password authentication failed for a user not in my role list

From Dev

How to solve " django.db.utils.OperationalError: FATAL: password authentication failed for user "Oeloun-pc" " in Pycharm Windows?

From Java

git remote: Invalid username or password. fatal: Authentication failed - ubuntu

From Dev

remote: Invalid username or password. fatal: Authentication failed for

From Dev

Fatal! Authentication for user postgres failed, multiples OS, nothing work

From Dev

psql: FATAL: Ident authentication failed for user "xxx" with method trust

From Dev

PG::ConnectionBad: FATAL: Ident authentication failed for user "rails_dev"

From Dev

28P01--Password authentication failed for user in DataGrip

From Dev

Java Springboot application returning password authentication failed for user "postgres"

From Dev

Connection failed to SQL Server Express using user with SQL Server authentication

From Dev

Postgres password authentication issue

From Dev

Postgres password authentication issue

Related Related

  1. 1

    FATAL: password authentication failed for user "postgres"

  2. 2

    PostgreSQL SSPI authentication - FATAL: 2801: password authentication failed for user "xxx"

  3. 3

    FATAL: password authentication failed for user "postgres" (postgresql 11 with pgAdmin 4)

  4. 4

    psql: FATAL: password authentication failed for user windows 8

  5. 5

    PG::ConnectionBad: FATAL: password authentication failed for user "alphauser"

  6. 6

    FATAL: password authentication failed for user "postgres" Ubuntu v20.10

  7. 7

    remote: Invalid username or password, fatal: Authentication failed for

  8. 8

    Rails 5 in prod: PG::ConnectionBad: FATAL: password authentication failed for user "postgres" with Docker

  9. 9

    psql: FATAL: password authentication failed for user error while trying to access psql

  10. 10

    psql: FATAL: Peer authentication failed for user "dev"

  11. 11

    psql: FATAL: PAM authentication failed for user

  12. 12

    FATAL: Peer authentication failed for user "rails"

  13. 13

    FATAL: Peer authentication failed for user "shop"

  14. 14

    Postgresql: password authentication failed for user "postgres"

  15. 15

    PSQL - password authentication failed for user "postgres"

  16. 16

    error: password authentication failed for user "myuser"

  17. 17

    jitterbit-password authentication failed for user "postgres"

  18. 18

    Password authentication failed for a user not in my role list

  19. 19

    How to solve " django.db.utils.OperationalError: FATAL: password authentication failed for user "Oeloun-pc" " in Pycharm Windows?

  20. 20

    git remote: Invalid username or password. fatal: Authentication failed - ubuntu

  21. 21

    remote: Invalid username or password. fatal: Authentication failed for

  22. 22

    Fatal! Authentication for user postgres failed, multiples OS, nothing work

  23. 23

    psql: FATAL: Ident authentication failed for user "xxx" with method trust

  24. 24

    PG::ConnectionBad: FATAL: Ident authentication failed for user "rails_dev"

  25. 25

    28P01--Password authentication failed for user in DataGrip

  26. 26

    Java Springboot application returning password authentication failed for user "postgres"

  27. 27

    Connection failed to SQL Server Express using user with SQL Server authentication

  28. 28

    Postgres password authentication issue

  29. 29

    Postgres password authentication issue

HotTag

Archive