Skip to content

The workbench failed to connect to the server (Error: WebSocket close with status code 1006) #4763

Closed

Description

@dokastho

Fix

added the following lines to my site's .conf in /etc/nginx/sites-available :

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;

✅

OS/Web Information

  • Web Browser: Google chrome
  • Local OS: Windows 10
  • Remote OS: Ubuntu Server 20.04
  • Remote Architecture: amd64
  • code-server --version: 4.0.1

Steps to Reproduce

  1. run install script
  2. start code-server service
  3. open browser to code-server website (nginx reverse proxy)
  4. get error The workbench failed to connect to the server (Error: WebSocket close with status code 1006)
  5. remote service error reads ENOENT no such file or directory, open '/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/code/browser/workbench/workbench.html'

Expected

Code server should open and run on a fresh install. This is a new install of code-server and I think it's attempting to load extensions from the old install that have not been installed yet. I had tried to move the install location under bad stack overflow advice and ever since it's not been working correctly

Actual

Repeatedly reloads page and immediately throws same exception. Again, this is a new install of code-server and I think it's attempting to load extensions from the old install that have not been installed yet. I had tried to move the install location under bad stack overflow advice and ever since it's not been working correctly

Logs Screenshot

Notes

Once again, this is a new install of code-server and I think it's attempting to load extensions from the old install that have not been installed yet. I had tried to move the install location under bad stack overflow advice and ever since it's not been working correctly. Can be reproduced across versions 3.12.0, 3.6.2, 3.9.1 and 4.0.1. Webserver config: Nginx reverse proxy with Oauth2-proxy default config and google oauth 2.0
This issue can be reproduced in VS Code: No

Activity

  1. changed the title [-]ENOENT no such file or directory, open '/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/code/browser/workbench/workbench.html'[/-] [+]The workbench failed to connect to the server (Error: WebSocket close with status code 1006)[/+] on Jan 19, 2022
  2. gmiscione commented on Jan 19, 2022

    @gmiscione

    I have the same problem if I try to update from 3.12.0 to 4.0.1. I tried to clean the folder ~/.local/share/code-server to try a "clean" restart but the problem is still there. To have a running environment I had to downgrade to 3.12.0 with the installer script.

  3. dokastho commented on Jan 19, 2022

    @dokastho
    Author

    I have the same problem if I try to update from 3.12.0 to 4.0.1. I tried to clean the folder ~/.local/share/code-server to try a "clean" restart but the problem is still there. To have a running environment I had to downgrade to 3.12.0 with the installer script.

    in notes: Can be reproduced across versions 3.12.0, 3.6.2, 3.9.1 and 4.0.1
    Version 3.12.0 does not fix the bug

  4. dokastho commented on Jan 19, 2022

    @dokastho
    Author

    See fix in original post

  5. Lamerys commented on Feb 23, 2022

    @Lamerys

    See fix in original post

    Hi,
    Sorry to bother you, but I’m absolute noob… I just started to learn coding and decided to set up code-server docker to be able to learn whiles at work remotely (on my free time  ).
    So I’ve run in to the same issue, I’ve tried to fallow your fix, but the only file in /etc/nginx/sites-available/ is ‘default’. I’ve tried to add the lines from your post and restart code-server docker, but nothing changed. Also tried to create new file ‘.conf’ with same lines from your post with no luck as well.
    Just to clarify, I’m using nginx proxy and cloudflare.
    Could you please please please  explain to me what I’m doing wrong?
    Thank you! and sorry for wasting your time.

  6. jsjoeio commented on Feb 23, 2022

    @jsjoeio
    Contributor

    @Lamerys feel free to start a new Q and A discussion and we'll see if we can help you!

  7. Lamerys commented on Feb 23, 2022

    @Lamerys

    @Lamerys feel free to start a new Q and A discussion and we'll see if we can help you!

    Thank you. All sorted, just needed to activate websocket via Nginx panel.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions