Kubeflow: Notebook server stuck on loading - jupyter-notebook

Whenever I try to create a Kubeflow notebook server to build a pipeline from a jupyter notebook, it keeps loading forever without displaying any error.
I'm currently using a Kubeflow dashboard that's already up and running on a server, so I didn't deploy it myself and I'm not working on a local instance to use the terminal.
Any idea what the origin of the problem might be and how to solve it?
Here's a screenshot that might explain better.

Related

problem with kernel creation in vscode while connected to remote jupyter server?

I am trying to connect to remote jupyter server which is running in remote server inside a docker. from vs code (local machine) with the help of jupyter extension, and running a newly created notebook.
The problem seems to be the kernel creation via this method for this newly created notebook.
My Jupyter Server is running in remote server, inside a docker environment, with port forwarding enable.
I can access it via my browser by http://{remote_machine_ip}:{port}/, and I am able to create new jupyter notebook.
However when I use the vs code to open local notebook file, and connect to the remote jupyter server.
When I try to run the cells, it shows the following error:
Failed to start the Kernel.
'_xsrf' argument missing from POST.
View Jupyter log for further details.
Possible solution
However, if I try to open a new kernel in browser, and connect it to same kernel in vs code, the problem goes away.
This issue seems to be arising when vs code sends the request to create jupyter kernel to the jupyter server.
As, when I tested with already running jupyter kernel in vs code, it works fine.
The issue here is, security implementation of jupyter server, which don't allow cross site request to create a kernel, as it security vulnerability.
For more details about _xsrf token, you can read here, although it doesn't talk about specific to jupyter server, its very easy to deduce the logic.
In one post of jetbrains, I found the solution, to make jupyter ignore _xsrf token, by adding new flag while starting the jupyter server,
--NotebookApp.disable_check_xsrf=True
Or add it to your notebook config.
Also, to make sure your request are not been blocked, as suggested by vscode blog. Add the following flag too,
--NotebookApp.allow_origin='*'

VScode showing raw source code instead of the remote jupyer notebook

I'm a bit puzzled of what goes wrong, and maybe someone here knows, or has had it before.
First, i got Docker on windows 11.
It runs a ubuntu python container, for all kind of AI stuff.
My local windows PC, has Vscode, i've made a connection to the local container (ssh).
When i open a .ipynb I see the raw file a Json like structure.
That is a bit strange because if i create a new ipynb on windows 11
Its is showing code/markdown cells normally like how vscode shows it normally.
VScode should know what Jupiter notebooks are
So Vscode knows python, everything seems installed in relation to jupyter and remote (localhost) connections.
Does anyone know perhaps what is going wrong here?.
Maybe its something i overlooked, missed.
Or some extra step that needs to be done at VScode, or i open it wrongly ?.
I open the file through the left pane open.. as shown:
I believe all related jupyter notebook stuff is installed in VScode
PS C:\python projects\test> code --list-extensions --show-versions
btwiuse.vscode-remote-server#0.0.5
colinfang.my-nbpreviewer#1.2.2
GitHub.copilot#1.56.7152
jithurjacob.nbpreviewer#1.2.2
ms-azuretools.vscode-docker#1.22.2
ms-dotnettools.csharp#1.25.0
ms-python.python#2022.16.1
ms-python.vscode-pylance#2022.10.40
ms-toolsai.jupyter#2022.9.1202862440
ms-toolsai.jupyter-keymap#1.0.0
ms-toolsai.jupyter-renderers#1.0.10
ms-toolsai.vscode-jupyter-cell-tags#0.1.6
ms-toolsai.vscode-jupyter-powertoys#0.0.6
ms-toolsai.vscode-jupyter-slideshow#0.1.5
ms-vscode-remote.remote-containers#0.255.4
ms-vscode-remote.remote-ssh#0.90.1
ms-vscode-remote.remote-ssh-edit#0.84.0
samghelms.jupyter-notebook-vscode#0.0.2

ERR_HTTP2_PROTOCOL_ERROR when opening Notebook in JUPYTERLAB Azure ML Studio

So our team created a new Azure Machine Learning resource, but whenever I try to add a new notebook and try to edit it using "JUPYTERLAB" i get ERR_HTTP2_PROTOCOL_ERROR error, but the same notebook, when edited using EDIT IN JUPYTER works perfectly.
This is a blank and clean notebook, I also tried 2 different laptops and multiple browsers per laptop, same error. I also tried incognito and clearing cookies, but to no avail.
update: I seem to have accidentally replicated the issue and I now know what is causing it, the situation is that Im using my work laptop and constantly switching VPN connections, and some times, connecting to the AZURE PORTAl OUTSIDE the VPN. So, when you've worked on a notebook while inside a VPN, then you disconnected, and tried loading the notebook sometime later, you will encounter this
Have you tried creating a new Azure Machine Learning Compute Instance? Sometimes the VM has a fatal issue and a new one needs to be spun up.
Also try modifying the working Jupyter Notebook url by adding /lab to the end.
This problem has stomped me for hours, but I was finally able to fix it. What I did was I opened a terminal and did a Jupyter lab rebuild "jupyter lab build"

How to activate a debugger or access logs in Jupyter notebooks?

I am trying to run a R notebook on Microsoft's Azure notebooks cloud service.
When I am trying to run all cells, it displays a Loading required package: ggplot2 in the last cell and then the Kernel systematically crashes. I get:
The kernel appears to have died. It will restart automatically.
But the Kernel does not restart automatically.
How can I get a log describing the encountered issue? Is there a way to activate a debugger?
When you're running Jupyter usually you'll see messages about kernel issues in standard I/O of the console that you launch. In Azure Notebooks this gets redirected to a file at ~/.nb.log. You can open a new terminal by clicking on the Jupyter icon, and then doing New->Terminal, and doing cat ~/.nb.log. You could also start a new Python notebook for this purpose and do "!cat ~/.nb.log" - but unfortunately you can't just do that from an R notebook, they don't support the "magic" ! commands.
Usually that gives you a good starting point. If that doesn't help much you could try invoking R directly from the terminal and trying the repro steps there and see if that's more useful.

ShinyApp : Connection Reset By Peer

The shinyapp I built earlier was running fine in my old laptop. Recently I got a new laptop with Windows10. After setting up everything, I tried to run the app but it the browser opens and closes immediately with the error :
Listening on http://127.0.0.1:5004
ERROR: [on_request_read] connection reset by peer
I have also set chrome as default browser....
I deployed this app in shinyapps.io it is working fine there.
I tried few more simple apps in Rstudio but the same issue coming. Looks like the issue is more related to some setting in Windows10. Can someone help me please.
Thanks in Advance.....
Without details on the specific code, I'd share my personal experience with the same error for your reference. In my case, I used RStudio to create a shiny app that save data to a local directory on my computer, while I told R to output files to directory "response", I hadn't created such directory under the working directory so came the error. Simply creating the sub directory named "response" solve this right away. Or for moving your project files to different places in the future, you can just check whether the folder exists, if not, create one shall save you a lot of time.

Resources