# Error while dialing dial unix /var/run/elastic-agent.sock

**URL:** <https://discuss.elastic.co/t/error-while-dialing-dial-unix-var-run-elastic-agent-sock/342249>\
**Category:** Elastic Agent\
**Created:** [September 4, 2023, 10:56am UTC](https://discuss.elastic.co/t/error-while-dialing-dial-unix-var-run-elastic-agent-sock/342249 "2023-09-04T10:56:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![netteans](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/netteans/32/125374_2.png) [@netteans](https://discuss.elastic.co/u/netteans)\
**Post date:** [September 4, 2023, 10:56am UTC](https://discuss.elastic.co/t/error-while-dialing-dial-unix-var-run-elastic-agent-sock/342249/1 "2023-09-04T10:56:40Z")

</div>

I got same errors like [https://discuss.elastic.co/t/var-run-elastic-agent-sock-connect-no-such-file-or-directory/335817/2?u=netteans](https://discuss.elastic.co/t/var-run-elastic-agent-sock-connect-no-such-file-or-directory/335817/2)

```auto
mac@mybookpro Elastic % sudo /Library/Elastic/Agent/elastic-agent status
Password:
Error: failed to communicate with Elastic Agent daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/elastic-agent.sock: connect: no such file or directory"
For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.8/fleet-troubleshooting.html
mac@mybookpro Elastic %

```

Any idea can help?

Parts of logs here:

```auto
{"log.level":"error","@timestamp":"2023-09-04T18:24:57.349+0800","log.logger":"component.runtime.endpoint-default.service_runtime","log.origin":{"file.name":"runtime/service_command.go","file.line":69},"message":"2023-09-04 10:24:57: info: MainPosix.cpp:361 Verifying existing installation","context":"command output","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2023-09-04T18:24:57.349+0800","log.logger":"component.runtime.endpoint-default.service_runtime","log.origin":{"file.name":"runtime/service_command.go","file.line":69},"message":"2023-09-04 10:24:57: info: InstallLib.cpp:608 Running [/Library/Elastic/Endpoint/elastic-endpoint] [version --log stdout]","context":"command output","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2023-09-04T18:24:57.653+0800","log.logger":"component.runtime.endpoint-default.service_runtime","log.origin":{"file.name":"runtime/service_command.go","file.line":69},"message":"2023-09-04 10:24:57: info: InstallLib.cpp:646 Installed endpoint is expected version (version: 8.8.2, compiled: Tue Jun 20 15:00:00 2023, branch: 8.8, commit: c7377b81bb7fe4c4eedfc4fba3a6830ef61f55e2)","context":"command output","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2023-09-04T18:25:53.446+0800","log.logger":"component.runtime.endpoint-default.service_runtime","log.origin":{"file.name":"runtime/conn_info_server.go","file.line":45},"message":"failed accept conn info connection: accept tcp 127.0.0.1:6788: use of closed network connection","ecs.version":"1.6.0"}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 2, 2023, 10:56am UTC](https://discuss.elastic.co/t/error-while-dialing-dial-unix-var-run-elastic-agent-sock/342249/2 "2023-10-02T10:56:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
