Details
-
Bug
-
Status: Done
-
Medium
-
Resolution: Fixed
-
2.25.0
-
2
-
Yes
-
Yes
-
PMM Core
-
Description
pmm-agent is not working with --socket:
Feb 02 00:05:00 agustin-gallego-node1 pmm-agent[3590]: INFO[2022-02-02T00:05:00.238+00:00] time="2022-02-02T00:05:00Z" level=info msg="Established new database connection to \"pmm_user:5432\"." source="postgres_exporter.go:913" agentID=/agent_id/615928d9-cd34-4eaa-8cdf-13c6cc6d25c2 component=agent-process type=postgres_exporter Feb 02 00:05:00 agustin-gallego-node1 pmm-agent[3590]: INFO[2022-02-02T00:05:00.240+00:00] time="2022-02-02T00:05:00Z" level=error msg="Error opening connection to database (postgres://postgres:PASSWORD_REMOVED@pmm_user?connect_timeout=1&host=%!F(MISSING)var%!F(MISSING)run%!F(MISSING)postgresql%!F(MISSING)&sslmode=disable): dial tcp: lookup pmm_user on 10.124.33.1:53: no such host" source="postgres_exporter.go:1605" agentID=/agent_id/615928d9-cd34-4eaa-8cdf-13c6cc6d25c2 component=agent-process type=postgres_exporter
It interesting to see the connection string in particular:
postgres://postgres:PASSWORD_REMOVED@pmm_user?connect_timeout=1&host=%!F(MISSING)var%!F(MISSING)run%!F(MISSING)postgresql%!F(MISSING)&sslmode=disable
To reproduce try to add an exporter with a command like:
pmm-admin add postgresql --username='postgres' --password='secret' --socket=/var/run/postgresql/ postgres
PostgreSQL version 13.2 used, but I don't think that has much to do. I tested with Nickolay's anydbver:
https://github.com/ihanick/anydbver
With the command:
./anydbver deploy pmm node1 pg:13.2 pmm-client pmm-server:default
Attachments
Issue Links
- relates to
-
PMM-5243 pmm-admin socket option (--socket) to specify UNIX socket path for connecting to PostgreSQL instances
-
- Done
-