Skip to content

Unable to render cell UI after opening Notebook file in remote window #123494

Closed

Description

  • VS Code Version: 1.56.0
  • OS Version: Win 10 Enterprise 21H1 19043.928

Steps to Reproduce:

  1. Notebook is opened using showNotebookDocument API in remote window as the last step of the resolver.
  2. The correct file is opened but there is no cell UI shown. An indeterminate loader is shown at the top of the file:
  3. Closing the automatically opened file and manually opening it again results in the same issue.
  4. Opening any other Notebook file from this point onwards results in the same issue.

image

Here is the output from the Developer Console:

image

The relevant Jupyter logs are attached with this issue.
jupyter_log_nb_open_issue.txt

Activity

  1. added
    important
    on May 10, 2021
  2. SiddhanthUnnithan commented on May 10, 2021

    @SiddhanthUnnithan
    Author
  3. roblourens commented on May 10, 2021

    @roblourens
    Member

    This worked before right?

  4. roblourens commented on May 10, 2021

    @roblourens
    Member

    The basic scenario still works for me - using showNotebookDocument to open a notebook from the resolver. Tried with github-issues and jupyter.

  5. roblourens commented on May 10, 2021

    @roblourens
    Member

    Can you run "Set Log Level", pick Trace, try the scenario again, then share the log from the Log (Window) output channel? Otherwise we might have to debug together.

  6. SiddhanthUnnithan commented on May 10, 2021

    @SiddhanthUnnithan
    Author
  7. SiddhanthUnnithan commented on May 10, 2021

    @SiddhanthUnnithan
    Author

    Some more interesting behaviour. At some point the Notebook stops loading and its empty. If I move my cursor to the file I see the "+Code" and "+Markdown" hover-over options:

    image

    Even after clicking the two options I don't see cells in the Notebook.

  8. SiddhanthUnnithan commented on May 10, 2021

    @SiddhanthUnnithan
    Author

    I clicked "+ Code" a number of times and saved the file. When opening it through the Azure ML Studio I see the following:

    image

    Looks like the edit and save works successfully and its just that I don't see the output in the window.

  9. SiddhanthUnnithan commented on May 10, 2021

    @SiddhanthUnnithan
    Author

    One last thing I should mention - this only happens in a remote window wherein we call the showNotebookDocument API as part of the resolver. In a remote window that is created with a simpler resolver (just connect, don't try and open a Notebook) the Notebooks are rendered correctly:

    image

  10. roblourens commented on May 11, 2021

    @roblourens
    Member

    I haven't used azure ml notebooks, how can I set up to repro this myself? Or if you'd prefer, I could try to debug this on a call tomorrow.

  11. SiddhanthUnnithan commented on May 11, 2021

    @SiddhanthUnnithan
    Author

    I think a call would be best - let me find some time for the two of us and a few others for tomorrow.

  12. roblourens commented on May 12, 2021

    @roblourens
    Member

    Summary, the problem is with the way we pack a resource URI into another URI to be loaded in the webview here

    const uri = environmentService.webviewResourceRoot
    .

    It's fixed by this large change b847eb3

    and also by this change, which is potentially impactful 05ef37c and too suspicious to prepare as a candidate.

    It can also be worked around on the extension side by not putting uri-encoded slashes into the remote authority.

  13. 23 remaining items

  14. roblourens commented on Jul 1, 2021

    @roblourens
    Member

    It's probably easiest to just hack an encoded slash/percent sign into the URI that you create for the webview resources. I can send a build of remote-ssh that does this if you need it.

  15. mjbvz commented on Aug 7, 2021

    @mjbvz
    Contributor

    Thanks for the example extension roblourens. Using it, I see urls such as the following inside of webviews (I've connected to localhost):

    https://vscode-remote%2Bssh-remote%2Blocalhost%3Dfoo%2Fbar.vscode-resource.vscode-webview.net/Users/matb/.vscode-server-oss/bin/49af1cbe00271ac2ea36cfc5f7352fe31a7b0094/extensions/markdown-math/preview-styles/index.css
    

    This url does not seem to be valid. You can test this using new Url(...). The encoded slash (%2f) seems to cause the issues here. This results in our service worker never even seeing requests for these resources

    Digging into this a bit farther, here's an original URL that we get passed in a call to asWebviewUri:

    vscode-remote://ssh-remote%2Blocalhost%3Dfoo%2Fbar/Users/matb/projects/vscode-docs/docs/java/images/java-project/lightweight-icon.PNG
    

    The function transforms it into:

    https://vscode-remote%2Bssh-remote%2Blocalhost%3Dfoo%2Fbar.vscode-resource.vscode-webview.net/Users/matb/projects/vscode-docs/docs/java/images/java-project/lightweight-icon.PNG
    

    This second URL is invalid. However what's interesting is that if you simply replace vscode-remote with https in the original url (and don't do any other transforms), it also becomes invalid. I don't fully understand this yet but am looking to see if we can better encode the authority to avoid this

  16. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Aug 9, 2021
  17. added
    author-verification-requested
    on Aug 26, 2021
  18. vscode-triage-bot commented on Aug 26, 2021

    @vscode-triage-bot

    This bug has been fixed in the latest release of VS Code Insiders!

    Sid Unnithan (@SiddhanthUnnithan), you can help us out by commenting /verified if things are now working as expected.

    If things still don't seem right, please ensure you're on version e4ac631 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

    Happy Coding!

  19. added
    verified
    on Aug 27, 2021
  20. roblourens commented on Aug 27, 2021

    @roblourens
    Member

    I was able to render cell outputs in a remote with % in the authority, so I think it's good now.

  21. locked and limited conversation to collaborators on Sep 23, 2021
  22. added a commit that references this issue on Oct 4, 2025
    649dd18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

author-verification-requestedbuginsiders-releasednotebookverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions