# AWS ELB WS problems

**URL:** <https://forums.suse.com/t/aws-elb-ws-problems/1202>\
**Category:** Rancher 1.x\
**Created:** [December 8, 2015, 11:26pm UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202 "2015-12-08T23:26:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![miticojo](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@miticojo](https://forums.suse.com/u/miticojo)\
**Post date:** [December 8, 2015, 11:26pm UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/1 "2015-12-08T23:26:42Z")

</div>

HI All,  
I’m using 0.49 version and I would like to setup it behind AWS ELB and RDS MySQL, but I’m getting following error:

> time=“2015-12-08T23:16:59Z” level=fatal msg=“Unable to start event router” error=“websocket: bad handshake”

I’ve configured also Proxy Protocol to enable WSS traffic but nothing change… any idea?

Proxy Procol ref:

> **[Configure proxy protocol support for your Classic Load Balancer - Elastic...](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html)**
>
> Enable or disable support for proxy protocol, a human-readable header, for your Classic Load Balancer.

Thanks  
Jo

---

<div class="post-metadata">

**Author:** ![cjellick](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjellick/32/2876_2.png) [@cjellick](https://forums.suse.com/u/cjellick)\
**Post date:** [December 9, 2015, 3:26pm UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/2 "2015-12-09T15:26:29Z")

</div>

Hi @miticojo,

The UI also uses websockets to dynamically update. Can you check whether the UI is successfully making websocket connections?

To do so:

1. Open up rancher in your browser
2. Open up the developer tools for your browser and go to the network tab,
3. Refresh the browser.  
You should see a request to /v1/subscribe. Was it made successfully and is the response code to that request 101 “Switch Protocols”?

Also, can you give a little more information about your setup:

1. Are you running rancher in [HA mode](http://docs.rancher.com/rancher/installing-rancher/installing-server/multi-nodes/) or in [single server mode](http://docs.rancher.com/rancher/installing-rancher/installing-server/)? If in HA mode, is the websocket proxy container up and running successfully?
2. Do you have any other proxies between rancher-server and your ELB?

---

<div class="post-metadata">

**Author:** ![miticojo](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@miticojo](https://forums.suse.com/u/miticojo)\
**Post date:** [December 9, 2015, 4:18pm UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/3 "2015-12-09T16:18:38Z")

</div>

Hi @cjellick, thanks for your response!

from external connections it seems to work well: I’ve got a 200 for wss://rancher.\*\*\*\*\*\*\*\*\*\*\*\*.com/v1/subscribe?eventNames=resource.change&include=hosts&include=instances&include=instance&include=loadBalancerConfig&include=loadBalancerTargets&include=loadBalancerListeners&include=instanceLinks&include=ipAddresses&projectId=1a5 in my browser  
…  
but from server container I still have wss errors:

> time=“2015-12-09T16:03:04Z” level=info msg=“Initializing event router” workerCount=10  
> time=“2015-12-09T16:03:04Z” level=error msg=“Failed to subscribe to events.” error=“websocket: bad handshake” responseBody=“{"type":"collection","resourceType":"subscribe","links":{"self":"[https://rancher](https://rancher).**_.com/v1/subscribe"},"createTypes":{},"actions":{},"data":[],"sortLinks":{"eventNames":"[https://rancher](https://rancher)._.com/v1/subscribe?eventNames=physicalhost.create%3Bhandler%3DgoMachineService&eventNames=physicalhost.bootstrap%3Bhandler%3DgoMachineService&eventNames=physicalhost.remove%3Bhandler%3DgoMachineService&eventNames=ping%3Bhandler%3DgoMachineService&sort=eventNames"},"pagination":null,"sort":null,"filters":{"eventNames":[{"modifier":"eq","value":"physicalhost.create;handler=goMachineService"},{"modifier":"eq","value":"physicalhost.bootstrap;handler=goMachineService"},{"modifier":"eq","value":"physicalhost.remove;handler=goMachineService"},{"modifier":"eq","value":"ping;handler=goMachineService"}]},"createDefaults":{}}" responseHeaders=map[Server:[Jetty(9.2.11.v20150529)] X-Api-Account-Id:[1a6] X-Api-Client-Ip:[52.16.23.108] X-Api-Schemas:[[https://rancher](https://rancher).**_**.com/v1/schemas] Content-Length:[825] Content-Type:[application/json; charset=utf-8] Date:[Wed, 09 Dec 2015 16:03:04 GMT] Vary:[Accept-Encoding, User-Agent] Connection:[keep-alive]] status=“200 OK” statusCode=200 subscribeUrl="wss://rancher.**_\*\*\*\*.com/v1/subscribe?eventNames=physicalhost.create%3Bhandler%3DgoMachineService&eventNames=physicalhost.bootstrap%3Bhandler%3DgoMachineService&eventNames=physicalhost.remove%3Bhandler%3DgoMachineService&eventNames=ping%3Bhandler%3DgoMachineService”  
> time=“2015-12-09T16:03:04Z” level=error msg=“Unable to start EventRouter” Err=“websocket: bad handshake”  
> time=“2015-12-09T16:03:04Z” level=info msg=“Exiting go-machine-service…”

I’m using an ubuntu ec2 instance with docker 1.9 connected in a VPC network without any proxy, only ELB.

Thanks  
Jo

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [December 9, 2015, 4:58pm UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/4 "2015-12-09T16:58:46Z")

</div>

@miticojo It should say `101 Switching Protocols`, not `200`. Besides Proxy Protocol, you need the listener and target in ELB to be TCP/TLS, not HTTP/HTTPS because they don’t support WebSockets in HTTP mode.

---

<div class="post-metadata">

**Author:** ![miticojo](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@miticojo](https://forums.suse.com/u/miticojo)\
**Post date:** [December 10, 2015, 6:22am UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/5 "2015-12-10T06:22:46Z")

</div>

Ah sorry guys…  
I’ve changed ELB to TCP/TLS and now it works as expected! 😃

Thanks for your precious help!

My next step is try to test HA conf… I will keep you updated! 😉

Jo

---

<div class="post-metadata">

**Author:** ![kmcgrath](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/kmcgrath/32/446_2.png) [@kmcgrath](https://forums.suse.com/u/kmcgrath)\
**Post date:** [December 12, 2015, 1:48am UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/6 "2015-12-12T01:48:37Z")

</div>

@miticojo check out [https://github.com/SungardAS/particles-rancher](https://github.com/SungardAS/particles-rancher).

Even if you don’t use condensation the CloudFormation scripts can be used by clicking the ‘Launch Stack’ buttons.

It will give you HA multi-node rancher with Zookeeper, RDS MySQL, Elasticache Redis autoscaling groups and load balancers.

-Kevin

---

<div class="post-metadata">

**Author:** ![miticojo](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@miticojo](https://forums.suse.com/u/miticojo)\
**Post date:** [December 15, 2015, 3:25pm UTC](https://forums.suse.com/t/aws-elb-ws-problems/1202/7 "2015-12-15T15:25:13Z")

</div>

Thanks but I’d like to setup all with 3 AWS instances + RDS… and I’ve almost finished but HA documentation need to be changed and explained using some beautiful schema.
