# Sensu agent installed in windows is not connecting to backend

**URL:** <https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011>\
**Category:** Sensu Go\
**Created:** [November 14, 2018, 2:12pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011 "2018-11-14T14:12:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![balajik515](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@balajik515](https://discourse.sensu.io/u/balajik515)\
**Post date:** [November 14, 2018, 2:12pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/1 "2018-11-14T14:12:27Z")

</div>

sensu Agent has been installed in windows machine  
Backend url also available in agent,yml  
when I started sensu agent service, sensu backed service went down  
I observed below logs in backend log

````auto
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x3c pc=0xfc7708]

goroutine 251 [running]:
github.com/sensu/sensu-go/backend/keepalived.createKeepaliveEvent(0xc42018de30, 0x1786680)
        /go/src/github.com/sensu/sensu-go/backend/keepalived/keepalived.go:256 +0x128
github.com/sensu/sensu-go/backend/keepalived.(*Keepalived).handleUpdate(0xc42016aa00, 0xc42018de30, 0xc4200aa080, 0xc421788c00)
        /go/src/github.com/sensu/sensu-go/backend/keepalived/keepalived.go:307 +0x1be
github.com/sensu/sensu-go/backend/keepalived.(*Keepalived).processKeepalives(0xc42016aa00)
        /go/src/github.com/sensu/sensu-go/backend/keepalived/keepalived.go:223 +0x24d
created by github.com/sensu/sensu-go/backend/keepalived.(*Keepalived).startWorkers
        /go/src/github.com/sensu/sensu-go/backend/keepalived/keepalived.go:177 +0x87```

I can see below logs in agent log

```{"component":"agent","level":"info","msg":"starting statsd server on address: 127.0.0.1:8125","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","event":{"Title":"Gostatsd started","Text":"Gostatsd started","DateHappened":1542204141,"Hostname":"<AgentHostname>","AggregationKey":"","SourceTypeName":"","Tags":null,"SourceIP":"","Priority":1,"AlertType":0},"level":"info","msg":"statsd received an event","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","level":"info","msg":"sending keepalive","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","level":"info","msg":"starting UDP listener on address: 127.0.0.1:3030","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","level":"info","msg":"starting TCP listener on address: 127.0.0.1:3030","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","level":"info","msg":"starting api on address: 127.0.0.1:3031","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","level":"info","msg":"connected - starting receivePump","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","level":"info","msg":"connected - starting sendPump","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","error":"Connection error: websocket: close 1006 (abnormal closure): unexpected EOF","level":"error","msg":"transport receive error","time":"2018-11-14T09:02:21-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:23-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:24-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:26-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:29-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:33-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:39-05:00"}
{"component":"agent","level":"info","msg":"sending keepalive","time":"2018-11-14T09:02:41-05:00"}
{"component":"agent","error":"Connection closed: the websocket connection is no longer open","level":"warning","msg":"transport send error","time":"2018-11-14T09:02:41-05:00"}
{"component":"agent","error":"dial tcp {<Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:02:48-05:00"}
{"component":"agent","level":"info","msg":"sending keepalive","time":"2018-11-14T09:03:01-05:00"}
{"component":"agent","error":"Connection closed: the websocket connection is no longer open","level":"warning","msg":"transport send error","time":"2018-11-14T09:03:01-05:00"}
{"component":"agent","error":"dial tcp {Backend IP}:8081: connectex: No connection could be made because the target machine actively refused it.","level":"error","msg":"reconnection attempt failed","time":"2018-11-14T09:03:06-05:00"}```

Could you please let me know what has gone wrong
````

---

<div class="post-metadata">

**Author:** ![aaronsachs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/aaronsachs/32/47_2.png) [@aaronsachs](https://discourse.sensu.io/u/aaronsachs)\
**Post date:** [November 14, 2018, 2:15pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/2 "2018-11-14T14:15:27Z")

</div>

@balajik515 can you please wrap your code/error blocks in ```? This will make it much easier to read for those troubleshooting the issue.

---

<div class="post-metadata">

**Author:** ![palourde](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/palourde/32/60_2.png) [@palourde](https://discourse.sensu.io/u/palourde)\
**Post date:** [November 14, 2018, 2:21pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/3 "2018-11-14T14:21:24Z")

</div>

Hi @balajik515,

Can you tell me the exact version of the Sensu agent and the Sensu backend? We identified a similar problem when running older agents with a recent version of the backend:

> <https://github.com/sensu/sensu-go/issues/2153>

If that’s the case, I’d recommend to make sure to run the same version across your agents and backend.

---

<div class="post-metadata">

**Author:** ![balajik515](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@balajik515](https://discourse.sensu.io/u/balajik515)\
**Post date:** [November 14, 2018, 2:25pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/4 "2018-11-14T14:25:36Z")

</div>

sensu backedn 5.0.0-1 & sensu agent 5.0.0-1

---

<div class="post-metadata">

**Author:** ![palourde](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/palourde/32/60_2.png) [@palourde](https://discourse.sensu.io/u/palourde)\
**Post date:** [November 14, 2018, 4:10pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/5 "2018-11-14T16:10:42Z")

</div>

I will need the exact version installed, which you can get by running the following commands:

sensu-backend version

sensu-agent version

Thanks!

---

<div class="post-metadata">

**Author:** ![balajik515](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@balajik515](https://discourse.sensu.io/u/balajik515)\
**Post date:** [November 15, 2018, 6:44am UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/6 "2018-11-15T06:44:09Z")

</div>

sensu-agent version 2.0.0-beta.4-4#a05ad41, build a05ad411199077286f49c06629eed4823331176c, built 2018-08-16T21:12:56+00  
00

sensu-backend version 2.0.0-beta.7-7#0ad392d, build 0ad392d15948e7cc38fdb93a9ada56aa05f42970, built 2018-10-26T17:07:52+0000

This agent we installed in windows.Its not working only in windows  
But it is working in rhel

---

<div class="post-metadata">

**Author:** ![palourde](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/palourde/32/60_2.png) [@palourde](https://discourse.sensu.io/u/palourde)\
**Post date:** [November 15, 2018, 2:48pm UTC](https://discourse.sensu.io/t/sensu-agent-installed-in-windows-is-not-connecting-to-backend/1011/7 "2018-11-15T14:48:16Z")

</div>

As you can see, the agent and the backend are running two different version (`beta.7` vs `beta.4`), which is causing this issue:

> [@balajik515](#):
>
> sensu-backend version 2.0.0-beta.7-7

> [@balajik515](#):
>
> sensu-agent version 2.0.0-beta.4-4

Unfortunately Windows packages for the sensu-agent are no longer published for the moment. The easiest solution would probably to manually build a Windows binary for the agent from the source code, using the `2.0.0-beta.7-1` tag. Let us know if you need help with that.
