Bokeh Server Question

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

Hi,

app_path should be the path in the URL (just /foo if the script is called foo.py) rather than the filesystem path. Don’t know if that’s the only issue but it may be the immediate cause of the error you got.

Havoc

···

On Jan 13, 2016, at 10:29 PM, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4e3452c9-897b-484b-b823-4982d5afcd12%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Havoc,

is app_path needed/relevant when trying to push a new plot to a server using output_server?

Bryan

···

On Jan 13, 2016, at 9:34 PM, Havoc Pennington <[email protected]> wrote:

Hi,

app_path should be the path in the URL (just /foo if the script is called foo.py) rather than the filesystem path. Don't know if that's the only issue but it may be the immediate cause of the error you got.

Havoc

On Jan 13, 2016, at 10:29 PM, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

      bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id='None', url='http://10.10.4.252:5006', app_path='/home/aliz/mybokeh/app/', autopush=False)
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend="Temp.", line_width=2)
show(p)

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
  File “./b.py”, line 8, in <module>
    show(p)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
    return _show_with_state(obj, _state, browser, new)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
    _show_server_with_state(obj, state, new, controller)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
    push(state=state)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
    document=document, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
    session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
    session.push(document)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
    raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show(p) which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4e3452c9-897b-484b-b823-4982d5afcd12%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2EF67D2D-75B0-4B00-80B3-A64CA55F6E42%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

To start, I think maybe you want

  session_id = None # actual python None type

not

  session_id = "None" # not a string with the value "None"

Bryan

···

On Jan 13, 2016, at 9:29 PM, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

      bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id='None', url='http://10.10.4.252:5006', app_path='/home/aliz/mybokeh/app/', autopush=False)
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend="Temp.", line_width=2)
show(p)

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
  File “./b.py”, line 8, in <module>
    show(p)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
    return _show_with_state(obj, _state, browser, new)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
    _show_server_with_state(obj, state, new, controller)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
    push(state=state)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
    document=document, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
    session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
    session.push(document)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
    raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show(p) which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4e3452c9-897b-484b-b823-4982d5afcd12%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

If you do “bokeh serve” with no args then it isn’t since the default path of / will be right, but if the server has a script you would need a path matching the script. Of course, it doesn’t make sense in most cases to have a script on the server side and also output_server since the output_server will overwrite what the script does. So that may be an issue.

I was looking at

bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Havoc

···

On Jan 13, 2016, at 10:43 PM, Bryan Van de Ven [email protected] wrote:

Havoc,

is app_path needed/relevant when trying to push a new plot to a server using output_server?

Bryan

On Jan 13, 2016, at 9:34 PM, Havoc Pennington [email protected] wrote:

Hi,

app_path should be the path in the URL (just /foo if the script is called foo.py) rather than the filesystem path. Don’t know if that’s the only issue but it may be the immediate cause of the error you got.

Havoc

On Jan 13, 2016, at 10:29 PM, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4e3452c9-897b-484b-b823-4982d5afcd12%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2EF67D2D-75B0-4B00-80B3-A64CA55F6E42%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/18534511-C8F8-4D30-A85D-9D11CDCE95C5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you for your comments & suggestions.
I tried ‘None’ => None but I got a syntax error. I also played around with other suggestions about app_path but continue to have the same problem.
I looked at this server example on the git: https://github.com/bokeh/bokeh/blob/master/examples/plotting/server/animated.py
and tried to run it with a few trial modifications. Several trails are shown below. In all cases I get the following error:
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)
netstat confirms server is running (tcp 0 0 10.10.4.252:5006 0.0.0.0:* LISTEN 12003/python) and I can access scripts using a browser on another host.
**So the basic problem is this: how do you push/publish a graph on the bokeh server and have it accessible from another host’s browser on the same subnet? All examples and tutorials I have seen use localhost assuming the browser is running on the same host as the bokeh server. **

====================================================================animated.py====================
bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 $HOME/mybokeh

#!/usr/bin/python

You must first run “bokeh serve” to view this example

from numpy import pi, cos, sin, linspace, roll

from bokeh.client import push_session
from bokeh.io import curdoc
from bokeh.plotting import figure

M = 5
N = M10 + 1
r_base = 8
theta = linspace(0, 2
pi, N)
r_x = linspace(0, 6*pi, N-1)
rmin = r_base - cos(r_x) - 1
rmax = r_base + sin(r_x) + 1

colors = [“FFFFCC”, “#C7E9B4”, “#7FCDBB”, “#41B6C4”, “#2C7FB8”, “#253494”, “#2C7FB8”, “#41B6C4”, “#7FCDBB”, “#C7E9B4”] * M

figure() function auto-adds the figure to curdoc()

p = figure(x_range=(-11, 11), y_range=(-11, 11))
r = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],
fill_color=colors, line_color=“white”)

open a session to keep our local document in sync with server

session = push_session(curdoc())

ds = r.data_source

def update():
rmin = roll(ds.data[“inner_radius”], 1)
rmax = roll(ds.data[“outer_radius”], -1)
ds.data.update(inner_radius=rmin, outer_radius=rmax)

curdoc().add_periodic_callback(update, 30)

#session.show() # open the document in a browser
#session.show(url=‘10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/apps’) # open the document in a browser
session.show(url=‘10.10.4.252:5006’) # open the document in a browser

session.loop_until_closed() # run forever

====================================================================animated.py====================

···

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

You would want to provide the URL to push_session rather than to show() I think.

I guess the exception you get is probably from push_session?

Havoc

···

On Jan 14, 2016, at 1:39 PM, [email protected] wrote:

Thank you for your comments & suggestions.
I tried ‘None’ => None but I got a syntax error. I also played around with other suggestions about app_path but continue to have the same problem.
I looked at this server example on the git: https://github.com/bokeh/bokeh/blob/master/examples/plotting/server/animated.py
and tried to run it with a few trial modifications. Several trails are shown below. In all cases I get the following error:
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)
netstat confirms server is running (tcp 0 0 10.10.4.252:5006 0.0.0.0:* LISTEN 12003/python) and I can access scripts using a browser on another host.
**So the basic problem is this: how do you push/publish a graph on the bokeh server and have it accessible from another host’s browser on the same subnet? All examples and tutorials I have seen use localhost assuming the browser is running on the same host as the bokeh server. **

====================================================================animated.py====================
bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 $HOME/mybokeh

#!/usr/bin/python

You must first run “bokeh serve” to view this example

from numpy import pi, cos, sin, linspace, roll

from bokeh.client import push_session
from bokeh.io import curdoc
from bokeh.plotting import figure

M = 5
N = M10 + 1
r_base = 8
theta = linspace(0, 2
pi, N)
r_x = linspace(0, 6*pi, N-1)
rmin = r_base - cos(r_x) - 1
rmax = r_base + sin(r_x) + 1

colors = [“FFFFCC”, “#C7E9B4”, “#7FCDBB”, “#41B6C4”, “#2C7FB8”, “#253494”, “#2C7FB8”, “#41B6C4”, “#7FCDBB”, “#C7E9B4”] * M

figure() function auto-adds the figure to curdoc()

p = figure(x_range=(-11, 11), y_range=(-11, 11))
r = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],
fill_color=colors, line_color=“white”)

open a session to keep our local document in sync with server

session = push_session(curdoc())

ds = r.data_source

def update():
rmin = roll(ds.data[“inner_radius”], 1)
rmax = roll(ds.data[“outer_radius”], -1)
ds.data.update(inner_radius=rmin, outer_radius=rmax)

curdoc().add_periodic_callback(update, 30)

#session.show() # open the document in a browser
#session.show(url=‘10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/apps’) # open the document in a browser
session.show(url=‘10.10.4.252:5006’) # open the document in a browser

session.loop_until_closed() # run forever

====================================================================animated.py====================

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, azarin…@gmail.com wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bedc7eca-d0ec-4b2a-8181-0f5180f134f7%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I changed:

