Skip to content
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

Extension file not found when code-server serve-local #7163

Closed
Az0s opened this issue Sep 6, 2022 · 7 comments
Closed

Extension file not found when code-server serve-local #7163

Az0s opened this issue Sep 6, 2022 · 7 comments
Labels
code-server Issues on the VS Code Server. *out-of-scope Posted issue is not in scope of VS Code

Comments

@Az0s
Copy link

Az0s commented Sep 6, 2022

Remote Extension/Connection Type: Server
Remote Server: Debian 11.0

Running local code server via code-server serve-local when encountered: File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/git-base/dist/browser/extension.js

On the browser read: WebSocket close with status code 1006, get 404 not found while get http://server:port/stable-784b0177c56c607789f9638da7b6bf3230d47a8c/static/extensions/git-base/dist/browser/extension.js

Full error report:

[2022-09-06 13:31:17] info Starting server...
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
Server bound to 127.0.0.1:8000 (IPv4)
Extension host agent listening on 8000

Web UI available at http://localhost:8000/?tkn=a5e51d6f-3d21-4f3d-a8da-b868d98c4523
[13:31:17] Extension host agent started.
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/git-base/dist/browser/extension.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/ipynb/dist/browser/ipynbMain.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/emmet/dist/browser/emmetBrowserMain.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/merge-conflict/dist/browser/mergeConflictMain.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/git-base/dist/browser/extension.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/ipynb/dist/browser/ipynbMain.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/emmet/dist/browser/emmetBrowserMain.js
File not found: /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/merge-conflict/dist/browser/mergeConflictMain.js
  • Environment:
# On the remote server
VM-16-7-debian% code-server -V
VS Code Server 20220903.2
VM-16-7-debian% cat /proc/version
Linux version 5.10.0-15-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.120-1 (2022-06-09)

Extra info on the missing files:

# file path assumed:  /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/git-base/dist/browser/extension.js
# while on the server:
VM-16-7-debian% cd  /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c/extensions/git-base/dist/
VM-16-7-debian% ls
extension.js  nls.metadata.header.json	nls.metadata.json

I assumed its a broken installation and tried to deleted the whole /home/azus/.vscode-cli/server-stable-web/bin/784b0177c56c607789f9638da7b6bf3230d47a8c dir but the error remains.

Steps to Reproduce:

  1. code-server serve-local
  2. nginx proxy-pass to external port
  3. access via server:ip/token
@chrmarti chrmarti added the code-server Issues on the VS Code Server. label Sep 6, 2022
@zxplove4
Copy link

zxplove4 commented Sep 7, 2022

Have you solved this problem?

@Az0s
Copy link
Author

Az0s commented Sep 7, 2022

Have you solved this problem?

no, sir

@zxplove4
Copy link

zxplove4 commented Sep 8, 2022

Have you solved this problem?

no, sir

I think we're on the wrong track here. There is no need to use nginx as a proxy. Just run code-server serve-local --host 192.168.1.xxx (server address)

@Az0s
Copy link
Author

Az0s commented Sep 8, 2022

Have you solved this problem?

no, sir

I think we're on the wrong track here. There is no need to use nginx as a proxy. Just run code-server serve-local --host 192.168.1.xxx (server address)

This solved the problem. Everything tested out fine with the code-server. But I'm still wondering how nginx would cause this internal path-finding problem. It'll be really nice if you could provide some thoughts sir

@coolboy0961
Copy link

I'm still confused with this problem.
In my case, I use this image to create a vscode-server container.
And I want to access vscode-server securely with https.
I use reverse proxy function of synology nas to link a domain to vscode-server container.

If I use http to access vscode-server, it will be fine.But if I use https file not found error will occur.

File not found: /app/code-server/lib/vscode/extensions/ipynb/dist/browser/ipynbMain.js
File not found: /app/code-server/lib/vscode/extensions/git-base/dist/browser/extension.js
File not found: /app/code-server/lib/vscode/extensions/emmet/dist/browser/emmetBrowserMain.js
File not found: /app/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js

the correct file path is

File not found: /app/code-server/lib/vscode/extensions/ipynb/ipynbMain.js
File not found: /app/code-server/lib/vscode/extensions/git-base/extension.js
File not found: /app/code-server/lib/vscode/extensions/emmet/emmetBrowserMain.js
File not found: /app/code-server/lib/vscode/extensions/merge-conflict/mergeConflictMain.js

