You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Panel Server running on following versions:
Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]
Panel: 0.14.0
Bokeh: 2.4.2
Param: 1.12.1
Description of expected behavior and the observed behavior
Version 0.14.0 claims than passing admin=True into the pn.serve function should work exactly like the command line panel serve --admin.
However after starting python main.py and accessing any dashboard served
I have "0 active session" shown in the Admin Overview tab when accessing any dashboard (although I can see the session in the Admin Logs tab, see further)
I get the following error upon accessing for the first time the "admin" page: WARNING:bokeh.core.validation.check:W-1002 (EMPTY_LAYOUT): Layout has no children: Row(id='17416', ...)
I get an error in the terminal upon accessing for the first time the dashboard (see below)
I get an error in the terminal upon clicking on one of the row within the Admin Logs (see also below)
Complete, minimal, self-contained example code that reproduces the issue
Here below is saved under a main.py
Due to #3970 , I had to add a self-made index.html which is not in this MVE.
You can copy the 0.13.1index.html in the same folder as main.py and rename it index_mvp_panel014.html
importparamimportpanelaspnimportnumpyasnpimportholoviewsashvpn.extension(sizing_mode="stretch_width")
classMeta_Dashboard(param.Parameterized):
site="MVP Panel 0.14 with admin"title="abstract"defmake_panel(self):
""" Abstract function. Must be defined in children classes """pass@classmethoddefinstantiate_new_dashboard(cls):
dashboard_instance=cls()
returndashboard_instance.make_panel()
classRandom_Number_Generator(Meta_Dashboard):
title="Random_Number_Generator"defmake_panel(self):
defgenerate_random_number(event=None):
static_text.value=np.random.randint(low=100000, high=200000)
deftoggle_periodic_callback(event):
ifevent.newisTrue:
periodic_cb.start()
periodic_toggle.name="STOP Periodic Generation"else:
periodic_cb.stop()
periodic_toggle.name="START Periodic Generation"defupdate_period(event):
periodic_cb.period=event.newstatic_text=pn.widgets.StaticText(name='Periodic Random Number Generator',
value='000000')
generate_button=pn.widgets.Button(name='GENERATE New Number')
generate_button.on_click(generate_random_number)
periodic_toggle=pn.widgets.Toggle(name='START Periodic Generation',
value=False, button_type='primary')
periodic_toggle.param.watch(toggle_periodic_callback, 'value')
period=pn.widgets.Spinner(name="Period (ms)", value=500, step=50, start=50)
period.param.watch(update_period, 'value')
periodic_cb=pn.state.add_periodic_callback(
generate_random_number, period=period.value, start=False)
col=pn.Column(generate_button, period, periodic_toggle, static_text)
dashboard=pn.template.FastListTemplate(
site=self.site,
title=self.title,
base_url='localhost',
main=[
"This example creates a **random number generator** that updates periodically or with the click of a button.\n\nThis demonstrates how to add a **periodic callback** and how to link a button and a toggle to a couple of callbacks.",
col,
], main_max_width="768px",
)
returndashboardclassDistribution_Tabs(Meta_Dashboard):
title="Distribution_Tabs"defmake_panel(self):
distributions= {
'NORMAL': np.random.normal,
'UNIFORM': np.random.uniform,
'LOG-NORMAL': np.random.lognormal,
'EXPONENTIAL': np.random.exponential
}
checkboxes=pn.widgets.ToggleGroup(options=distributions, behavior='radio', button_type="success")
slider=pn.widgets.IntSlider(name='Number of observations', value=500, start=0, end=2000)
@pn.depends(checkboxes.param.value, slider.param.value)deftabs(distribution, n):
values=hv.Dataset(distribution(size=n), 'values')
returnpn.Tabs(
('Plot', values.hist(adjoin=False).opts(
responsive=True, max_height=500, padding=0.1, color="#00aa41")),
('Summary', values.dframe().describe().T),
('Table', hv.Table(values)),
)
selections=pn.Column('### Distribution Type', checkboxes, slider)
returnpn.template.BootstrapTemplate(site=self.site,
title=self.title,
base_url='localhost',
main=["This example demonstrates **how to plot several different types of outputs in a Tab**.",
selections,
tabs])
if__name__=='__main__':
frompathlibimportPathindex_html=str(Path('.').absolute()/'index_mvp_panel014.html')
pn.serve({
Random_Number_Generator.title: Random_Number_Generator.instantiate_new_dashboard,
Distribution_Tabs.title: Distribution_Tabs.instantiate_new_dashboard,
},
show=False,
port=8082,
autoreload=True,
websocket_origin=['localhost:8082',
],
admin=True,
index=index_html,
)
ERROR:tornado.application:Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x00000274CB87CD60>>, <Task finished name='Task-2657' coro=<_needs_document_lock.<locals>._needs_document_lock_wrapper() done, defined at C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py:77> exception=ValueError("'Session 2700658953424 launching' is not in list")>)
Traceback (most recent call last):
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\tornado\ioloop.py", line 741, in _run_callback
ret = callback()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\tornado\ioloop.py", line 765, in _discard_future_result
future.result()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py", line 93, in _needs_document_lock_wrapper
result = func(self, *args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py", line 227, in with_document_locked
return func(*args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 450, in wrapper
return invoke_with_curdoc(doc, invoke)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 408, in invoke_with_curdoc
return f()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 449, in invoke
return f(*args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 179, in remove_then_invoke
return callback()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\io\admin.py", line 219, in update_cds
index = cds.data['msg'].index(LOG_SESSION_LAUNCHING % sid)
ValueError: 'Session 2700658953424 launching' is not in list
ERROR:tornado.application:Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x00000274CB87CD60>>, <Task finished name='Task-2656' coro=<_needs_document_lock.<locals>._needs_document_lock_wrapper() done, defined at C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py:77> exception=ValueError("'Session 2700658953424 launching' is not in list")>)
Traceback (most recent call last):
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\tornado\ioloop.py", line 741, in _run_callback
ret = callback()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\tornado\ioloop.py", line 765, in _discard_future_result
future.result()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py", line 93, in _needs_document_lock_wrapper
result = func(self, *args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py", line 227, in with_document_locked
return func(*args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 450, in wrapper
return invoke_with_curdoc(doc, invoke)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 408, in invoke_with_curdoc
return f()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 449, in invoke
return f(*args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 179, in remove_then_invoke
return callback()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\io\admin.py", line 219, in update_cds
index = cds.data['msg'].index(LOG_SESSION_LAUNCHING % sid)
ValueError: 'Session 2700658953424 launching' is not in list
Error in the terminal upon clicking on one of the rows within the Admin Logs tab (in this example the second row, Key 1):
ERROR:bokeh.server.protocol_handler:error handling message
message: Message 'PATCH-DOC' content: {'events': [{'kind': 'MessageSent', 'msg_type': 'bokeh_event', 'msg_data': {'event_name': 'cell-click', 'event_values': {'column': 'message', 'row': 1}}}], 'references': []}
error: KeyError(1)
Traceback (most recent call last):
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\protocol_handler.py", line 97, in handle
work = await handler(message, connection)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py", line 93, in _needs_document_lock_wrapper
result = func(self, *args, **kwargs)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\server\session.py", line 287, in _handle_patch
message.apply_to_document(self.document, self)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\protocol\messages\patch_doc.py", line 115, in apply_to_document
invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.content, setter))
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 408, in invoke_with_curdoc
return f()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\protocol\messages\patch_doc.py", line 115, in <lambda>
invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.content, setter))
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\document.py", line 391, in apply_json_patch
DocumentPatchedEvent.handle_json(self, event_json, references, setter)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\events.py", line 259, in handle_json
handler(doc, event_json, references, setter)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\events.py", line 300, in _handle_json
cb(event_json["msg_data"])
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 355, in trigger_json_event
model._trigger_event(event)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\util\callback_manager.py", line 119, in _trigger_event
self.document.callbacks.notify_event(cast(Model, self), event, invoke)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 247, in notify_event
invoke_with_curdoc(doc, callback_invoker)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\document\callbacks.py", line 408, in invoke_with_curdoc
return f()
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\bokeh\util\callback_manager.py", line 115, in invoke
cast(EventCallbackWithEvent, callback)(event)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\reactive.py", line 428, in _server_event
self._comm_event(doc, event)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\reactive.py", line 415, in _comm_event
state._handle_exception(e)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\io\state.py", line 391, in _handle_exception
raise exception
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\reactive.py", line 413, in _comm_event
self._process_bokeh_event(doc, event)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\reactive.py", line 350, in _process_bokeh_event
self._process_event(event)
File "C:\Users\hy.amanieu\Anaconda3\envs\youpi\lib\site-packages\panel\widgets\tables.py", line 1158, in _process_event
idx = self._index_mapping[event.row]
KeyError: 1
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered:
ALL software version info
Panel Server running on following versions:
Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]
Panel: 0.14.0
Bokeh: 2.4.2
Param: 1.12.1
Description of expected behavior and the observed behavior
Version 0.14.0 claims than passing
admin=True
into thepn.serve
function should work exactly like the command linepanel serve --admin
.However after starting
python main.py
and accessing any dashboard servedWARNING:bokeh.core.validation.check:W-1002 (EMPTY_LAYOUT): Layout has no children: Row(id='17416', ...)
Complete, minimal, self-contained example code that reproduces the issue
Here below is saved under a
main.py
Due to #3970 , I had to add a self-made index.html which is not in this MVE.
You can copy the
0.13.1
index.html
in the same folder asmain.py
and rename itindex_mvp_panel014.html
Stack traceback and/or browser JavaScript console output
Logs from the terminal upon starting a dashboard
Admin Logs copied from the generated CSV:
Error in the terminal upon clicking on one of the rows within the Admin Logs tab (in this example the second row, Key 1):
Screenshots or screencasts of the bug in action
The text was updated successfully, but these errors were encountered: