Bokeh app working locally but losing global variables when run across network

Hi

Really impressed with Bokeh plotting - thanks for making this framework available.

I’ve just got one stupid bug. Bit of a strange one - and it may well be something I am doing wrong.

I am using the January 2016 Bokeh release 0.11 with Python 3.5 on a linux (CentOS) server.

I have a Bokeh app which works fine when I connect locally on the machine on which I run bokeh serve. But when I run across the network, (using the same browser, Firefox), it only partially works, and the problem seems to be that it forgets the value of global python variables that have been set previously from widget variables. I wondered if running across the network was somehow causing the session to drop and be reinitialized? And if so, if there is any way of using the session loop_forever concept when this is just a simple app, a single py file run from bokeh --serve.

Would be very grateful for any help and suggestions - this is for an app demo which could result in Bokeh being used for our research project across the team I am part of, if I can just fix this bug.

Best wishes

Cathy

Hi,

On what time scale? In Bokeh 0.11 sessions were considered "unused" after 30 minutes:

  https://github.com/bokeh/bokeh/blob/0.11.0/bokeh/server/tornado.py#L93-L95

In Bokeh 0.11.1 this is made configurable via a command line option.

Bryan

···

On Feb 12, 2016, at 6:33 AM, Catmo <[email protected]> wrote:

Hi

Really impressed with Bokeh plotting - thanks for making this framework available.

I've just got one stupid bug. Bit of a strange one - and it may well be something I am doing wrong.

I am using the January 2016 Bokeh release 0.11 with Python 3.5 on a linux (CentOS) server.

I have a Bokeh app which works fine when I connect locally on the machine on which I run bokeh serve. But when I run across the network, (using the same browser, Firefox), it only partially works, and the problem seems to be that it forgets the value of global python variables that have been set previously from widget variables. I wondered if running across the network was somehow causing the session to drop and be reinitialized? And if so, if there is any way of using the session loop_forever concept when this is just a simple app, a single py file run from bokeh --serve.

Would be very grateful for any help and suggestions - this is for an app demo which could result in Bokeh being used for our research project across the team I am part of, if I can just fix this bug.

Best wishes

Cathy

--
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/e49c8854-2a02-4d17-9190-982d7ac9e3fe%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan

Thanks for the reply - the timescale is much less, on the scale of a second or less.

So I guess it is probably not the session. It’s very odd, run remotely I can’t even get the value of the AutocompleteInput; but run locally (on a web browser) it is fine. I will try to write a small app which isolates the problem and post it.

Cheers

Cathy

···

On Friday, 12 February 2016 14:50:33 UTC, Bryan Van de ven wrote:

Hi,

