Server connection error with conda and jupyter lab
Asked Answered
D

3

5

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.

Depress answered 15/12, 2021 at 9:31 Comment(5)
It is solved; after updating everything and removing netcfd4 package, however I still do not know the error source yet.Depress
I got the same error a few days ago. I don't have netcfd4. As for you, it worked again after updating everything but now the error is back and I have no idea what to try based on the error message.Kerrikerrie
You could check if you have cfgrib installed and remove it in case you don't use it. However, this is just try and error experience :)Depress
Thank you, that was not installed. However I noticed that I could start jupyter notebook without issues and than change to jupyter lab using the browser link. I'm not aware of any updates since yesterday but now starting directly with jupyter lab works normal as well.Kerrikerrie
I am having the same issue. Just started.Nihhi
C
5

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?

Controller answered 16/3, 2022 at 0:28 Comment(2)
What browser link to Jupyter Lab? I don't see that when I start a Jupyter notebook.Nihhi
See the following link for an example: Starting the Notebook ServerController
D
2

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

Dielle answered 30/9, 2022 at 11:11 Comment(0)
N
1

I updated Anaconda using the following command:

conda update --all --no-pin --no-channel-priority

After that, I restarted Anaconda, and Jupyter Lab now had a button "Install" underneath it, not "Launch". I clicked "Install", then "Launch" after the installation had finished, and the server connection prompt seems to be gone for now.

Nihhi answered 12/7, 2023 at 11:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.