postgresqlsupabasegraphiql

Hostname resolving error in Stepzen Graphiql explorer when connecting with Supabase Postgresql database


I have set up Stepzen as described in the Getting Started Docs. I get the following error when running stepzen start:

{
  "data": {
    "getProfilesList": null
  },
  "errors": [
    {
      "message": "database error: can't prepare the statement for execution failed to connect to `host=postgres user=root database=`: hostname resolving error (lookup postgres on 10.97.0.10:53: no such host)",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "getProfilesList"
      ]
    }
  ]
}

The message shows wrong hostname, user and empty database, although my config file has the correct credentials:

configurationset:
  - configuration:
      name: postgresql_config
      uri: postgresql://postgres:[My Password]@[My Supabase DB Host]/postgres

I have also tried to connect to the DB directly from a GUI client and the connection was successful. Why this issue is coming up when trying to connect from Stepzen Graphiql explorer running on localhost?


Solution

  • Postgres requires the password to be URL Encoded when using some characters that have a special meaning.

    You can learn more about percent-encoding to handle special characters in Postgres passwords here: How to handle special characters in the password of a Postgresql URL connection string?