# Dial tcp 127.0.0.1:7777: connect: connection refused

**URL:** <https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752>\
**Category:** Percona Monitoring and Management (PMM)\
**Created:** [March 20, 2023, 8:13am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752 "2023-03-20T08:13:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jyoti\_Rajai](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jyoti_rajai/32/4482_2.png) [@Jyoti\_Rajai](https://forums.percona.com/u/Jyoti_Rajai)\
**Post date:** [March 20, 2023, 8:13am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/1 "2023-03-20T08:13:43Z")

</div>

Hello Team,

I am facing below error while adding PostgreSQL service to PMM.

FYI: PMM SERVER & PMM CLIENT & PostgreSQL all are on the same machine. [Purpose to do this is that while adding PostgreSQL service remotely, the pg\_stat\_monitor from query analytics is not used.]

root@DESKTOP-L0E2A77:/etc/mysql/mysql.conf.d# pmm-admin add postgresql --username=pmm --server-url=[https://admin:admin@172.21.226.127:443](https://admin:admin@172.21.226.127:443) --query-source=pgstatmonitor --server-insecure-tls --debug --password=PASSWORD  
Output

```auto
DEBUG 2023-03-20 08:09:46.554810841Z: POST /local/Status HTTP/1.1
Host: 127.0.0.1:7777
User-Agent: Go-http-client/1.1
Content-Length: 3
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip

{}

DEBUG 2023-03-20 08:09:46.555006834Z: Result: <nil>
DEBUG 2023-03-20 08:09:46.555035567Z: Error: &url.Error{Op:"Post", URL:"http://127.0.0.1:7777/local/Status", Err:(*net.OpError)(0xc00048c780)}
Post "http://127.0.0.1:7777/local/Status": dial tcp 127.0.0.1:7777: connect: connection refused
root@DESKTOP-L0E2A77:/etc/mysql/mysql.conf.d#

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 20, 2023, 2:57pm UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/2 "2023-03-20T14:57:27Z")

</div>

> [@Jyoti\_Rajai](#):
>
> –server-url=[https://admin:admin@172.21.226.127:443](https://admin:admin@172.21.226.127:443)

If PMM is on the same machine (which is not recommended), then the server-url should be 127.0.0.1

> [@Jyoti\_Rajai](#):
>
> `http://127.0.0.1:7777/local/Status`

What’s running on 7777? Or rather, what _should_ be? Whatever should be here is not running and thus the PMM agent cannot connect.

---

<div class="post-metadata">

**Author:** ![Jyoti\_Rajai](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jyoti_rajai/32/4482_2.png) [@Jyoti\_Rajai](https://forums.percona.com/u/Jyoti_Rajai)\
**Post date:** [March 21, 2023, 2:44am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/3 "2023-03-21T02:44:10Z")

</div>

Thank you @matthewb for response !

There is nothing running on port 7777

```auto
root@DESKTOP-L0E2A77:~# lsof -i -P -n | grep LISTEN
postgres 1301 postgres 5u IPv4 18121 0t0 TCP *:5432 (LISTEN)
postgres 1301 postgres 6u IPv6 18122 0t0 TCP *:5432 (LISTEN)
docker-pr 2489 root 4u IPv4 24782 0t0 TCP *:443 (LISTEN)
docker-pr 2496 root 4u IPv6 23802 0t0 TCP *:443 (LISTEN)
root@DESKTOP-L0E2A77:~# lsof -i -P -n | grep 7777
root@DESKTOP-L0E2A77:~# pmm-admin add mysql --username=pmm --server-url=https://admin:admin@127.0.0.1:443 --debug --password=Mutual#ubuntu
DEBUG 2023-03-21 02:43:04.983117531Z: POST /local/Status HTTP/1.1
Host: 127.0.0.1:7777
User-Agent: Go-http-client/1.1
Content-Length: 3
Accept: application/json
Content-Type: application/json
Accept-Encoding: gzip

{}

DEBUG 2023-03-21 02:43:04.983269148Z: Result: <nil>
DEBUG 2023-03-21 02:43:04.983295195Z: Error: &url.Error{Op:"Post", URL:"http://127.0.0.1:7777/local/Status", Err:(*net.OpError)(0xc00058f310)}
Post "http://127.0.0.1:7777/local/Status": dial tcp 127.0.0.1:7777: connect: connection refused
root@DESKTOP-L0E2A77:~#

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 21, 2023, 2:48am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/4 "2023-03-21T02:48:32Z")

</div>

> [@Jyoti\_Rajai](#):
>
> There is nothing running on port 7777

> [@matthewb](#):
>
> Or rather, what _should_ be?

Exactly. There _should_ be something running on 7777 which is why you are getting that error. But whatever _should_ be running there, is not running.

---

<div class="post-metadata">

**Author:** ![Jyoti\_Rajai](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jyoti_rajai/32/4482_2.png) [@Jyoti\_Rajai](https://forums.percona.com/u/Jyoti_Rajai)\
**Post date:** [March 21, 2023, 3:03am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/5 "2023-03-21T03:03:33Z")

</div>

Strange thing how would I solve it then 🤔

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 21, 2023, 3:38am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/6 "2023-03-21T03:38:22Z")

</div>

> **[Network - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/server/network.html)**
>
> Documentation

Looks like the pmm-agent runs on 7777. Is the agent running? (probably not since there’s nothing on 7777) Did you start the agent and register this client with the server?

> **[Client - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/index.html#register)**
>
> Documentation

---

<div class="post-metadata">

**Author:** ![Jyoti\_Rajai](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jyoti_rajai/32/4482_2.png) [@Jyoti\_Rajai](https://forums.percona.com/u/Jyoti_Rajai)\
**Post date:** [March 21, 2023, 3:45am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/7 "2023-03-21T03:45:06Z")

</div>

```auto
root@DESKTOP-L0E2A77:/var/lib/docker# docker exec pmm-client \
> pmm-admin status
Error response from daemon: No such container: pmm-client
root@DESKTOP-L0E2A77:/var/lib/docker# pmm-admin --version
ProjectName: pmm-admin
Version: 2.35.0
PMMVersion: 2.35.0
Timestamp: 2023-02-22 07:41:41 (UTC)
FullCommit: 5e80fd1f3fdddbae98002e819e9396043b7a9740
root@DESKTOP-L0E2A77:/var/lib/docker#

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 21, 2023, 4:22am UTC](https://forums.percona.com/t/dial-tcp-127-0-0-1-connect-connection-refused/20752/8 "2023-03-21T04:22:01Z")

</div>

Please read the documentation for setting up the PMM Client. This is a critical step that you seemed to have missed. This is not done via docker but installed onto the operating system via your OS’s package manager.
