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

Can't stop jupyter lab with jupyter lab stop when having cert file. #953

Closed
krassowski opened this issue Aug 25, 2022 · 0 comments · Fixed by #959
Closed

Can't stop jupyter lab with jupyter lab stop when having cert file. #953

krassowski opened this issue Aug 25, 2022 · 0 comments · Fixed by #959
Labels

Comments

@krassowski
Copy link
Collaborator

Manually migrated from jupyterlab/jupyterlab#12980 - during the triage meeting we though that this is most likely a server issue. CC @tjc0726

Description

can't stop jupyter lab with jupyter lab stop when having cert file.

Reproduce

edit /home/USERNAME/.jupyter/jupyter_notebook_config.py with:

c.NotebookApp.certfile = '//fullchain.pem'
c.NotebookApp.keyfile = '/
/privkey.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 9999

then

nohup jupyter lab &

then jupyter lab stop

it'll fail with

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'localhost'. (_ssl.c:997)

Context

  • Operating System and version: Ubuntu 22.04.1
  • JupyterLab version: 3.4.4
Command Line Output
ubuntu@VM-4-8-ubuntu:~$ jupyter lab stop
Shutting down server on 8888...
SSL Error on 9 ('127.0.0.1', 8888): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'localhost'. (_ssl.c:997)
Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/jupyter-lab", line 8, in 
    sys.exit(main())
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/extension/application.py", line 594, in launch_instance
    serverapp.start()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 2814, in start
    self.start_app()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 2710, in start_app
    super().start()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_core/application.py", line 258, in start
    self.subapp.start()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 608, in start
    self._shutdown_or_exit(port, server)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 583, in _shutdown_or_exit
    if not self.shutdown_server(server):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 579, in shutdown_server
    return shutdown_server(server, log=self.log)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 516, in shutdown_server
    raise ex
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 508, in shutdown_server
    fetch(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/jupyter_server/utils.py", line 352, in fetch
    response = HTTPClient(AsyncHTTPClient).fetch(request)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/tornado/httpclient.py", line 134, in fetch
    response = self._io_loop.run_sync(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/tornado/ioloop.py", line 529, in run_sync
    return future_cell[0].result()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/tornado/simple_httpclient.py", line 340, in run
    stream = await self.tcp_client.connect(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/tornado/tcpclient.py", line 288, in connect
    stream = await stream.start_tls(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/tornado/iostream.py", line 1389, in _do_ssl_handshake
    self.socket.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1341, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'localhost'. (_ssl.c:997)

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

Successfully merging a pull request may close this issue.

1 participant