question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google Colab notebook using IJava stuck at "Connecting" after installation + page reload

See original GitHub issue

All of my notebooks with the IJava kernel that worked before now are stuck at “Connecting” after the initial IJava installation and browser page refresh.

What was working previously / expected behavior

  1. Execute this first cell
!wget https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip 
!unzip ijava-1.3.0.zip 
!python install.py --sys-prefix
  1. Wait for the Installed java kernel message

  2. Refresh the browser page.

  3. Execute any cell with Java code and see the output.

Now what happens is

I can execute the first cell and get the Installed java kernel message, seeing the notebook status as “Connected”.

But after refreshing the page, the status of the notebook is stuck at “Connecting” forever,

and thus no cells with Java code can be executed.

I’m using Google Colab for free, but since the initial installation still works, and the notebook status is “Connected” before the page is refreshed, I assume not being a paid subscriber should not be the problem.

Any idea what has been changed, and how I can get my Java notebooks to connect again?

Example https://colab.research.google.com/github/vistec-AI/colab/blob/master/ijava.ipynb

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
SpencerParkcommented, Dec 9, 2022

Hello, author of that kernel here 😃 found my way over from the stack overflow question.

I was taking a peek into what is going on but I’m not too familiar with the colab infrastructure. Though I can verify that I can use the kernel within that workbook linked in that top comment, but cannot change the kernel type in colab. What I mean by that is I can run the following in a cell:

!jupyter console --kernel=java --simple-prompt

and the kernel starts up properly, jupyter client can connect, and I can execute code in that kernel.

Dec 09, 2022 7:40:21 AM io.github.spencerpark.jupyter.channels.Loop start
INFO: Loop starting...
Dec 09, 2022 7:40:21 AM io.github.spencerpark.jupyter.channels.Loop start
INFO: Loop started.
Dec 09, 2022 7:40:21 AM io.github.spencerpark.jupyter.channels.Loop start
INFO: Loop starting...
Dec 09, 2022 7:40:21 AM io.github.spencerpark.jupyter.channels.Loop start
INFO: Loop started.
Dec 09, 2022 7:40:21 AM io.github.spencerpark.jupyter.channels.Loop start
INFO: Loop starting...
Dec 09, 2022 7:40:21 AM io.github.spencerpark.jupyter.channels.Loop start
INFO: Loop started.
Jupyter console 6.1.0

Java 11.0.17+8-post-Ubuntu-1ubuntu218.04 :: IJava kernel 1.3.0 
Protocol v5.3 implementation by jupyter-jvm-basekernel 2.3.0
In [1]: System.out.println("test");
test

So there doesn’t seem to be an issue with starting the kernel in the container via jupyter but for whatever reason via colab has trouble connecting to it.

Also tried switching via getKernel().runtimeManager.changeKernelType('<session-id>', 'java') and saw the same successful startup logs in /var/colab/app.log:

Timestamp Level Message
Dec 9, 2022, 2:55:23 AM WARNING INFO: Loop started.
Dec 9, 2022, 2:55:23 AM WARNING Dec 09, 2022 7:55:23 AM io.github.spencerpark.jupyter.channels.Loop start
Dec 9, 2022, 2:55:23 AM WARNING INFO: Loop starting...
Dec 9, 2022, 2:55:23 AM WARNING Dec 09, 2022 7:55:23 AM io.github.spencerpark.jupyter.channels.Loop start
Dec 9, 2022, 2:55:23 AM WARNING INFO: Loop started.
Dec 9, 2022, 2:55:23 AM WARNING Dec 09, 2022 7:55:23 AM io.github.spencerpark.jupyter.channels.Loop start
Dec 9, 2022, 2:55:23 AM WARNING INFO: Loop starting...
Dec 9, 2022, 2:55:23 AM WARNING Dec 09, 2022 7:55:23 AM io.github.spencerpark.jupyter.channels.Loop start
Dec 9, 2022, 2:55:23 AM WARNING INFO: Loop started.
Dec 9, 2022, 2:55:23 AM WARNING Dec 09, 2022 7:55:23 AM io.github.spencerpark.jupyter.channels.Loop start
Dec 9, 2022, 2:55:23 AM WARNING INFO: Loop starting...
Dec 9, 2022, 2:55:23 AM WARNING Dec 09, 2022 7:55:23 AM io.github.spencerpark.jupyter.channels.Loop start
Dec 9, 2022, 2:55:22 AM INFO Kernel shutdown: 25522ba0-5629-428b-a3a6-29827234a5d0
Dec 9, 2022, 2:55:22 AM INFO Kernel started: 495f9ece-6927-4283-884f-ffc29915f72c

There are no errors and I do see the kernel connection file exists at /root/.local/share/jupyter/runtime/kernel-495f9ece-6927-4283-884f-ffc29915f72c.json so I presume it is still running. Note that 25522ba0-5629-428b-a3a6-29827234a5d0 is the id for the default python3 kernel that got created, and in the logs it shows that as shutting down when switching to the java kernel.

Don’t know if there is much else I can do to debug further on my end but happy to try anything if it will help!

0reactions
thomerscommented, Dec 15, 2022

@cperry-goog and @craigcitro , any feedback or news from your side regarding

_Do you know if this was another change in configuration on your side that rolled out with the 3.8 changes?

And is there something we could specify in the kernel metadata to say that a specific kernel prefers tpc as the transport?_

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Colab notebook using IJava stuck at "Connecting ...
All of my notebooks stopped connecting, after the initial IJava installation and browser page refresh. What used to work. Execute this first ...
Read more >
How to prevent Google Colab from disconnecting - Medium
Then goto console. It would keep on clicking the page and prevent it from disconnecting. It solved the issue for me. ERRORS :...
Read more >
Fix file download errors - Google Chrome Help
If you try to download a file and it doesn't work, try to fix the error with these troubleshooting steps: Make sure that...
Read more >
CodeRefinery workshop May 10-12 and 18-20 (2021)
https://colab.research.google.com/ is also a good place to use jupyter ... When you add a image to a jupyter notebook, does it need to...
Read more >
Your XAML Solutions for most common issues (WIKI POST ...
"Restart" a job from job list in Orchestrator ... Issue while taking screenshot on VM when Window is locked. Job State stuck at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found