I don't know why dist/browser/ is add.

@coolboy0961
Copy link

This is full logs.

[custom-init] no custom services found, skipping...
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service 00-legacy: starting
s6-rc: info: service 00-legacy successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/01-envfile
cont-init: info: /etc/cont-init.d/01-envfile exited 0
cont-init: info: running /etc/cont-init.d/01-migrations
[migrations] started
[migrations] no migrations found
cont-init: info: /etc/cont-init.d/01-migrations exited 0
cont-init: info: running /etc/cont-init.d/02-tamper-check
cont-init: info: /etc/cont-init.d/02-tamper-check exited 0
cont-init: info: running /etc/cont-init.d/10-adduser

-------------------------------------
          _         ()
cont-init: info: /etc/cont-init.d/10-adduser exited 0
cont-init: info: running /etc/cont-init.d/30-config
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

setting permissions::configuration
setting permissions::workspace
cont-init: info: /etc/cont-init.d/30-config exited 0
cont-init: info: running /etc/cont-init.d/90-custom-folders
cont-init: info: /etc/cont-init.d/90-custom-folders exited 0
cont-init: info: running /etc/cont-init.d/99-custom-scripts
[custom-init] no custom files found, skipping...
cont-init: info: /etc/cont-init.d/99-custom-scripts exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-mods: starting
s6-rc: info: service init-mods successfully started
s6-rc: info: service init-mods-package-install: starting
s6-rc: info: service init-mods-package-install successfully started
s6-rc: info: service init-mods-end: starting
s6-rc: info: service init-mods-end successfully started
s6-rc: info: service init-services: starting
s6-rc: info: service init-services successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun code-server (no readiness notification)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service 99-ci-service-check: starting
[ls.io-init] done.
s6-rc: info: service 99-ci-service-check successfully started
[2022-09-09T08:49:07.995Z] info  code-server 4.6.1 cb5093f095aeda0468348739a25214957152fd9c
[2022-09-09T08:49:07.996Z] info  Using user-data-dir ~/data
[2022-09-09T08:49:08.015Z] info  Using config file ~/.config/code-server/config.yaml
[2022-09-09T08:49:08.015Z] info  HTTP server listening on http://0.0.0.0:8443/ 
[2022-09-09T08:49:08.015Z] info    - Authentication is enabled
[2022-09-09T08:49:08.016Z] info      - Using password from $PASSWORD
[2022-09-09T08:49:08.016Z] info    - Not serving HTTPS 
[17:49:08] Extension host agent started.
[17:49:09] [172.17.0.1][dcb8bd57][ManagementConnection] New connection established.
[17:49:10] [172.17.0.1][fcfdd05d][ExtensionHostConnection] New connection established.
[17:49:10] [172.17.0.1][fcfdd05d][ExtensionHostConnection] <2979> Launched Extension Host Process.
[17:49:24] [172.17.0.1][dcb8bd57][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[17:49:24] [172.17.0.1][fcfdd05d][ExtensionHostConnection] <2979> Extension Host Process exited with code: 0, signal: null.
File not found: /app/code-server/lib/vscode/extensions/ipynb/dist/browser/ipynbMain.js
File not found: /app/code-server/lib/vscode/extensions/git-base/dist/browser/extension.js
File not found: /app/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js
File not found: /app/code-server/lib/vscode/extensions/emmet/dist/browser/emmetBrowserMain.js

@coolboy0961
Copy link

coolboy0961 commented Sep 11, 2022

According to this youtube video, I noticed that the code-server need the reverse proxy to support web socket.
So, I added the following settings to my reverse proxy, the error is gone!
https://mlohr.com/websockets-for-synology-dsm/

@Az0s
I think that if you add the websocket setting to your nginx setting, this error should go away.

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

server {
    listen 80;
    server_name jupyter.sample.domain;

    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection $connection_upgrade;

    location / {
        proxy_pass   http://jupyterlab:8888;
    }
}

@connor4312 connor4312 added the *out-of-scope Posted issue is not in scope of VS Code label Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-server Issues on the VS Code Server. *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

5 participants