I can connect to my database just fine by entering psql -U <db_user> -W -h localhost -p <db_port> -d <db_name>
. However, when I set up that same connection in a Cubejs backend, queries like http://localhost:4000/cubejs-api/v1/load?query=...
return {"error": "Error: password authentication failed for user \"<db_user>\""}
.
- The database is actually connected via SSH tunnel. I've connected a truly local db to Cubejs before, so I suspect this might be causing trouble.
- I attempt the connection like so
new PostgresDriver({
database: "<db_name>",
host: "localhost",
user: "<db_user>",
password: "<db_password>"
})
2020-11-18 23:42:25 UTC::@:[6677]:LOG: checkpoint starting: time
2020-11-18 23:42:25 UTC::@:[6677]:LOG: checkpoint complete: wrote 1 buffers (0.0%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.101 s, sync=0.001 s, total=0.115 s; sync files=1, longest=0.001 s, average=0.001 s; distance=65536 kB, estimate=65623 kB