# pmm-agent Failed to connect to pmm

**URL:** <https://forums.percona.com/t/pmm-agent-failed-to-connect-to-pmm/7839>\
**Category:** PMM 2.x\
**Tags:** pmm\
**Created:** [July 31, 2020, 2:39am UTC](https://forums.percona.com/t/pmm-agent-failed-to-connect-to-pmm/7839 "2020-07-31T02:39:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![decibel83](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@decibel83](https://forums.percona.com/u/decibel83)\
**Post date:** [July 31, 2020, 2:39am UTC](https://forums.percona.com/t/pmm-agent-failed-to-connect-to-pmm/7839/1 "2020-07-31T02:39:32Z")

</div>

I installed Percona PMM with Docker and it’s up and running on the PMM server:

```auto
root@cop:~# docker psCONTAINER ID&nbsp; &nbsp; &nbsp; &nbsp; IMAGE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COMMAND&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CREATED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;STATUS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PORTS&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NAMES
6459173799da&nbsp; &nbsp; &nbsp; &nbsp; percona/pmm-server:2&nbsp; &nbsp;"/opt/entrypoint.sh"&nbsp; &nbsp;About an hour ago&nbsp; &nbsp;Up About an hour (healthy)&nbsp; &nbsp;0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:8043-&gt;443/tcp&nbsp; &nbsp;pmm-server

```

I configured Nginx as reverse proxy with SSL and a trusted SSL certificate and I can correctly access to Grafana if I access to [https://pmm.my.domain.I](https://pmm.my.domain.I) installed PMM Client on a MySQL machine, I configured it to connect to the PMM Server but I receive some connection timeouts and I cannot understand why.  
My PMM Client version is:

```auto
root@mysql3-staging:~# pmm-admin --version
ProjectName: pmm-admin
Version: 2.9.0
PMMVersion: 2.9.0
Timestamp: 2020-07-14 10:11:43 (UTC)
FullCommit: cae4d06914b68bb625e9ff7dcd2d7baf3cac9227

```

I configured PMM Client to connect to [https://pmm.my.domain:443](https://pmm.my.domain:443):

```auto
root@mysql3-staging:~# pmm-admin config --force --server-url=https://admin:password@pmm.my.domain:443
Checking local pmm-agent status...
pmm-agent is running.
Registering pmm-agent on PMM Server...
Registered.
Configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml updated.
Reloading pmm-agent configuration...
Configuration reloaded.
Checking local pmm-agent status...
pmm-agent is running.

```

PMM Client is running:

```auto
root@mysql3-staging:~# ps ax|grep pmm
22986 ? Ssl 0:00 /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml

```

But I cannot add a new MySQL source:

```auto
root@mysql3-staging:~# pmm-admin add mysql --query-source=slowlog --username=pmm --password=password
Failed to get PMM Server parameters from local pmm-agent: pmm-agent is running, but not set up.
Please run `pmm-admin config` with --server-url flag.

```

I then checked that PMM Client cannot connect to PMM Server:

```auto
Jul 31 10:02:24 mysql3-staging systemd[1]: Started pmm-agent.
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.078+02:00] Loading configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml. #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Using /usr/local/percona/pmm2/exporters/node_exporter #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Using /usr/local/percona/pmm2/exporters/mysqld_exporter #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Using /usr/local/percona/pmm2/exporters/mongodb_exporter #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Using /usr/local/percona/pmm2/exporters/postgres_exporter #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Using /usr/local/percona/pmm2/exporters/proxysql_exporter #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Using /usr/local/percona/pmm2/exporters/rds_exporter #033[36mcomponent#033[0m=main
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.079+02:00] Starting local API server on http://127.0.0.1:7777/ ... #033[36mcomponent#033[0m=local-server/JSON
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.085+02:00] Starting... #033[36mcomponent#033[0m=client
Jul 31 10:02:24 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:24.085+02:00] Connecting to https://admin:***@pmm.my.domain:443/ ... #033[36mcomponent#033[0m=client
Jul 31 10:02:25 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:25.087+02:00] Started. #033[36mcomponent#033[0m=local-server/JSON
Jul 31 10:02:29 mysql3-staging pmm-agent[24447]: #033[31mERRO#033[0m[2020-07-31T10:02:29.085+02:00] Failed to connect to pmm.my.domain:443: timeout. #033[31mcomponent#033[0m=client
Jul 31 10:02:29 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:29.884+02:00] Connecting to https://admin:***@pmm.my.domain:443/ ... #033[36mcomponent#033[0m=client
Jul 31 10:02:34 mysql3-staging pmm-agent[24447]: #033[31mERRO#033[0m[2020-07-31T10:02:34.884+02:00] Failed to connect to pmm.my.domain:443: timeout. #033[31mcomponent#033[0m=client
Jul 31 10:02:36 mysql3-staging pmm-agent[24447]: #033[36mINFO#033[0m[2020-07-31T10:02:36.361+02:00] Connecting to https://admin:***@pmm.my.domain:443/ ... #033[36mcomponent#033[0m=client

```

The MySQL server (on which PMM Client is installed) can correctly reach [https://pmm.my.domain](https://pmm.my.domain) (checked with telnet, curl and elinks).  
Could you help me please?  
Thanks!

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [August 17, 2020, 12:29pm UTC](https://forums.percona.com/t/pmm-agent-failed-to-connect-to-pmm/7839/2 "2020-08-17T12:29:20Z")

</div>

Terribly sorry we missed this and no one has responded yet…I looked over your steps and they seem to all be correct.&nbsp; Can you run ‘pmm-admin status’ and post the output.&nbsp; Just curious if all connections to PMM Server are impacted or just for the registration action.&nbsp; Also, instead of FQDN, can you try adding MySQL monitoring by IP address to see if that works (might isolate where in the code we’d need to look if it’s a bug).&nbsp; And just to be complete…I see you’re running client 2.9.0 is that the container version as well “docker exec -it pmm-server curl -u admin:admin [http://localhost/v1/version](http://localhost/v1/version)”.&nbsp;&nbsp;
