API works in API node but not in Deployer

Oscar
Oscar Registered Posts: 19 ✭✭✭✭
edited July 16 in Using Dataiku

Hello,

I built a simple SQL API which returns a data from a postgresql db. It works in API node. But once I deployed it, it shows following error:

FATAL: password authentication failed for user "dataiku"

"errorType": "com.dataiku.common.server.APIError$APIErrorException",
  "message": "FATAL: password authentication failed for user \"dataiku\"",
  "detailedMessage": "FATAL: password authentication failed for user \"dataiku\""

Can you help me with this please? I checked the server.json, the postgresql db is correctly remaped.

Answers

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker

    Hi,

    It is quite likely that your PostgreSQL only accepts connections from the Design node host, not from the API node host. You need to check that with your PostgreSQL admin (in the pg_hba.conf file)

  • Oscar
    Oscar Registered Posts: 19 ✭✭✭✭
    we are on Amazon RDS
    there is no postgresql admin
  • Oscar
    Oscar Registered Posts: 19 ✭✭✭✭

    Can you provide me a documentation for this configuration ASAP?

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker

    There is no pg_hba on RDS indeed. We would advise you to install the psql client on the machine where the API node is and to try to connect to your RDS from there, making sure to enter exactly the same host, login, password and database as the one in config/server.json

  • Oscar
    Oscar Registered Posts: 19 ✭✭✭✭

    Is there any other solution to this one?

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker

    Hi,

    Not really. The error that you get is directly the error reported by the PostgreSQL driver. This is why our first recommendation is to double-check your settings, and then to use another PostgreSQL client to confirm the issue.

  • Oscar
    Oscar Registered Posts: 19 ✭✭✭✭

    the connection to RDS work on the machine because the Design and API node are on the same one. But however, once deployed, it cannot

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker

    It likely means that there is an error in the config/server.json file in the API node, which is where the connection details are configured. Please remember that you can't just copy/paste the data from the connections.json file of the design node, because the password is encrypted on the design node. You need to actually write the password in the API node file.

  • Oscar
    Oscar Registered Posts: 19 ✭✭✭✭

    We can only expose our AES encrypted password to the server.json. Is there anyway to use encrypted password? Or it's mandatory to put plain pw?

Setup Info
    Tags
      Help me…