Unable to start socket Listeners on 3030 and 3031

I am install sensu-agent in windows server 2012. I have downloaded and installed the service but when i start or run the service I prompted the following error. Please guide me accordingly. I have allow both ports as well.

C:\Program Files\Sensu\sensu-agent\bin>sensu-agent.exe start
{“component”:“cmd”,“level”:“warning”,“msg”:“config attribute id has been depreca
ted, please use name instead”,“time”:“2020-05-28T02:34:41-07:00”}
{“component”:“cmd”,“level”:“warning”,“msg”:“config attribute keepalive-timeout h
as been deprecated, please use keepalive-warning-timeout instead”,“time”:“2020-0
5-28T02:34:41-07:00”}
{“component”:“cmd”,“level”:“warning”,“msg”:“config attribute id has been depreca
ted, please use name instead”,“time”:“2020-05-28T02:34:41-07:00”}
{“component”:“cmd”,“level”:“warning”,“msg”:“config attribute keepalive-timeout h
as been deprecated, please use keepalive-warning-timeout instead”,“time”:“2020-0
5-28T02:34:41-07:00”}
{“component”:“agent”,“error”:“listen udp 127.0.0.1:3030: bind: Only one usage of
each socket address (protocol/network address/port) is normally permitted.”,“le
vel”:“error”,“msg”:“unable to start socket listeners”,“time”:“2020-05-28T02:34:4
1-07:00”}
{“component”:“agent”,“error”:“listen tcp 127.0.0.1:3031: bind: Only one usage of
each socket address (protocol/network address/port) is normally permitted.”,“le
vel”:“fatal”,“msg”:“the agent API has crashed”,“time”:"2020-05-28T02:34:41-07:00
"}

That error sounds like you’ve already got something listening on 3030/3031. What does netstat -abon show you?

1 Like

I am getting a similar error and it is preventing me from starting the agent on a win server 2012 as well. Not the port issue but the configuration being deprecated. Also, no matter what IP I put in the yaml config it tries to connect to the backend at 127.0.0.1. It’s like it’s not reading the yaml config at all.

Hello all

I just spun up a fresh windows 2012-R2 on AWS EC2 to test this. The documented install process using the msi package is working for me on this fresh install.

I am seeing the deprecated config warning message, but those are just warnings and yes we should clean those up (I’ll file an issue about that as they are causing confusion). but they are not an operational concern…

I am not getting the socket connection errors messages on this fresh install.

Based on my test just now, if you are getting the bind port 3030 and 3031 errors, that means something is already running that is listening on those ports. If you are getting socket bind errors, you need to figure out what is already binding on the ports in conflict. you can run netstat -a -b as Administrator at a windows console. There’s probably powershell module for this, but I’m not a powershell expert.

If you can’t turn off or reconfigure the other programs already binding 3031 and 3030 you can change the sensu-agent bahavior to change the port bindings or disable them entirely. While these additional ports the agent listens on do provide enhanced functionality, they are not strictly necessary for the fundamental pub/sub communication back with the Sensu server.

If you need to know which default configuration file you need to edit for sensu-agent you can run
sensu-agent start --help and check the usage information for --config-file
It will tell you what the defauilt location is. Could be you just aren’t editting the right file. Also remember if you are running sensu-agent as a Windows service, and not manually you will have to restart the service for any configuration file changes to take effect.