On what time scale? In Bokeh 0.11 sessions were considered “unused” after 30 minutes:

    [https://github.com/bokeh/bokeh/blob/0.11.0/bokeh/server/tornado.py#L93-L95](https://github.com/bokeh/bokeh/blob/0.11.0/bokeh/server/tornado.py#L93-L95)

In Bokeh 0.11.1 this is made configurable via a command line option.

Bryan

On Feb 12, 2016, at 6:33 AM, Catmo [email protected] wrote:

Hi

Really impressed with Bokeh plotting - thanks for making this framework available.

I’ve just got one stupid bug. Bit of a strange one - and it may well be something I am doing wrong.

I am using the January 2016 Bokeh release 0.11 with Python 3.5 on a linux (CentOS) server.

I have a Bokeh app which works fine when I connect locally on the machine on which I run bokeh serve. But when I run across the network, (using the same browser, Firefox), it only partially works, and the problem seems to be that it forgets the value of global python variables that have been set previously from widget variables. I wondered if running across the network was somehow causing the session to drop and be reinitialized? And if so, if there is any way of using the session loop_forever concept when this is just a simple app, a single py file run from bokeh --serve.

Would be very grateful for any help and suggestions - this is for an app demo which could result in Bokeh being used for our research project across the team I am part of, if I can just fix this bug.

Best wishes

Cathy


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/e49c8854-2a02-4d17-9190-982d7ac9e3fe%40continuum.io.

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

Hi Bryan

I have run some little test codes, and narrowed it down to a problem with AutocompleteInput rather than with global variables. When I replace the AutocompleteInput with a Select, everything works fine across the network. I attach 4 example codes, the Select versions work across the network as well locally, the versions with AutocompleteInput work locally but not across the network (i.e. on_change is never triggered, and even the direct examples do not successfully update the button label when the button is pressed.)

Best wishes

Cathy

autocomp_globvar.py (723 Bytes)

autocomp_globvar_sel.py (639 Bytes)

autocomp_prob.py (448 Bytes)

autocomp_prob_sel.py (370 Bytes)

···

On Friday, 12 February 2016 16:20:31 UTC, Catmo wrote:

Hi Bryan

Thanks for the reply - the timescale is much less, on the scale of a second or less.

So I guess it is probably not the session. It’s very odd, run remotely I can’t even get the value of the AutocompleteInput; but run locally (on a web browser) it is fine. I will try to write a small app which isolates the problem and post it.

Cheers

Cathy

On Friday, 12 February 2016 14:50:33 UTC, Bryan Van de ven wrote:

Hi,

On what time scale? In Bokeh 0.11 sessions were considered “unused” after 30 minutes:

    [https://github.com/bokeh/bokeh/blob/0.11.0/bokeh/server/tornado.py#L93-L95](https://github.com/bokeh/bokeh/blob/0.11.0/bokeh/server/tornado.py#L93-L95)

In Bokeh 0.11.1 this is made configurable via a command line option.

Bryan

On Feb 12, 2016, at 6:33 AM, Catmo [email protected] wrote:

Hi

Really impressed with Bokeh plotting - thanks for making this framework available.

I’ve just got one stupid bug. Bit of a strange one - and it may well be something I am doing wrong.

I am using the January 2016 Bokeh release 0.11 with Python 3.5 on a linux (CentOS) server.

I have a Bokeh app which works fine when I connect locally on the machine on which I run bokeh serve. But when I run across the network, (using the same browser, Firefox), it only partially works, and the problem seems to be that it forgets the value of global python variables that have been set previously from widget variables. I wondered if running across the network was somehow causing the session to drop and be reinitialized? And if so, if there is any way of using the session loop_forever concept when this is just a simple app, a single py file run from bokeh --serve.

Would be very grateful for any help and suggestions - this is for an app demo which could result in Bokeh being used for our research project across the team I am part of, if I can just fix this bug.

Best wishes

Cathy


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/e49c8854-2a02-4d17-9190-982d7ac9e3fe%40continuum.io.

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

PS here are the bokeh server console error logs

ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’
ERROR:bokeh.server.views.ws:received invalid integer in pong b’’
Traceback (most recent call last):
File “/home/cathyw/funwithmpld3/pyenvmpld3fun/lib/python3.5/site-packages/bokeh/server/views/ws.py”, line 165, in on_pong
self.latest_pong = int(codecs.decode(data, ‘utf-8’))
ValueError: invalid literal for int() with base 10: ‘’

Well that seems awfully strange and definitely like a bug. I'm glad the Select works for you as a workaround. Can you file a GH bug issue with this information?

Thanks,

Bryan

···

On Feb 12, 2016, at 1:06 PM, Catmo <[email protected]> wrote:

Hi Bryan

I have run some little test codes, and narrowed it down to a problem with AutocompleteInput rather than with global variables. When I replace the AutocompleteInput with a Select, everything works fine across the network. I attach 4 example codes, the Select versions work across the network as well locally, the versions with AutocompleteInput work locally but not across the network (i.e. on_change is never triggered, and even the direct examples do not successfully update the button label when the button is pressed.)

Best wishes

Cathy

On Friday, 12 February 2016 16:20:31 UTC, Catmo wrote:
Hi Bryan

Thanks for the reply - the timescale is much less, on the scale of a second or less.

So I guess it is probably not the session. It's very odd, run remotely I can't even get the value of the AutocompleteInput; but run locally (on a web browser) it is fine. I will try to write a small app which isolates the problem and post it.

Cheers

Cathy

On Friday, 12 February 2016 14:50:33 UTC, Bryan Van de ven wrote:
Hi,

On what time scale? In Bokeh 0.11 sessions were considered "unused" after 30 minutes:

        https://github.com/bokeh/bokeh/blob/0.11.0/bokeh/server/tornado.py#L93-L95

In Bokeh 0.11.1 this is made configurable via a command line option.

Bryan

> On Feb 12, 2016, at 6:33 AM, Catmo <[email protected]> wrote:
>
> Hi
>
> Really impressed with Bokeh plotting - thanks for making this framework available.
>
> I've just got one stupid bug. Bit of a strange one - and it may well be something I am doing wrong.
>
> I am using the January 2016 Bokeh release 0.11 with Python 3.5 on a linux (CentOS) server.
>
> I have a Bokeh app which works fine when I connect locally on the machine on which I run bokeh serve. But when I run across the network, (using the same browser, Firefox), it only partially works, and the problem seems to be that it forgets the value of global python variables that have been set previously from widget variables. I wondered if running across the network was somehow causing the session to drop and be reinitialized? And if so, if there is any way of using the session loop_forever concept when this is just a simple app, a single py file run from bokeh --serve.
>
> Would be very grateful for any help and suggestions - this is for an app demo which could result in Bokeh being used for our research project across the team I am part of, if I can just fix this bug.
>
> Best wishes
>
> Cathy
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e49c8854-2a02-4d17-9190-982d7ac9e3fe%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/062c677e-60b6-4326-ba9c-8bc9fc67500c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<autocomp_globvar.py><autocomp_globvar_sel.py><autocomp_prob.py><autocomp_prob_sel.py>