session = push_session(curdoc(), url=‘http://10.10.4.252:5006’)

But got the same error:

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

Now, I also this from the server’s debug trace (putting the urk in show() or leaving it out makes no difference in this):

WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=UAZm01x7kl54GFUnkzAhYwkGc9yus9Ufv9qLY7by3KOI (10.10.4.252) 0.42ms

It looks like it is using websocket instead of http although that doesn’t explain much.

···

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

Are you running bokeh serve with a script or bare with only the --address / --host options?

What happens if you connect to http://10.10.4.252:5006 with a browser or wget or curl?

The 404 on /ws implies that you may be running the server with a script instead of bare. If so you need an app_path="/foo" so if your script is foo.py you get /foo/ws instead of /ws

But running with a script and then also doing push_session usually doesn’t make sense. You typically generate the document either on client or server not both. If you are generating on client don’t pass a script to bokeh serve.

Havoc

···

On Jan 14, 2016, at 2:49 PM, [email protected] wrote:

I changed:

session = push_session(curdoc(), url='http://10.10.4.252:5006’)

But got the same error:

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

Now, I also this from the server’s debug trace (putting the urk in show() or leaving it out makes no difference in this):

WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=UAZm01x7kl54GFUnkzAhYwkGc9yus9Ufv9qLY7by3KOI (10.10.4.252) 0.42ms

It looks like it is using websocket instead of http although that doesn’t explain much.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, azarin…@gmail.com wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bb25501b-1e6b-4da7-ad62-2f1ab4c4430b%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Here is an issue about improving the error message:

https://github.com/bokeh/bokeh/issues/3653

Havoc

···

On Jan 14, 2016, at 2:56 PM, Havoc Pennington [email protected] wrote:

Are you running bokeh serve with a script or bare with only the --address / --host options?

What happens if you connect to http://10.10.4.252:5006 with a browser or wget or curl?

The 404 on /ws implies that you may be running the server with a script instead of bare. If so you need an app_path="/foo" so if your script is foo.py you get /foo/ws instead of /ws

But running with a script and then also doing push_session usually doesn’t make sense. You typically generate the document either on client or server not both. If you are generating on client don’t pass a script to bokeh serve.

Havoc

On Jan 14, 2016, at 2:49 PM, [email protected] wrote:

I changed:

session = push_session(curdoc(), url='http://10.10.4.252:5006’)

But got the same error:

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

Now, I also this from the server’s debug trace (putting the urk in show() or leaving it out makes no difference in this):

WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=UAZm01x7kl54GFUnkzAhYwkGc9yus9Ufv9qLY7by3KOI (10.10.4.252) 0.42ms

It looks like it is using websocket instead of http although that doesn’t explain much.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, azarin…@gmail.com wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bb25501b-1e6b-4da7-ad62-2f1ab4c4430b%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Havoc,

I think the desire is to be able to "publish" a new document to already running server (that may also happen to be running an other, different app or apps).

I can believe that might currently require one Bokeh server to run the apps, and a second, plain "bokeh serve" for the "publish" part, but I'm not sure about the subnet issue yet. I suppose that might be a current bug or limitation.

Bryan

···

On Jan 14, 2016, at 1:56 PM, Havoc Pennington <[email protected]> wrote:

Are you running bokeh serve with a script or bare with only the --address / --host options?

What happens if you connect to http://10.10.4.252:5006 with a browser or wget or curl?

The 404 on /ws implies that you may be running the server with a script instead of bare. If so you need an app_path="/foo" so if your script is foo.py you get /foo/ws instead of /ws

But running with a script and then also doing push_session usually doesn't make sense. You typically generate the document either on client or server not both. If you are generating on client don't pass a script to bokeh serve.

Havoc

On Jan 14, 2016, at 2:49 PM, [email protected] wrote:

I changed:

session = push_session(curdoc(), url='http://10.10.4.252:5006')

But got the same error:

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)

Now, I also this from the server's debug trace (putting the urk in show() or leaving it out makes no difference in this):

WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=UAZm01x7kl54GFUnkzAhYwkGc9yus9Ufv9qLY7by3KOI (10.10.4.252) 0.42ms

It looks like it is using websocket instead of http although that doesn't explain much.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:
I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

      bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id='None', url='http://10.10.4.252:5006', app_path='/home/aliz/mybokeh/app/', autopush=False)
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend="Temp.", line_width=2)
show(p)

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
  File “./b.py”, line 8, in <module>
    show(p)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
    return _show_with_state(obj, _state, browser, new)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
    _show_server_with_state(obj, state, new, controller)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
    push(state=state)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
    document=document, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
    session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
    session.push(document)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
    raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show(p) which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bb25501b-1e6b-4da7-ad62-2f1ab4c4430b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/63DF5339-E7D9-4561-AD33-2D63A8DDE353%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Havoc. Yes I was running bokeh serve with an app path. This was just to see that I can browse graphs from another box. I took it out and it made a difference for the server but it is still not quite there. Here’s a summary:

  1. Run “bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 --allow-websocket-origin 10.10.4.252:5006 $HOME/mybokeh”. Now if I try to post a graph to the server it fails. This is what I had done until now.
  2. Now take out the script path: “bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006”. Running animated.py does not produce IOError (confirming your suggestion). But it looks like it tried to display on the server’s console because I see this: " Viewing . Clearly no graph shows up on the console. So even though “session = push_session(curdoc(), url=‘http://10.10.4.252:5006’)”, it doesn’t output there.
