Skip to content

Jupyter Notebook cells don’t execute properly  #3199

Closed

Description

@gogobd

OS/Web Information

  • Web Browser: Brave
  • Local OS: macOS
  • Remote OS: docker on macoS
  • Remote Architecture: amd64
  • code-server --version: 3.9.3

Steps to Reproduce

  1. Click a .ipynb file

Expected

Jupyter Notebook should open, connect to a Kernel and cells should be ready to run

Actual

Even after a series of installations of plugins (that seem to work fine) the Notebook can connect to a kernel but no output is being received (all i see is "Loading...", then after some time I get the error shown in the screenshot "ChunkLoadError")

Screenshot

Screenshot 2021-04-23 at 20 50 21

Notes

This issue can be reproduced in VS Code: No idea.

Activity

  1. gogobd commented on Apr 26, 2021

    @gogobd
    Author

    I tried again, still no dice.

    This time I tried to installed (Mini-)conda environment into docker before getting and starting code server.

    1.) I click the .ipynb file, Code Server asks me if I want to search the Marketplace for support for ipnb files, I agree and install Jupyter v2021.3.0
    2.) I install Python v2021.4.765268190
    3.) I click the .ipynb file again and Code Server installs an ipython kernel
    4.) I can select the kernel and get no error message when I connect to it
    5.) I try to run a "print('Hello, world!')" cell and get the error message posted previously - after about a minute or so

  2. code-asher commented on Apr 26, 2021

    @code-asher
    Member

    Is that the only error you see in the browser console logs?

  3. gogobd commented on Apr 26, 2021

    @gogobd
    Author

    This error is seen in the editor, i didn’t look at the browsers console log

  4. code-asher commented on Apr 26, 2021

    @code-asher
    Member

    Oops my bad. Please post the browser console logs! The code-server logs may also be helpful although in this case probably not.

  5. gogobd commented on Apr 26, 2021

    @gogobd
    Author

    I was trying to provide the console logs when the bug just went away. I don't know why but it's not an issue any more. I'm closing this, sorry for the fuzz.

  6. gogobd commented on Apr 26, 2021

    @gogobd
    Author

    Ok; i was able to reproduce this here's the browser's console log:

    [Extension Host] Starting WebSocket: RAW/api/kernels/7d025fa9-1f07-48a9-aa46-6723eb7bc0b8
    
    [Extension Host] Kernel: connected (7d025fa9-1f07-48a9-aa46-6723eb7bc0b8)
    
    Starting WebSocket: BOGUS_PVSC/api/kernels/7d025fa9-1f07-48a9-aa46-6723eb7bc0b8
    
    Kernel: connected (7d025fa9-1f07-48a9-aa46-6723eb7bc0b8)
    
    [Extension Host] Starting WebSocket: RAW/api/kernels/f1d4f34b-d134-452e-bb8a-1ede6ecac9c5
    
    [Extension Host] Kernel: connected (f1d4f34b-d134-452e-bb8a-1ede6ecac9c5)
    
    [Extension Host] Starting WebSocket: RAW/api/kernels/7d025fa9-1f07-48a9-aa46-6723eb7bc0b8
    console.ts:137 [Extension Host] Kernel: connected (7d025fa9-1f07-48a9-aa46-6723eb7bc0b8)
    commons.initial.bundle.js:2 Starting WebSocket: BOGUS_PVSC/api/kernels/7d025fa9-1f07-48a9-aa46-6723eb7bc0b8
    commons.initial.bundle.js:2 Kernel: connected (7d025fa9-1f07-48a9-aa46-6723eb7bc0b8)
    console.ts:137 [Extension Host] Starting WebSocket: RAW/api/kernels/f1d4f34b-d134-452e-bb8a-1ede6ecac9c5
    console.ts:137 [Extension Host] Kernel: connected (f1d4f34b-d134-452e-bb8a-1ede6ecac9c5)
    commons.initial.bundle.js:2 ChunkLoadError: Loading chunk vendors~dataresource~geojson~modeldebug~nteract_transforms~nteract_transforms_vsdom failed.
    (timeout: http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/vendors~dataresource~geojson~modeldebug~nteract_transforms~nteract_transforms_vsdom.bundle.js)
        at Function.o.e (http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/nativeEditor.js:1:1713)
        at http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:493888
        at http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:2003054
        at Object.next (http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:2003159)
        at http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:2002096
        at new Promise (<anonymous>)
        at s (http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:2001870)
        at e.importer (http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:493770)
        at e.getComponent (http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.3.0/out/datascience-ui/notebook/commons.initial.bundle.js:2:485940)
        at http://localhost:8080/webview/vscode-resource/file///root/.local/share/code-server/extensions/ms-toolsai.jupyter-202
    
  7. reopened this on Apr 26, 2021
  8. gogobd commented on Apr 26, 2021

    @gogobd
    Author

    I was now reproducing this issue both with a conda environment and debian buster python3 (both inside docker). Code Server asks me to install the Jupyter extension, then Python, then it installs ipython Kernel; unfortunately the ChunkLoadError comes up every time now again.

  9. code-asher commented on Apr 26, 2021

    @code-asher
    Member

    I tried to replicate but I ran into issues with the extension activating at all; I'm getting the error mentioned here: #2929

    I'd be interested in seeing if downloading and installing the extension from OpenVSX instead of our marketplace works for you: https://open-vsx.org/extension/ms-python/python

  10. gogobd commented on Apr 26, 2021

    @gogobd
    Author

    With https://open-vsx.org/api/ms-python/python/2020.10.332292344/file/ms-python.python-2020.10.332292344.vsix installed (and de-selecting Extensions: Automatic Updates first) it was kinda worse - I wasn't even able to connect to the ipython Kernel. Even though at one point Code Server has installed ipython.

  11. code-asher commented on Apr 28, 2021

    @code-asher
    Member

    I gave it a try and I'm seeing the same thing (or something similar). It says Not connected. If I click it to connect it fails with:

    Error: Jupyter cannot be started. Error attempting to locate jupyter: Data Science libraries jupyter and notebook are not installed in interpreter Python 2.7.17 64-bit
    

    If I switch to Python 3 using the button in the status bar I get this instead:

    Error: Jupyter cannot be started. Error attempting to locate jupyter:
    

    Jupyter is in my path so I'm not sure why.

    So then I opened the command pallete and switched the interpreter there instead and for some reason that worked. (Credit here: https://stackoverflow.com/questions/60330837/jupyter-server-not-started-no-kernel-in-vs-code)

    I don't know if any of that applies to your situation but maybe it'll be helpful.

  12. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    When I shift-reload code server i see "Connecting to Python 3", then the icon goes green and I'm connected (idle). But a cell containing "print('Hello, world!')" just yields "Loading...", then, later, the error I posted above (ChunkLoadError: Loading chunk vendorsdataresourcegeojsonmodeldebugnteract_transf...). So for me connecting (supposedly) works, execution doesn't.
    @code-asher Thank you very much for your help, though! I think it helped clarify this issue :-)

  13. 2 remaining items

  14. gogobd commented on Apr 28, 2021

    @gogobd
    Author
    FROM debian:buster-slim
    
    ENV SHELL /bin/bash
      
    # Install system dependencies
    RUN apt-get update \
     && DEBIAN_FRONTEND=noninteractive apt-get install -y \
        curl \
        wget \
        git \
        screen \
        unzip \
        vim \
        procps \
     && apt-get clean
    
    # Install miniconda
    RUN curl -sfLO https://repo.anaconda.com/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh \
     && /bin/bash Miniconda3-py39_4.9.2-Linux-x86_64.sh -b -p /root/miniconda \
     && PATH="/root/miniconda/bin:$PATH" \
     && conda install -c anaconda jupyter
    
    ## Code server
    RUN mkdir -p ~/.local/lib ~/.local/bin
    RUN curl -sfL https://github.com/cdr/code-server/releases/download/v3.9.3/code-server-3.9.3-linux-amd64.tar.gz | tar -C ~/.local/lib -xz
    RUN mv ~/.local/lib/code-server-3.9.3-linux-amd64 ~/.local/lib/code-server-3.9.3
    RUN ln -s ~/.local/lib/code-server-3.9.3/bin/code-server ~/.local/bin/code-server
    RUN PATH="~/.local/bin:$PATH"
    
    WORKDIR /app
    CMD ~/.local/bin/code-server --bind-addr 0.0.0.0:8080 /app
    
    # docker build -t jupyter .
    # docker run -v $(pwd):/app -p 8080:8080 -p ... -it -d jupyter
    # docker exec -it <dontainer_id> cat /root/.config/code-server/config.yaml
    
  15. code-asher commented on Apr 28, 2021

    @code-asher
    Member

    Oh those weren't the logs with the version from our marketplace and not the OpenVSX one?

    I'll give the Dockerfile a run when I get a chance.

  16. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    With OpenVSX I wasn't able to connect to the kernel - and I tried again now via Command Palette: The Command is available but no Kernels are being presented. It's very weird because console log says "Kernel: connected (099ad007-dbfd-48c6-ab30-003320fe07a9)" but the icons don't change, it keeps saying "Python3: Not Started". Note: I had two packages installed: Python v2020.10.33 (OpenVSX) and Jupyter v2021.3.0 (from Marketplace).

  17. code-asher commented on Apr 28, 2021

    @code-asher
    Member

    Oh maybe that's it! I actually forgot to mention I had a similar problem. I tried to uninstall the Python and Jupyter extensions and then install the OpenVSX Jupyter extension (it contains both Python and Jupyter from before they were split) but I ended up having to wipe the extensions in ~/.local/share/extensions and then install the OpenVSX one again.

    VS Code doesn't actually remove extensions from disk when uninstalling so I think it causes weird issues when adding a different version of an uninstalled extension manually.

  18. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    I was using docker and actually deleted the images and containers frequently for a fresh start; the ~/.local/share/code-server/extensions/ are not in my /app dir so I think that can't be it...
    Thank you very much for your help, it's very appreciated!

  19. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    Oh, and I can't find a dedicated "Jupyter" Extension on OpenVSX!

  20. code-asher commented on Apr 28, 2021

    @code-asher
    Member

    Ah right that makes sense.

    The Python extension on OpenVSX includes both Python and Jupyter.

    It was split into two extensions but OpenVSX still has the version from before the split.

  21. code-asher commented on Apr 28, 2021

    @code-asher
    Member

    I gave your Dockerfile a run and everything worked! My exact steps:

    1. Save Dockerfile as test.Dockerfile
    2. docker build -t code-server . -f test.Dockerfile
    3. docker run -e PASSWORD=test -p 8080:8080 code-server
    4. Browse to localhost:8080 and log in
    5. Open terminal
    6. Run wget https://open-vsx.org/api/ms-python/python/2020.10.332292344/file/ms-python.python-2020.10.332292344.vsix
    7. Extensions > Install from VSIX > Select downloaded VSIX
    8. Refresh the page
    9. Open command palette
    10. Select Create New Blank Jupyter Notebook
    11. Add print("hello") to the cell
    12. Click run
  22. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    This is so weird, I was trying

    docker build -t jupyter .
    docker run -v $(pwd):/app -p 8080:8080 -it -d jupyter
    docker exec -it <dontainer_id> cat /root/.config/code-server/config.yaml (to see the generated password)

    Then follow 4, 5, 6, 7, 8, 9, 10, 11 and 12

    And all I got is "Loading..." and then the ChunkLoadError. That was quite unexpected because we were using the same Dockerfile. My Docker host is macOS Big Sur 11.3; But my Broser is Brave - so i tried Safari and: The cell executed!

  23. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    I turned off "Shields" for localhost:8080 but the cells are still not executing in Brave (still working fine in Safari). This whole thing is a browser issue!

  24. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    After deleting all user data related to Brave and re-installing it cell execution works again like it should!

  25. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    Thanks, @code-asher your help solved my issue!

  26. code-asher commented on Apr 28, 2021

    @code-asher
    Member

    Very interesting! I'm glad we got it sorted! 😄

  27. gogobd commented on Apr 28, 2021

    @gogobd
    Author

    For completeness: after resetting Brave this issue is gone even when I use the Marketplace Extensions Jupyter v2021.3.0 and Python v2021.4.765268190 which are being installed as defaults (code server 3.9.3)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionThe issue needs to be fixed in the extension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions