rstudio / helm

Helm Resources for RStudio Products
MIT License
36 stars 28 forks source link

[PM] usagedataurl does not work #482

Closed calebAtIspot closed 8 months ago

calebAtIspot commented 8 months ago

I created a AWS RDS database for posit package manager, but I got an error when posit PM in Kubernetes tried to connect to the usage data database.

2024/03/21 22:48:11 Error running services: Error: Unable to initialize a connection to the metrics database: Unable to connect to DB: failed to connect to `host=foo.prod.ispot.tv user=foo database=rstudiopmmetrics`: server error (FATAL: no pg_hba.conf entry for host "10.224.112.11", user "foo", database "rstudiopmmetrics", no encryption (SQLSTATE 28000))

I’ve confirmed that the postgres URI I supplied is correct. I can use it with psql to access the database

I contacted support (ticket #102884, logs and configuration attached) but their response didn't make sense. I can log in to the database from a kubernetes pod with the same URI and password so I know it's not a network issue. Also I can't edit the pg_hba.conf entry on the database server because RDS is a a fully AWS managed database server. I don't have ssh access to the RDS server.

calebAtIspot commented 8 months ago

Solution: I disabled usage data to work around the issue:

  config:
    Server:
      UsageDataEnabled: false
colearendt commented 8 months ago

Howdy @calebAtIspot ! Thanks so much for submitting this issue. Sorry for the trouble you're seeing!

I have seen this issue crop up a few times. I believe this error is coming because of requirements around TLS! I believe if you add a query parameter like ?sslmode=require, that should fix your issue 😄

The hint is this , no encryption section of the error message. I believe psql and other client libraries will occasionally upgrade more directly / gracefully than our client library and thus do not hit this issue.

I hope that helps! I will send this info internally to see if we can't improve our triage process a bit! (or craft a better error message in the product!).

Quite surprising that this is not hitting your main database connection though, too!