Unable to install Elastic Agent 7.17.5 (Windows)

Hi everyone, I have an issue trying to enroll elastic agent 7.17.5 in Windows. (My fleet server is 7.17.5 too)

The first time I installed it, it worked perfectly but due to a storage issue on the machine that hosts ELK, I had to unenroll it and since then, I can't install it again.

Here is the result after trying to enroll it in PS : I've tried many times and it's always the same result. I changed the ip and the token before posting.

PS C:\Users\...\elastic-agent-7.17.5-windows-x86_64> .\elastic-agent.exe install --url=http://*myip*:8220 --enrollment-token=*token* --insecure
Elastic Agent will be installed at C:\Program Files\Elastic\Agent and will run as a service. Do you want to continue? [Y/n]:y
2022-08-03T11:11:05.245+0200    WARN    [tls]   tlscommon/tls_config.go:101     SSL/TLS verifications disabled.
2022-08-03T11:11:05.682+0200    INFO    cmd/enroll_cmd.go:454   Starting enrollment to URL: http://*myip*:8220/
2022-08-03T11:11:26.878+0200    WARN    cmd/enroll_cmd.go:465   Remote server is not ready to accept connections, will retry in a moment.
2022-08-03T11:12:26.891+0200    INFO    cmd/enroll_cmd.go:472   Retrying enrollment to URL: http://*myip*:8220/
2022-08-03T11:12:48.053+0200    WARN    cmd/enroll_cmd.go:465   Remote server is not ready to accept connections, will retry in a moment.

I have checked open ports on my fleet server and it's listening on 8220, I also tried to open the port on the Windows machine (as advised in a topic I found) but it didn't change anything.

Also, I have my fleet server in Updating status but it is still forwarding logs, maybe it has something to do with that. I have another elastic agent (7.17.5) installed on Ubuntu and it is healthy.
I only have one fleet server and one cluster, I don't know if this is relevant.

Here is the log I have every 5 to 10 minutes (from the fleet server and the other elastic agent) :

Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post "http://localhost:8220/api/fleet/agents/*myagentid*/checkin?": dial tcp 127.0.0.1:8220: connect: connection refused

I just don't understand why the fleet server says that it can't connect to the fleet server, cause it is the fleet server ...

Sorry, it makes two topics in one but I really think they are related.

Can someone help ?

Thanks ! :slight_smile:

UPDATE --
For the second problem,

Could not communicate with fleet-server Checking API will retry, error: fail to checkin to fleet-server: Post "http://localhost:8220/api/fleet/agents/*myagentid*/checkin?": dial tcp 127.0.0.1:8220: connect: connection refused

I solved it by modifying the fleet.yml file (/opt/Elastic/Agent/fleet.yml) : I changed all "localhost" and "127.0.0.1" mentions with the IP address of the machine hosting the Fleet Server. Hope it helps.

So the two issues were not related, anyone has an idea for the first one ? I still haven't found out how to solve it.