Lillian
Lillian

Reputation: 41

Run Bokeh on AWS EC2 server and get a blank page. No error messages

I am trying to delay my Bokeh server with AWS. It runs fine locally, but on my Linux EC2 it generates a blank webpage while no error messages are shown. My guess is that the EC2 does not meet the environment requests to run the interactive plots. Anyone has experience in deploying Bokeh with AWS? Do I need to install something for the plots to show? Thanks, Thank you guys for the responses. Here is what the log says, which I couldn't tell the problem:

2016-12-29 17:52:39,665 Starting Bokeh server version 0.12.3
2016-12-29 17:52:39,669 Starting Bokeh server on port 5006 with applications at paths ['/one_page']
2016-12-29 17:52:39,669 Starting Bokeh server with process id: 14082
2016-12-29 17:52:51,560 302 GET / (10.37.130.15) 0.68ms
2016-12-29 17:52:52,304 200 GET /one_page (10.37.130.15) 721.76ms
2016-12-29 17:52:52,343 200 GET /static/css/bokeh.min.css?v=882a547e86d77d573fefc67cb37bb345 (10.37.130.15) 11.88ms
2016-12-29 17:52:52,360 200 GET /static/js/bokeh-widgets.min.js?v=ce98d7a310ecac8b77374f1ac7c4819a (10.37.130.15) 31.21ms
2016-12-29 17:52:52,375 200 GET /static/css/bokeh-widgets.min.css?v=0161cfada7394f178079e5d79c611b3f (10.37.130.15) 45.41ms
2016-12-29 17:52:52,429 200 GET /static/js/bokeh.min.js?v=2489d3f55e068b60ead4375a27399865 (10.37.130.15) 104.27ms

And the console log says:

Failed to connect to Bokeh server Error: Could not open websocket

Upvotes: 4

Views: 1637

Answers (1)

Anthonydouc
Anthonydouc

Reputation: 3364

Not sure on your exact details (i.e amazon instance type, linux disto etc..). If this solution does not work for you, you will need to provide more info.

Here is the process i took to set up a test linux instance:

  • Launch a Amazon Linux AMI 2017.03.1 (HVM) instance, which is
    running redhat.
  • Complete the installation for python 3.6 and bokeh 0.12.5
  • Lastly allow https access through the relevant amazon security group.

If you launch a bokeh server, and try access it on your local machine and it is appearing blank, check the bokeh server log. Mine appeared with this message : "Refusing websocket connection from Origin 'http://52.65.113.185:5006'; use --allow-websocket-origin=52.65.113.185:5006"

The solution is therefore to launch your bokeh app with the command: "bokeh serve --allow-websocket-origin=52.65.113.185:5006"

Or more generally. "bokeh serve --allow-websocket-origin={server_ip}:5006"

Upvotes: 2

Related Questions