Run Jupyter Notebook in Ubuntu 18.04 Gen2 failed with "https" instead of "http"

Kathy Morimoto 1 Reputation point
2021-05-24T01:44:13.79+00:00

Do you know why Jupyter notebook gets launched in "https" instead of "http"?
I just normally created a VM with Ubuntu 18.04 Gen2 and run below commands for Jupyter Notebook, but unfortunately, it's launched in "https" so that it will not work with http://127.0.0.1:8891. Do you now how I can fix/modify to run it in "http"?

It was successful for Jupyter Notebook to be launched with "http" when I created the VM first time.

Then I needed to switch the VM to a new one, so I re-create it again, then Jupyter Notebook gets always launched with "https" instead of "http".

Is there anyone who has the same experiences?


In my local:

bash-3.2$ ssh -i ~/.ssh/newdata558_key.pem -N -f -L localhost:8891:localhost:8891 azureuser@52.142.10.125 (Links to an external site.)

In VM:

azureuser@newdata558:~$ jupyter notebook --no-browser --port=8891 --ip=0.0.0.0

Problems:

https://127.0.0.1:8891 (Links to an external site.) instead of http://127.0.0.1:8891


Logs below:

[W 2021-05-24 00:33:59.342 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.

[W 2021-05-24 00:33:59.342 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.

[W 2021-05-24 00:33:59.342 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.

[W 2021-05-24 00:33:59.342 LabApp] 'certfile' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.

[W 2021-05-24 00:33:59.342 LabApp] 'keyfile' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.

[W 2021-05-24 00:33:59.342 LabApp] 'keyfile' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.

[I 2021-05-24 00:33:59.352 LabApp] JupyterLab extension loaded from /anaconda/envs/py38_default/lib/python3.8/site-packages/jupyterlab

[I 2021-05-24 00:33:59.352 LabApp] JupyterLab application directory is /anaconda/envs/py38_default/share/jupyter/lab

[I 00:33:59.357 NotebookApp] Serving notebooks from local directory: /home/azureuser

[I 00:33:59.357 NotebookApp] Jupyter Notebook 6.3.0 is running at:

[I 00:33:59.357 NotebookApp] https://newdata558:8891/?token=65e9b94ce1dd96c4ab18ab7231b36f610818e03bf5c5e060

[I 00:33:59.357 NotebookApp] or https://127.0.0.1:8891/?token=65e9b94ce1dd96c4ab18ab7231b36f610818e03bf5c5e060

[I 00:33:59.357 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

[C 00:33:59.361 NotebookApp]

To access the notebook, open this file in a browser:

    file:///home/azureuser/.local/share/jupyter/runtime/nbserver-23996-open.html

Or copy and paste one of these URLs:

    https://newdata558:8891/?token=65e9b94ce1dd96c4ab18ab7231b36f610818e03bf5c5e060

 or https://127.0.0.1:8891/?token=65e9b94ce1dd96c4ab18ab7231b36f610818e03bf5c5e060

[W 00:34:09.508 NotebookApp] SSL Error on 9 ('127.0.0.1', 50762): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1125)

Search entries or author
Search entries or author
Filter replies by unread
ReplyReply to Azure VM: Jupyter Notebook gets generated with "https" instead of "http"

Azure VMware Solution
Azure VMware Solution
An Azure service that runs native VMware workloads on Azure.
318 questions
Azure Data Science Virtual Machines
Azure Data Science Virtual Machines
Azure Virtual Machine images that are pre-installed, configured, and tested with several commonly used tools for data analytics, machine learning, and artificial intelligence training.
67 questions
{count} votes

1 answer

Sort by: Most helpful
  1. prmanhas-MSFT 17,891 Reputation points Microsoft Employee
    2021-05-24T10:08:13.32+00:00

    @Kathy Morimoto Thank you for your query!!!

    As mentioned here

    Every JupyterHub deployment should enable HTTPS!

    HTTPS encrypts traffic so that usernames, passwords and your data are communicated securely. sensitive bits of information are communicated securely. The Littlest JupyterHub supports automatically configuring HTTPS via Let’s Encrypt, or setting it up manually with your own TLS key and certificate. Unless you have a strong reason to use the manual method, you should use the Let’s Encrypt method.

    Also as mentioned here:

    To access JupyterHub from the public Internet, you must have port 8000 open.

    You can try to connect to Jupyter from port 8000 and check if it is working for you or not.

    A similar issue has been reported here and as per the proposed solution:

    you should connect Jupyter notebook from port 8000, not 9999.

    You can access the Jupyter notebook server from any host. Just type https://<VM DNS name or IP Address>:8000/

    As for https these might be the configuration at the time of VM creation.

    Other useful links are as below:

    https://jupyter-notebook.readthedocs.io/en/stable/public_server.html

    https://stackoverflow.com/questions/60909620/how-do-i-secure-my-jupyter-notebook-with-ssl-from-my-azure-data-science-virtual

    https://jupyter-notebook.readthedocs.io/en/stable/public_server.html

    Hope it helps!!!

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as convenient to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    0 comments No comments