PostgreSQL - Metric request error

Hi, I’m trying to connect Data Sources / PostgreSQL, but I got the error Metric request error. This is the details:

Console log:
tti-polyfill.js:4 POST http://grafana.staged-by-discourse.com/api/tsdb/query 500 (Internal Server Error)

datasource.ts:180

  1. {status: 500, statusText: “Internal Server Error”, data: {…}}

  2. data: {message: “Metric request error”}

  3. status: 500

  4. statusText: “Internal Server Error”

  5. proto: Object

PostgreSQL Connection:

Host: http://localhost:5432/
Database: test
User: hungnguyen

PostgreQSL DB:

psql -h localhost -p 5432 -U hungnguyen test

Please help

I have an idea, as I had a similar experience, out of Ubuntu 12.5 (psql 12 as datasource), and
after I made a postgres user with limited access rights (SELECT only), and it works fine from the command line.

But through the browser, I got the Metric Request error just like you. Turns out that passwords passed through the web interface can’t have whitespace in them, and looking at the log file grafana.log, it was littered with my attempts and a bunch of extra error="invalid option: were in there…thereby treating the first part of the password as the value, and the latter part of the password as its own option.

So, did you have a space perhaps in your password too?