Open gaow opened 1 month ago
Seems like we are not alone here:
https://github.com/IRkernel/IRkernel/issues/583#issuecomment-1511529596
Once we run IRkernel::installspec()
in a terminal R session. The issue seems to be fixed.
Sounds good, then is just running IRkernel::installspec()
enough to consider this resolved?
it is best that it dont happened...since it never happened to me in the past couple years when I used irkernel extensively
Is there some env variable in R that can help set a library path? Even if it did work on your local computer, the method to install r kernels is different in this setup
I didnt run anything on my local computer. I run the install::IRkernel in the terminal of the cloud. Also I dont think this is a library path problem.
No as in, the "past couple of years" when you used ikernel, I assumed this previous experience was done in your local machine, which is why this wasn't a problem for you before.
As for me, I have no experience with jupyter and R libraries compared to you, but a suggested solution is here: https://github.com/IRkernel/IRkernel/issues/583#issuecomment-461838492
It looks like on your container, R is installed under /home/ubuntu/.pixi/bin/R
but ir
is installed under /home/ubuntu/.local/share/jupyter/kernels/ir
? Would this be an issue?
No as in, the "past couple of years" when you used ikernel, I assumed this previous experience was done in your local machine, which is why this wasn't a problem for you before.
No I mean use IRkernel in a cloud enviorment such as HPC and ours.
And in that HPC setup, you used the same pixi-mamba.sh
script to install? Because the script has gone through some changes in the past week or so
What bug me the most is that, it works for a good hours and such, but then suddenly it doesnt work anymore, with no migration .etc going on. Asking people to ready to re add the kernelspec by running IRkernel::installspec()
doesnt seems to be a good long run solution.
When you say "suddenly it doesnt work anymore," can you be more specific? Does the job error out, does the kernel die, or both? And when you say "suddenly it doesnt work anymore," the IRkernel WAS working, but then it didn't?
It means 20 min after I open up a notebook "A" and connect to the irkernel successfully. I opened another notebook "B" and it dont connect, then I create a new notebook "C" and it dont connect. Lastly, I disconnect the kernel from "A" and try to reconnect and it still fails.
In all three cases it give the same error msg in the stderr file as I posted.
To further investigate, I would look into implementation details of IRkernel::installspec()
see what it actually do, and figure out the line that mattered.
Going off this source: https://github.com/IRkernel/IRkernel, it allows Jupyter to see see the newly installed R kernel by installing a kernel spec for the current user.
Calling it creates a kernel.json
file that Jupyter uses to recognize and interact with the R kernel. We can see it here
ubuntu@71ca067433ac:/data/interactive_analysis/hs3163/GIT/xqtl-paper/AD_targets/BIN1$ cat /home/ubuntu/.local/share/jupyter/kernels/ir/kernel.json
{
"argv": ["/home/ubuntu/.pixi/envs/r-base/lib/R/bin/R", "--slave", "-e", "IRkernel::main()", "--args", "{connection_file}"],
"display_name": "R",
"language": "R"
}
However, if there are multiple versions of R installed, the installspec() command might choose the wrong R version to run with Jupyter?
Is this R kernel here not the one we are looking for, or not exactly?
It turns out this is an issue specific to when the main kernel used is sos
kernel. If we start the notebook with a pure R notebook it seems to always work.
This is also not a unique issue to MMCloud. On HPC our Jupyter Lab is 3.* for most people but when upgraded to also 4.0 as on MMC currently, this issue also occurs.
My theory for now is that sos
kernel does not play well with Jupyter Lab 4.0 due to a lack of careful maintenance.
@Ashley-Tung since this is not a direct MMC issue, let's leave the issue for now, as long as people are doing well on a pure R kernel notebook? We will report if it also create issues on R kernel notebooks.
Sounds good, thanks for letting me know
To clarify, though, for me, the problem occurs in a pure R notebook. But not a SOS notebook. Next time this happened, I will try to connect to SOS and then reconnect to see if that works.
From one of our users:
I was having a new error never saw before in https://44.222.241.133/#/opcenter/jobs/s6xcnt1jw0dscgzfqapdh. Enssentially I cannot connect to R kernel in notebook but was able to connect like half an hour ago. In the stderr file. it said there is no IRkernel package but it was installed alright.