···

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

A server with scripts is the same as one without except that without scripts we default to an "empty" script and a path of /

But a client should be able to push and overwrite a script-generated doc right

Havoc

···

On Jan 14, 2016, at 3:19 PM, Bryan Van de Ven <[email protected]> wrote:

Havoc,

I think the desire is to be able to "publish" a new document to already running server (that may also happen to be running an other, different app or apps).

I can believe that might currently require one Bokeh server to run the apps, and a second, plain "bokeh serve" for the "publish" part, but I'm not sure about the subnet issue yet. I suppose that might be a current bug or limitation.

Bryan

On Jan 14, 2016, at 1:56 PM, Havoc Pennington <[email protected]> wrote:

Are you running bokeh serve with a script or bare with only the --address / --host options?

What happens if you connect to http://10.10.4.252:5006 with a browser or wget or curl?

The 404 on /ws implies that you may be running the server with a script instead of bare. If so you need an app_path="/foo" so if your script is foo.py you get /foo/ws instead of /ws

But running with a script and then also doing push_session usually doesn't make sense. You typically generate the document either on client or server not both. If you are generating on client don't pass a script to bokeh serve.

Havoc

On Jan 14, 2016, at 2:49 PM, [email protected] wrote:

I changed:

session = push_session(curdoc(), url='http://10.10.4.252:5006')

But got the same error:

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)

Now, I also this from the server's debug trace (putting the urk in show() or leaving it out makes no difference in this):

WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=UAZm01x7kl54GFUnkzAhYwkGc9yus9Ufv9qLY7by3KOI (10.10.4.252) 0.42ms

It looks like it is using websocket instead of http although that doesn't explain much.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:
I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

     bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id='None', url='http://10.10.4.252:5006', app_path='/home/aliz/mybokeh/app/', autopush=False)
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend="Temp.", line_width=2)
show(p)

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in <module>
   show(p)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
   return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
   _show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
   push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
   document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
   session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
   session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
   raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show(p) which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bb25501b-1e6b-4da7-ad62-2f1ab4c4430b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/63DF5339-E7D9-4561-AD33-2D63A8DDE353%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/97E72E44-33A1-4C0B-96C2-83FC0CFBF415%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

what is the exact script you are currently running on client ?

Havoc

···

On Jan 14, 2016, at 3:23 PM, [email protected] wrote:

