Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError when opening server #75

Closed
MannyEsguerra opened this issue Feb 14, 2024 · 19 comments
Closed

AssertionError when opening server #75

MannyEsguerra opened this issue Feb 14, 2024 · 19 comments

Comments

@MannyEsguerra
Copy link

I am using latest GupPy. When I invoke the server, I get this error right away:

(guppy) D:\Packages\GuPPy-main\GuPPy>panel serve --show savingInputParameters.ipynb
2024-02-14 10:30:00,763 Starting Bokeh server version 2.4.3 (running on Tornado 6.2)
2024-02-14 10:30:00,763 User authentication hooks NOT provided (default user enabled)
2024-02-14 10:30:00,778 Bokeh app running at: http://localhost:5006/savingInputParameters
2024-02-14 10:30:00,778 Starting Bokeh server with process id: 10580
Folder path set to D:/Data/Spencer Lab/Hernandez_iGluSNFR
2024-02-14 10:30:08,846 Starting Bokeh server version 2.4.3 (running on Tornado 6.2)
2024-02-14 10:30:08,847 User authentication hooks NOT provided (default user enabled)
Launching server at http://localhost:49436
2024-02-14 10:30:08,853 Error running application handler <bokeh.application.handlers.notebook.NotebookHandler object at 0x000001AA276B3CD0>:
File 'windows_events.py', line 319, in run_forever:
assert self._self_reading_future is None Traceback (most recent call last):
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\application\handlers\code_runner.py", line 231, in run
    exec(self._code, module.__dict__)
  File "D:\Packages\GuPPy-main\GuPPy\savingInputParameters.ipynb", line 529, in <module>
    "template.main.append(visualize)\n",
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\viewable.py", line 424, in show
    return serve(
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\io\server.py", line 605, in serve
    return get_server(panels, **kwargs)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\io\server.py", line 835, in get_server
    server.io_loop.start()
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\tornado\platform\asyncio.py", line 215, in start
    self.asyncio_loop.run_forever()
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\asyncio\windows_events.py", line 319, in run_forever
    assert self._self_reading_future is None
AssertionError

What does this mean? It doesn't seem to affect program function. Thank you.

@venus-sherathiya
Copy link
Collaborator

Did you change anything in the conda environment ?

@MannyEsguerra
Copy link
Author

When this problem appeared, I deleted the old conda environment, built a new one, and reinstalled all the dependencies from scratch. What do you have in mind?

@venus-sherathiya
Copy link
Collaborator

You are on Ubuntu, right ?

@MannyEsguerra
Copy link
Author

MannyEsguerra commented Feb 14, 2024

Windows 10.

Maybe unrelated, one thing I've noticed in latest Windows build, the software sometimes looks for modules in the wrong directory, as if the path is Guppy-Main\Guppy\Guppy. I got around it by creating that second Guppy subdirectory and copying the files to it. Works, but probably a bad idea?

If you need more specifics I can try to re-create the issue.

@MannyEsguerra
Copy link
Author

I looked around the Bokeh forums and apparently this is error is known and harmless (?) behavior when using Panel, eg:

https://discourse.bokeh.org/t/permission-error-running-bokeh-server/10520/2

@venus-sherathiya
Copy link
Collaborator

venus-sherathiya commented Feb 15, 2024

Lets do one thing
Open Anaconda prompt window and execute the following commands one by one
conda remove --name guppy --all
conda clean --all

After this, follow the instructions from Github to create a new conda environment

For launching GuPPy, there are little changes in the step. Please look at the instructions on Github.
You do the following for launching GuPPy
conda activate guppy
cd path_to_guppy_main_folder
panel serve --show GuPPy/savingInputParameters.ipynb

Please let me know if it works or not

@MannyEsguerra
Copy link
Author

Still getting assertion error. But also after removing the environment and clearing variables, when I reinstall Guppy it still brings up previously used storenames. I've removed all Guppy generated files like output folders, parameters etc.

@venus-sherathiya
Copy link
Collaborator

GuPPy was running fine in this machine before ?

@MannyEsguerra
Copy link
Author

MannyEsguerra commented Feb 16, 2024 via email

@venus-sherathiya
Copy link
Collaborator

venus-sherathiya commented Feb 16, 2024

conda remove --name guppy --all
conda clean --all

These two commands will remove conda environment.
Fetch the most recent code from Github main branch. Reinstall conda environment. You do need to delete anything else
Please try launching GuPPy.
If it still does not work, I think we need to meet on a zoom and figure it out because I do not understand what's the issue here

@MannyEsguerra
Copy link
Author

MannyEsguerra commented Feb 16, 2024 via email

@venus-sherathiya
Copy link
Collaborator

venus-sherathiya commented Feb 16, 2024

Assertion error is happening because there is something wrong.

The line which says "User authentication hooks not provided", it is harmless.

Old storenames will populate even if you remove conda because it's independent of conda environement. If we figure this out, I will let you know how to get rid of it.

lets try one last thing
cd path_guppy_main_folder
conda update -n guppy --file spec_file_windows10.txt

Try this. This is the last thing we can try. Please let me know about it

Also, even with assertion error, GuPPy runs fine ?

@MannyEsguerra
Copy link
Author

MannyEsguerra commented Feb 16, 2024 via email

@MannyEsguerra
Copy link
Author

MannyEsguerra commented Feb 16, 2024

Adding: all analysis steps work through PSTH Computation. However when choosing Visualizaiton GUI, I am getting a similar error. The Visualization GUI tab still opens.

2024-02-16 13:29:28,357 Starting Bokeh server version 2.4.3 (running on Tornado 6.2)
2024-02-16 13:29:28,357 User authentication hooks NOT provided (default user enabled)
Launching server at http://localhost:5143
2024-02-16 13:29:28,360 error handling message
 message: Message 'PATCH-DOC' content: {'events': [{'kind': 'MessageSent', 'msg_type': 'bokeh_event', 'msg_data': {'event_name': 'button_click', 'event_values': {}}}], 'references': []}
 error: AssertionError()
Traceback (most recent call last):
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\server\protocol_handler.py", line 97, in handle
    work = await handler(message, connection)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\server\session.py", line 95, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\server\session.py", line 289, in _handle_patch
    message.apply_to_document(self.document, self)
  File "C:\Users\Windows\anaconda3\envs\guppy\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\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "C:\Users\Windows\anaconda3\envs\guppy\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\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\document.py", line 391, in apply_json_patch
    DocumentPatchedEvent.handle_json(self, event_json, references, setter)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\events.py", line 259, in handle_json
    handler(doc, event_json, references, setter)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\events.py", line 300, in _handle_json
    cb(event_json["msg_data"])
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\callbacks.py", line 355, in trigger_json_event
    model._trigger_event(event)
  File "C:\Users\Windows\anaconda3\envs\guppy\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\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\callbacks.py", line 247, in notify_event
    invoke_with_curdoc(doc, callback_invoker)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\document\callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\bokeh\util\callback_manager.py", line 115, in invoke
    cast(EventCallbackWithEvent, callback)(event)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\reactive.py", line 406, in _server_event
    self._comm_event(event)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\reactive.py", line 398, in _comm_event
    self._process_bokeh_event(event)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\reactive.py", line 345, in _process_bokeh_event
    self._process_event(event)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\widgets\button.py", line 176, in _process_event
    self.clicks += 1
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\parameterized.py", line 367, in _f
    instance_param.__set__(obj, val)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\parameterized.py", line 369, in _f
    return f(self, obj, val)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\__init__.py", line 625, in __set__
    super(Dynamic,self).__set__(obj,val)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\parameterized.py", line 369, in _f
    return f(self, obj, val)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\parameterized.py", line 1252, in __set__
    obj.param._call_watcher(watcher, event)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\parameterized.py", line 2043, in _call_watcher
    self_._execute_watcher(watcher, (event,))
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\param\parameterized.py", line 2025, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "D:\Packages\GuPPy-main\guppy\savinginputparameters.ipynb", line 445, in onclickVisualization
    "def onclickVisualization(event=None):\n",
  File "D:\Packages\GuPPy-main\guppy\visualizePlot.py", line 688, in visualizeResults
    createPlots(filepath, storesList[1,:], inputParameters)
  File "D:\Packages\GuPPy-main\guppy\visualizePlot.py", line 630, in createPlots
    helper_plots(filepath, event, name_arr, inputParameters)
  File "D:\Packages\GuPPy-main\guppy\visualizePlot.py", line 586, in helper_plots
    template.show(port=number)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\viewable.py", line 424, in show
    return serve(
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\io\server.py", line 605, in serve
    return get_server(panels, **kwargs)
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\panel\io\server.py", line 835, in get_server
    server.io_loop.start()
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\site-packages\tornado\platform\asyncio.py", line 215, in start
    self.asyncio_loop.run_forever()
  File "C:\Users\Windows\anaconda3\envs\guppy\lib\asyncio\windows_events.py", line 319, in run_forever
    assert self._self_reading_future is None
AssertionError
2024-02-16 13:29:39,683 WebSocket connection opened
2024-02-16 13:29:39,685 ServerConnection created

@venus-sherathiya
Copy link
Collaborator

Can you please send me your availability for next week ? Let us meet on zoom and figure it out.

@MannyEsguerra
Copy link
Author

Next week I could meet after 2pm on Tues 20, Weds 21, or Friday 23. Thank you.

@venus-sherathiya
Copy link
Collaborator

Can you please send me an email at venus.sherathiya@northwestern.edu ?

@venus-sherathiya
Copy link
Collaborator

Hello Manny,

Please get the updated code from GitHub and follow the instructions from the Github Wiki page. I hope this will solve the issue. Please let me know if it does not work out.

@MannyEsguerra
Copy link
Author

The server started without errors. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants