Server connection error with conda and jupyter lab

Viewed 4481

I am facing this issue since about 24h: I try to start jupyter lab via conda prompt and receive the error message: A connection to the Jupyter server could not be established. JupyterLab will continue trying to reconnect. Check your network connection or Jupyter server configuration. It worked earlier, however I have installed needed packages e.g. xarray, cartopy and their dependencies. Since then I cannot connect to the server anymore. Any ideas?

Many thanks!

(base) C:\Users\Judith Marina>jupyter lab [I 2021-12-15 10:16:58.336 ServerApp] jupyterlab | extension was successfully linked. [I 2021-12-15 10:16:58.753 ServerApp] nbclassic | extension was successfully linked. [I 2021-12-15 10:16:58.785 ServerApp] nbclassic | extension was successfully loaded. [I 2021-12-15 10:16:58.785 LabApp] JupyterLab extension loaded from C:\Users\Judith Marina\miniconda3\lib\site-packages\jupyterlab [I 2021-12-15 10:16:58.785 LabApp] JupyterLab application directory is C:\Users\Judith Marina\miniconda3\share\jupyter\lab [I 2021-12-15 10:16:58.800 ServerApp] jupyterlab | extension was successfully loaded. [I 2021-12-15 10:16:58.800 ServerApp] Serving notebooks from local directory: C:\Users\Judith Marina [I 2021-12-15 10:16:58.800 ServerApp] Jupyter Server 1.13.1 is running at: [I 2021-12-15 10:16:58.800 ServerApp] http://localhost:8888/lab?token=f35d2d2631a8bd064aa299fefb0ca4da0d60c940c351d5b1 [I 2021-12-15 10:16:58.800 ServerApp] or http://127.0.0.1:8888/lab?token=f35d2d2631a8bd064aa299fefb0ca4da0d60c940c351d5b1 [I 2021-12-15 10:16:58.800 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2021-12-15 10:16:58.837 ServerApp]

To access the server, open this file in a browser:
    file:///C:/Users/Judith%20Marina/AppData/Roaming/jupyter/runtime/jpserver-5216-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/lab?token=f35d2d2631a8bd064aa299fefb0ca4da0d60c940c351d5b1
 or http://127.0.0.1:8888/lab?token=f35d2d2631a8bd064aa299fefb0ca4da0d60c940c351d5b1

[I 2021-12-15 10:17:02.723 LabApp] Build is up to date [W 2021-12-15 10:17:04.374 ServerApp] Notebook phd/Data/Satellite_data/NorthSea_Storms/Generating_statistics_from_EO_data.ipynb is not trusted [I 2021-12-15 10:17:05.015 ServerApp] Kernel started: b2477d08-fc4c-4989-9907-675635cb706f [I 2021-12-15 10:17:05.019 ServerApp] Kernel started: d2370dfe-d3d9-4e6f-bd0f-1ff1a3addd11 [W 2021-12-15 10:17:06.208 ServerApp] Got events for closed stream <zmq.eventloop.zmqstream.ZMQStream object at 0x000001E010746760> Traceback (most recent call last): File "C:\Users\Judith Marina\miniconda3\Scripts\jupyter-lab-script.py", line 9, in sys.exit(main()) File "C:\Users\Judith Marina\miniconda3\lib\site-packages\jupyter_server\extension\application.py", line 577, in launch_instance serverapp.start() File "C:\Users\Judith Marina\miniconda3\lib\site-packages\jupyter_server\serverapp.py", line 2669, in start self.start_ioloop() File "C:\Users\Judith Marina\miniconda3\lib\site-packages\jupyter_server\serverapp.py", line 2655, in start_ioloop self.io_loop.start() File "C:\Users\Judith Marina\miniconda3\lib\site-packages\tornado\platform\asyncio.py", line 199, in start self.asyncio_loop.run_forever() File "C:\Users\Judith Marina\miniconda3\lib\asyncio\base_events.py", line 596, in run_forever self._run_once() File "C:\Users\Judith Marina\miniconda3\lib\asyncio\base_events.py", line 1875, in _run_once handle = self._ready.popleft() IndexError: pop from an empty deque [IPKernelApp] WARNING | Parent appears to have exited, shutting down. [IPKernelApp] WARNING | Parent appears to have exited, shutting down.

1 Answers

The same error popped up after creating a new conda environment and running jupyter-lab for the second time.

Again as mentioned in dukeelo's comment above jupyter-notebook ran fine. I did not try the browser link to jupyter-lab.

Since it was jupyter-lab specific I looked into the ~/.jupyter folder for recently updated files:

cd ~/.jupyter/lab/workspaces (ccdev)
curt@asimov:~/.jupyter/lab/workspaces$ ls -lh total 12K
-rw-rw-r-- 1 curt curt 734 Mar  2 20:31 auto-f-ff01.jupyterlab-workspace
-rw-rw-r-- 1 curt curt 449 Feb  8 19:15 auto-i-81a0.jupyterlab-workspace
-rw-rw-r-- 1 curt curt 685 Mar 15 19:08 default-37a8.jupyterlab-workspace

and deleting the recent 'default-37a8.jupyterlab-workspace' file seemed to fix the server error.

How the 'default-......' got corrupted in the first place, I do not know. Possiblly due to running jupyter-lab in one environment and then running in another?

Related