question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: intermittent reconnection

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Windows 11
  • Remote OS: Ubuntu 20.04
  • Remote Architecture: x86_64
  • code-server --version: v4.5.1

image

image

Steps to Reproduce

  1. insrtall the latest version of code-server
  2. open an project and wating sometimes.
  3. open the code-server develope tool, and you can see some log like the below example

image

Expected

can use code-server normal.

Actual

intermittent reconnection

received socket close event (wasClean: false, code: 1006, reason: ).

Logs

No response

Screenshot/Video

No response

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

use nginx reverse proxy code-server, and nginx configure https.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
shawnweekscommented, Aug 4, 2022

I’ve been doing some testing and it appears that what’s causing this is a change in behavior to the websocket keep alive between 4.4.0 and 4.5.1. If I add proxy_read_timeout 86400; to my Nginx configuration the issue goes away. By default Nginx has a 60 second read timeout which worked just fine on 4.4.0. Below is my working configuration but we need to figure out why that’s no longer enough. I just don’t know enough about how VSCode works to try and track this down.

server {
    listen 443 ssl;
    server_name dev-1.example.com;
    ssl_certificate /etc/pki/tls/certs/dev-1.cer;
    ssl_certificate_key /etc/pki/tls/private/dev-1.key;
    ssl_protocols TLSv1.2 TLSv1.3;

    location / {
      proxy_pass http://localhost:8080/;
      proxy_set_header Host $host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection upgrade;
      proxy_read_timeout 86400;
      proxy_set_header Accept-Encoding gzip;
    }
}
2reactions
shawnweekscommented, Aug 5, 2022

There might be shorter values that work, like I said I’m not sure what causing the behavior change since other reverse proxies like Caddy don’t seem to do this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix a USB Device That Keeps Disconnecting ...
The "USB device keeps disconnecting and reconnecting Windows 10" error could be caused by faulty USB drivers. To resolve it, uninstall and ...
Read more >
Why is the Internet Continuously Connecting ... - Computer Hope
If the cable modem is having trouble maintaining a steady connection, power cycling it might resolve the issue or it might be overheating....
Read more >
Remote Desktop client disconnects and can't reconnect to the ...
After Remote Desktop client loses its connection to the remote desktop, the client can't immediately reconnect. The user receives one of the ...
Read more >
[SOLVED] USB Keeps Disconnecting and Reconnecting ...
Solution 1: Reinstall the Universal Serial Bus Controllers Driver. A driver issue can be the reason for USB devices disconnecting and  ...
Read more >
USB keeps disconnecting & reconnecting in Windows 11 Fix
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found