Thanks Havoc. Yes I was running bokeh serve with an app path. This was just to see that I can browse graphs from another box. I took it out and it made a difference for the server but it is still not quite there. Here’s a summary:

  1. Run “bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 --allow-websocket-origin 10.10.4.252:5006 $HOME/mybokeh”. Now if I try to post a graph to the server it fails. This is what I had done until now.
  2. Now take out the script path: “bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006”. Running animated.py does not produce IOError (confirming your suggestion). But it looks like it tried to display on the server’s console because I see this: " Viewing . Clearly no graph shows up on the console. So even though “session = push_session(curdoc(), url='http://10.10.4.252:5006’)”, it doesn’t output there.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, azarin…@gmail.com wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/3a8c3ed5-fb65-4f08-b390-ed1920958765%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

show() just uses the python stdlib webbrowser module (locally, on whatever machine you run show() on) to open up a constructed URL. It's not possible for the server to try and open a browser, unless show() was executed on the server. Can you confirm the URL that your (local) browser tries to open is the correct one, to the server on the other subnet? Alternatively if you navigate your browser there by hand, instead of using show? Is it possible to share server log output? Can you ever see the connection from the python client, or the doc being updated occur?

Bryan

···

On Jan 14, 2016, at 2:23 PM, [email protected] wrote:

Thanks Havoc. Yes I was running bokeh serve with an app path. This was just to see that I can browse graphs from another box. I took it out and it made a difference for the server but it is still not quite there. Here's a summary:

1. Run "bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 --allow-websocket-origin 10.10.4.252:5006 $HOME/mybokeh". Now if I try to post a graph to the server it fails. This is what I had done until now.
2. Now take out the script path: "bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006". Running animated.py does not produce IOError (confirming your suggestion). But it looks like it tried to display on the server's console because I see this: " Viewing <Bokeh Application>. Clearly no graph shows up on the console. So even though "session = push_session(curdoc(), url='http://10.10.4.252:5006')", it doesn't output there.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:
I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

      bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id='None', url='http://10.10.4.252:5006', app_path='/home/aliz/mybokeh/app/', autopush=False)
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
p.line(x, y, legend="Temp.", line_width=2)
show(p)

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
  File “./b.py”, line 8, in <module>
    show(p)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
    return _show_with_state(obj, _state, browser, new)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
    _show_server_with_state(obj, state, new, controller)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
    push(state=state)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
    document=document, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
    session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
    session.push(document)
  File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
    raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show(p) which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/3a8c3ed5-fb65-4f08-b390-ed1920958765%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I am trying to run the animated.py example from the git with changes to url. Here it is:

==========================animated.py===================
#!/usr/bin/python

You must first run “bokeh serve” to view this example

from numpy import pi, cos, sin, linspace, roll

from bokeh.client import push_session
from bokeh.io import curdoc
from bokeh.plotting import figure

M = 5
N = M10 + 1
r_base = 8
theta = linspace(0, 2
pi, N)
r_x = linspace(0, 6*pi, N-1)
rmin = r_base - cos(r_x) - 1
rmax = r_base + sin(r_x) + 1

colors = [“FFFFCC”, “#C7E9B4”, “#7FCDBB”, “#41B6C4”, “#2C7FB8”, “#253494”, “#2C7FB8”, “#41B6C4”, “#7FCDBB”, “#C7E9B4”] * M

figure() function auto-adds the figure to curdoc()

p = figure(x_range=(-11, 11), y_range=(-11, 11))
r = p.annular_wedge(0, 0, rmin, rmax, theta[:-1], theta[1:],
fill_color=colors, line_color=“white”)

open a session to keep our local document in sync with server

#session = push_session(curdoc())
session = push_session(curdoc(), url=‘http://10.10.4.252:5006’)

ds = r.data_source

def update():
rmin = roll(ds.data[“inner_radius”], 1)
rmax = roll(ds.data[“outer_radius”], -1)
ds.data.update(inner_radius=rmin, outer_radius=rmax)

curdoc().add_periodic_callback(update, 30)

session.show() # open the document in a browser
#session.show(url=‘10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/apps’) # open the document in a browser
#session.show(url=‘http://10.10.4.252:5006’) # open the document in a browser

session.loop_until_closed() # run forever
=============================================================animated.py==============================

···

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python
from bokeh.plotting import figure, output_server, show
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
p.line(x, y, legend=“Temp.”, line_width=2)
show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))
Traceback (most recent call last):
File “./b.py”, line 8, in
show§
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show
return _show_with_state(obj, _state, browser, new)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state
_show_server_with_state(obj, state, new, controller)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state
push(state=state)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push
document=document, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server
session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session
session.push(document)
File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push
raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”)
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.

Makes sense. Here’s my setup:

  1. A single subnet with two hosts. bokeh server on 10.10.4.252 and my laptop running browser on 10.10.10.204. So RE: “to the server on the other subnet?”, there is no other subnet, just one.
  2. My browser tries to open 10.10.4.252:5006.
  3. If I run bokeh serve with a script in the app_path, it works fine.
  4. Here is the debug trace from the server when it starts and after I open http://10.10.4.252:5006 from my laptop browser at 10.10.10.204:

=============When I start:

[email protected]:~$ bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 --host 10.10.10.204
DEBUG:bokeh.server.tornado:Allowed Host headers: [‘10.10.4.252:5006’, ‘10.10.10.204:80’]
DEBUG:bokeh.server.tornado:These host origins can connect to the websocket: [‘localhost:5006’, ‘10.10.4.252:5006’, ‘10.10.10.204:80’]
DEBUG:bokeh.server.tornado:Patterns are: [(’/?’, <class ‘bokeh.server.views.doc_handler.DocHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x7f4ee48e5d50>, ‘bokeh_websocket_path’: ‘/ws’}), (’/ws’, <class ‘bokeh.server.views.ws.WSHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x7f4ee48e5d50>, ‘bokeh_websocket_path’: ‘/ws’}), (’/autoload.js’, <class ‘bokeh.server.views.autoload_js_handler.AutoloadJsHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x7f4ee48e5d50>, ‘bokeh_websocket_path’: ‘/ws’}), (’/static/(.*)’, <class ‘bokeh.server.views.static_handler.StaticHandler’>)]
INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 address 10.10.4.252 with applications at paths [’/’]

===============After I run animated.py===============

INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.session:pushing doc to session u’kPoPt4AjAeqm4APBx0tbpRlfxHyg0AufsjLtUjFVOtMH’
INFO:tornado.access:200 GET /?bokeh-session-id=kPoPt4AjAeqm4APBx0tbpRlfxHyg0AufsjLtUjFVOtMH (10.10.4.252) 6.68ms
DEBUG:bokeh.server.tornado:[pid 12444] 1 clients connected

============when I open browser from laptop to 10.10.4.252:5006======

INFO:tornado.access:200 GET / (10.10.10.204) 2.29ms
INFO:tornado.access:304 GET /static/css/bokeh.min.css?v=486d3195473d3e39ad36f2888fefe389 (10.10.10.204) 3.70ms
INFO:tornado.access:304 GET /static/css/bokeh-widgets.min.css?v=0bbd11cf0fab2f648f3918c073bc9c3d (10.10.10.204) 0.60ms
INFO:tornado.access:304 GET /static/js/bokeh.min.js?v=b0e2720e424bae5562ceecc6d83c2044 (10.10.10.204) 0.57ms
INFO:tornado.access:304 GET /static/js/bokeh-widgets.min.js?v=8e88133dddc48883a815d4278dd80f9a (10.10.10.204) 0.56ms
INFO:tornado.access:304 GET /static/js/bokeh-compiler.min.js?v=34cb81b761c2c28f1955c7bb98dab3a9 (10.10.10.204) 0.56ms
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.session:Sending pull-doc-reply from session ‘Ll7eu0TrUWA5V7oVZ4LW0t67raJm4cmlVlrh7aYSfRjK’
DEBUG:bokeh.server.tornado:[pid 12444] 2 clients connected

···

On Thursday, January 14, 2016 at 3:37:16 PM UTC-5, Bryan Van de ven wrote:

show() just uses the python stdlib webbrowser module (locally, on whatever machine you run show() on) to open up a constructed URL. It’s not possible for the server to try and open a browser, unless show() was executed on the server. Can you confirm the URL that your (local) browser tries to open is the correct one, to the server on the other subnet? Alternatively if you navigate your browser there by hand, instead of using show? Is it possible to share server log output? Can you ever see the connection from the python client, or the doc being updated occur?

Bryan

On Jan 14, 2016, at 2:23 PM, [email protected] wrote:

Thanks Havoc. Yes I was running bokeh serve with an app path. This was just to see that I can browse graphs from another box. I took it out and it made a difference for the server but it is still not quite there. Here’s a summary:

  1. Run “bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006 --allow-websocket-origin 10.10.4.252:5006 $HOME/mybokeh”. Now if I try to post a graph to the server it fails. This is what I had done until now.
  1. Now take out the script path: “bokeh serve --address 10.10.4.252 --host 10.10.4.252:5006”. Running animated.py does not produce IOError (confirming your suggestion). But it looks like it tried to display on the server’s console because I see this: " Viewing . Clearly no graph shows up on the console. So even though “session = push_session(curdoc(), url=‘http://10.10.4.252:5006’)”, it doesn’t output there.

On Wednesday, January 13, 2016 at 10:29:59 PM UTC-5, [email protected] wrote:

I am new to bokeh (< 1 day) but quite impressed. It looks like what I am looking for: to publish a time series from Redis and display it on a browser using bokeh server.

Before trying a time-series I tried to go through the tutorial by trying to run the server on an interface other than localhost:

  bokeh serve --address 10.10.4.252 --host [10.10.4.252:5006](http://10.10.4.252:5006) /home/aliz/mybokeh/ /home/aliz/mybokeh/apps/*

Now if I put say sliders.py (from the git) in apps, I can access it from the browser on another host at 10.10.10.200 on the same subnet. Great!

But what I have not been able to do is to post a graph to the bokeh server and access it from a browser on 10.10.10.200. I tried to run the following example from the tutorial:

#!/usr/bin/python

from bokeh.plotting import figure, output_server, show

x = [1, 2, 3, 4, 5]

y = [6, 7, 2, 4, 5]

output_server(session_id=‘None’, url=‘http://10.10.4.252:5006’, app_path=’/home/aliz/mybokeh/app/’, autopush=False)

p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)

p.line(x, y, legend=“Temp.”, line_width=2)

show§

But I get:

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(404, ‘Not Found’, HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f71358bcbf0>,code=404,effective_url=‘http://10.10.4.252:5006/home/aliz/mybokeh/app/ws?bokeh-protocol-version=1.0&bokeh-session-id=None’,error=HTTPError(…),headers=<tornado.httputil.HTTPHeaders object at 0x7f7135869f90>,reason=‘Not Found’,request=<tornado.httpclient.HTTPRequest object at 0x7f7135869c10>,request_time=0.004470109939575195,time_info={}))

Traceback (most recent call last):

File “./b.py”, line 8, in

show(p)

File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 279, in show

return _show_with_state(obj, _state, browser, new)

File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 290, in _show_with_state

_show_server_with_state(obj, state, new, controller)

File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 314, in _show_server_with_state

push(state=state)

File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 457, in push

document=document, io_loop=io_loop)

File “/usr/local/lib/python2.7/dist-packages/bokeh/io.py”, line 400, in _push_to_server

session = push_session(document, session_id=session_id, url=url, app_path=app_path, io_loop=io_loop)

File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 64, in push_session

session.push(document)

File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 270, in push

raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)")

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

I think the problem is with show§ which seems to work only if you are accessing the plot on a browser on localhost. But I have not been able to figure out what API to use.

Suggestions about this problem as well on plotting time-series published by Redis are greatly appreciated.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/3a8c3ed5-fb65-4f08-b390-ed1920958765%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.