Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dokastho opened this issue Jan 19, 2022 · 6 comments

Comments

@dokastho
Copy link

dokastho commented Jan 19, 2022

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

@dokastho dokastho 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) Jan 19, 2022
@gmiscione
Copy link

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.

@dokastho
Copy link
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

@dokastho
Copy link
Author

dokastho commented Jan 19, 2022

See fix in original post

@Lamerys
Copy link

Lamerys commented Feb 23, 2022

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.

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 23, 2022

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

@Lamerys
Copy link

Lamerys commented Feb 23, 2022

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants