# Error enrolling agent

**URL:** <https://discuss.elastic.co/t/error-enrolling-agent/370135>\
**Category:** Elastic Agent\
**Created:** [November 6, 2024, 3:49pm UTC](https://discuss.elastic.co/t/error-enrolling-agent/370135 "2024-11-06T15:49:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![juancamiloll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancamiloll/32/110326_2.png) [@juancamiloll](https://discuss.elastic.co/u/juancamiloll)\
**Post date:** [November 6, 2024, 3:49pm UTC](https://discuss.elastic.co/t/error-enrolling-agent/370135/1 "2024-11-06T15:49:26Z")

</div>

Hello, me again hehehehe

I have a new error when installing an agent, although I found related documentation I would like to please confirm me if I understood the solution if I simply run the following lines

**Solve the problem** [[Fleet]: On enrolling RPM and Deb agents, `Restarting agent failed` error is displayed in CLI. · Issue #4084 · elastic/elastic-agent · GitHub](https://github.com/elastic/elastic-agent/issues/4084)

```auto
sudo systemctl enable elastic-agent 
sudo systemctl start elastic-agent

```

**Error**

```auto
{"log.level":"error","@timestamp":"2024-11-05T14:31:56.108-0500","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff","file.name":"cmd/enroll_cmd.go","file.line":495},"message":"Restart attempt 2 failed: 'rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial unix /opt/Elastic/Agent/elastic-agent.sock: connect: no such file or directory\"'. Waiting for 8s","ecs.version":"1.6.0"}
[==] Waiting For Enroll... [20s]

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7bd3c7e0dad83b800dd752932c24dfaaa8246fb.jpeg)

**Note:** if you wonder why I open a thread to ask something that supposedly I already have the solution is for 2 reasons, 1. I want it to be documented in the forum in case someone else finds the solution and 2. because I have to ask whoever administers the server to run that possible solution and that's why I want to make sure with your help.

**Note2:** this text has been translated, sorry for the errors in the text.
