Skip to content

[Bug]: cannot use REST client vscode extension #5399

Closed as not planned
Closed as not planned

Description

@pheman

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: windows
  • Remote OS: centos
  • Remote Architecture: amd64
  • code-server --version: 4.4.0

REST Client extension(https://marketplace.visualstudio.com/items?itemName=humao.rest-client),
the side window can pop after send a request but with no reply message.

image

Steps to Reproduce

  1. open code-server
  2. install extension, REST Client
  3. run command, send request. GET https://www.google.com

Expected

right side windows pop with reply message

Actual

right side windows pop with no message

Logs

No response

Screenshot/Video

image

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

Activity

  1. added
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Aug 2, 2022
  2. jsjoeio commented on Aug 3, 2022

    @jsjoeio
    Contributor

    Are there any logs in the browser you can share?

  3. added
    waiting-for-infoWaiting for more information from submitter
    and removed
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Aug 3, 2022
  4. adeleporte commented on Aug 25, 2022

    @adeleporte

    I have the same issue (also with some other extensions) when code-server is exposed externally (http, https, w/ or w/o password). However, it works when using 127.0.0.1 (with SSH tunnel for example).

    Seems to be related to sha-256 calculations...
    I have this error message in the browser logs : ERR Can't compute sha-256: t@http://10.*.*.*:8081/static/out/vs/workbench/workbench.web.main.js:798:15149

  5. jsjoeio commented on Aug 25, 2022

    @jsjoeio
    Contributor

    Interesting 🤔

    Running locally on localhost:8080, I can't reproduce.

    image

    I tested it by exposing via ngrok and it works as expected as well:

    image

    If you could paste a screenshot or the entire browser logs, that would help.

  6. adeleporte commented on Aug 25, 2022

    @adeleporte

    Sure:
    Screenshot 2022-08-25 at 19 06 33

    Browser logs:

    An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing. 192.168.144.17:8080
      ERR Can't compute sha-256: t@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:798:15149
    F@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1351:9435
    _createInstance@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:607:1332
    createInstance@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:607:773
    createWebviewElement@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1351:21856
    show@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1291:41076
    claim@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1291:39597
    claimWebview@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1755:82968
    setInput@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1755:82879
    async*doSetInput@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2656:26948
    doOpenEditor@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2656:25324
    openEditor@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2656:24950
    doShowEditor/ne<@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2861:17281
    doShowEditor@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2861:17541
    doOpenEditor@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2861:17014
    openEditor@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2861:15746
    openEditor@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:2683:24713
    async*createWebview@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1963:3496
    $createWebviewPanel@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1963:7430
    _doInvokeHandler@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1734:13103
    _invokeHandler@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1734:12787
    _receiveRequest@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1734:11449
    _receiveOneMessage@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1734:10127
    h/<@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:1734:8236
    invoke@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:67:145
    fire@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:67:1856
    fire@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:83:18792
    _receiveMessage@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:83:23373
    f/<@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:83:20907
    invoke@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:67:145
    fire@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:67:1856
    acceptChunk@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:83:15623
    s/<@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:83:14753
    onData/<@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:617:42227
    invoke@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:67:145
    fire@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:67:1856
    E/this._fileReader.onload@http://192.168.144.17:8080/static/out/vs/workbench/workbench.web.main.js:617:40157
    log.ts:313:11
    Uncaught (in promise) Error: Can't compute sha-256
        t webview.ts:11
        F webviewElement.ts:177
        _createInstance instantiationService.ts:110
        createInstance instantiationService.ts:76
        createWebviewElement webviewService.ts:52
        show overlayWebview.ts:163
        claim overlayWebview.ts:102
        claimWebview webviewEditor.ts:158
        setInput webviewEditor.ts:149
        doSetInput editorPanes.ts:281
        doOpenEditor editorPanes.ts:150
        openEditor editorPanes.ts:118
        ne editorGroupView.ts:1096
        doShowEditor editorGroupView.ts:1120
        doOpenEditor editorGroupView.ts:1078
        openEditor editorGroupView.ts:985
        openEditor editorService.ts:535
        createWebview webviewWorkbenchService.ts:231
        $createWebviewPanel mainThreadWebviewPanels.ts:168
        _doInvokeHandler rpcProtocol.ts:473
        _invokeHandler rpcProtocol.ts:458
        _receiveRequest rpcProtocol.ts:374
        _receiveOneMessage rpcProtocol.ts:296
        h rpcProtocol.ts:161
        invoke event.ts:569
        fire event.ts:736
        fire ipc.net.ts:638
        _receiveMessage ipc.net.ts:958
        f ipc.net.ts:831
        invoke event.ts:569
        fire event.ts:736
        acceptChunk ipc.net.ts:382
        s ipc.net.ts:338
        onData browserSocketFactory.ts:230
        invoke event.ts:569
        fire event.ts:736
        onload browserSocketFactory.ts:91
    webview.ts:11:8
      ERR [Extension Host] (node:1100) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    (Use `node --trace-deprecation ...` to show where the warning was created) log.ts:313:11
    [Extension Host] (node:1100) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    (Use `node --trace-deprecation ...` to show where the warning was created) console.ts:137:34
  7. jsjoeio commented on Aug 29, 2022

    @jsjoeio
    Contributor

    Very helpful! Looks like your error is originating here:

    https://github.com/microsoft/vscode/blob/main/src/vs/workbench/browser/webview.ts#L11

    Can you try using something like ngrok and seeing if you still get the error?

    If you do get the error, not related to HTTPS
    If you don't, probably related toHTTPS

  8. adeleporte commented on Aug 29, 2022

    @adeleporte

    Thanks for the update. Unfortunately, I can't use ngrok (company policy).

    But there is a very simple way to reproduce it, by using the docker image:

    docker run -d -p 0.0.0.0:8080:8080 --rm codercom/code-server

    If I access to http://127.0.0.1:8080, or http://localhost:8080, everything is working fine.
    If I access to the docker host directly, let's say http://172.20.5.109:8080, the extension is broken.

    This docker image doesn't use https, so I would say that the issue is not related to https.

    Thanks for looking at this issue!

  9. jsjoeio commented on Aug 29, 2022

    @jsjoeio
    Contributor

    If I access to the docker host directly, let's say http://172.20.5.109:8080/, the extension is broken.

    That means you're not using HTTPS so service workers won't work so the extension shouldn't work. I think that proves that this is related to HTTPS then. And I don't think there's any way to work around this unfortunately.

  10. adeleporte commented on Aug 29, 2022

    @adeleporte

    Hum interesting..

    I have created a new "https" docker image with this Docker file:

    FROM codercom/code-server:latest
    COPY config.yaml /home/coder/.config/code-server/config.yaml
    ENTRYPOINT ["/usr/bin/entrypoint.sh", "."]

    and this config file :

    bind-addr: 0.0.0.0:443
    auth: password
    password: test
    cert: true

    docker run -d -p 0.0.0.0:443:443 --rm adeleporte/httpscoder

    And this time, it does work with any address/fqdn...

    I will re-check with my previous configuration.
    Thanks!

  11. jsjoeio commented on Aug 29, 2022

    @jsjoeio
    Contributor

    Well that is certainly good news to my Monday! Sounds good!

  12. code-asher commented on Mar 12, 2024

    @code-asher
    Member

    Closing since it seems this is solved?

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

    waiting-for-infoWaiting for more information from submitter

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions