Skip to content

[Bug]: Missing files after extension upgrades? Can no longer connect to workspace. MaxListenersExceededWarning #6038

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
4 tasks done
tmikaeld opened this issue Mar 1, 2023 · 6 comments
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer

Comments

@tmikaeld
Copy link

tmikaeld commented Mar 1, 2023

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Any
  • Local OS: MacOS
  • Remote OS: Debian 11
  • Remote Architecture: amd64
  • code-server --version: 4.10

Steps to Reproduce

  1. Start code server
  2. use code server
  3. randomly failed..

image

Expected

Code server should work

Actual

404 on these files:

image

/static/extensions/git-base/dist/browser/extension.js
/static/extensions/emmet/dist/browser/emmetBrowserMain.js
/static/extensions/merge-conflict/dist/browser/mergeConflictMain.js

Logs

(node:189) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
(node:189) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 uncaughtException listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:189) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGPIPE listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:189) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:189) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 rejectionHandled listeners added to [process]. Use emitter.setMaxListeners() to increase limit
File not found: /usr/lib/code-server/lib/vscode/extensions/emmet/dist/browser/emmetBrowserMain.js
File not found: /usr/lib/code-server/lib/vscode/extensions/git-base/dist/browser/extension.js
File not found: /usr/lib/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js

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

No response

@tmikaeld tmikaeld added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Mar 1, 2023
@tmikaeld
Copy link
Author

tmikaeld commented Mar 1, 2023

I noticed that the files are not in the locations they should be, this is the result of locate:

root@www:~# locate mergeConflictMain.js
/usr/lib/code-server/lib/vscode/extensions/merge-conflict/dist/mergeConflictMain.js
/usr/lib/code-server/lib/vscode/extensions/merge-conflict/dist/mergeConflictMain.js.LICENSE.txt
/usr/lib/code-server/lib/vscode/extensions/merge-conflict/dist/mergeConflictMain.js.map

@code-asher
Copy link
Member

code-asher commented Mar 3, 2023 via email

@xolom
Copy link

xolom commented Nov 17, 2023

Same issue here. Running code-server 4.18.0

@liusky0212
Copy link

code-server 4.9--->4.18 have same issue , code server behind nginx

see most log
debug host "x.com" does not match origin "x.com:3000"; blocking request to /stable-d7a2b4936af1bfd80cb96f2567af68badc2325e3?reconnectionToken=e8438e74-92d4-4247-aae8-d927c61e72b6&reconnection=false&skipWebSocketFrames=false

it has Cross-Origin Issues!
The issue has been successfully resolved by using --trusted-origins

you can give it a try

@xuefei6000
Copy link

xuefei6000 commented Jul 4, 2024

时间问题,所以我懒得翻译,我快速用中文分享一下我是如何解决的:

首先描述一下问题,我使用nginx 进行反向代理。

页面成功了,但是打开页面之后提示如下:

An unexpected error occurred that requires a reload of this page.
The workbench failed to connect to the server (Error: WebSocket close with status code 1006)

然后我查看了 docker logs

[03:26:55] Extension host agent started.
[03:26:55] Started initializing default profile extensions in extensions installation folder. file:///home/coder/.local/share/code-server/extensions
[03:26:55] Completed initializing default profile extensions in extensions installation folder. file:///home/coder/.local/share/code-server/extensions
File not found: /usr/lib/code-server/lib/vscode/extensions/git-base/dist/browser/extension.js
File not found: /usr/lib/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js
File not found: /usr/lib/code-server/lib/vscode/extensions/git-base/dist/browser/extension.js
File not found: /usr/lib/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js

经过不断地搜索,我终于找到了解决问题的答案
请参考 #6014

如果你也是 nginx 的话 参考 #6166
在你的nginx 的 /etc/nginx/nginx.conf 中 添加:
proxy_set_header X-Forwarded-Host $host:$server_port;

因为配置太多了,所以下面我吧我的所有配置展示给大家参考:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log debug;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log /var/log/nginx/access.log main;
    error_log /var/log/nginx/error.log debug;

    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    upstream vscode_xuefei {
        server 10.90.0.20:8881;
    }

    upstream vscode_auto {
        server 10.90.0.20:8882;
    }

    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

    server {
        listen 18003;

        server_name 172.16.22.248;

        location /xuefei/ {
            proxy_pass http://vscode_xuefei/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-Prefix /xuefei;
            proxy_set_header X-Forwarded-Host $host:$server_port;
            proxy_redirect off;
            proxy_buffering off;
            proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
            proxy_connect_timeout 60;
            proxy_send_timeout 90;
            proxy_read_timeout 90;
            proxy_buffer_size 4k;
            proxy_buffers 4 32k;
            proxy_busy_buffers_size 64k;
            proxy_temp_file_write_size 64k;
        }

        location /auto/ {
            proxy_pass http://vscode_auto/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-Prefix /auto;
            proxy_set_header X-Forwarded-Host $host:$server_port;
            proxy_redirect off;
            proxy_buffering off;
            proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
            proxy_connect_timeout 60;
            proxy_send_timeout 90;
            proxy_read_timeout 90;
            proxy_buffer_size 4k;
            proxy_buffers 4 32k;
            proxy_busy_buffers_size 64k;
            proxy_temp_file_write_size 64k;
        }

        error_log /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;
    }
}

是的,我也很纳闷,一个找不到文件的文件的报错,居然是因为配置文件有问题。
不过解决了就好,继续下一步吧,哈哈

@code-asher
Copy link
Member

Closing as stale but feel free to comment if you come back to this.

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

5 participants