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

zlib error with websocket compression enabled #3014

Closed
sweet-mentat opened this issue Apr 1, 2021 · 19 comments
Closed

zlib error with websocket compression enabled #3014

sweet-mentat opened this issue Apr 1, 2021 · 19 comments
Labels
needs-investigation This issue needs to be further investigated stale This issue has not had activity in a while and will be closed
Projects
Milestone

Comments

@sweet-mentat
Copy link

sweet-mentat commented Apr 1, 2021

OS/Web Information

  • Web Browser: Chrome Version 89.0.4389.90 (Official Build) (32-bit)
  • Local OS: Windows Server 2016 Datacenter
  • Remote OS: Ubuntu 18.04.5
  • Remote Architecture: Amazon EC2
  • code-server --version: v3.9.2

config.yaml:

Steps to Reproduce

  1. systemctl --user start code-server
  2. log into it from browser
  3. config.yaml at ~/.config/code-server/
    bind-addr: 127.0.0.1:9001
    auth: none
    cert: /usr/lib/code-server/cert.pem
    cert-key: /usr/lib/code-server/key.pem

Expected

journalctl:
Apr 01 15:16:16 ip-10---* systemd[11951]: Started code-server.
Apr 01 15:16:18 ip-10---* code-server[13218]: [2021-04-01T15:16:18.691Z] info code-server 3.8.1 41ad0c0
Apr 01 15:16:18 ip-10---* code-server[13218]: [2021-04-01T15:16:18.694Z] info Using user-data-dir ~/.local/share/code-server
Apr 01 15:16:18 ip-10---* code-server[13218]: [2021-04-01T15:16:18.734Z] info Using config file ~/.config/code-server/config.yaml
Apr 01 15:16:18 ip-10---* code-server[13218]: [2021-04-01T15:16:18.734Z] info HTTP server listening on http://127.0.0.1:9001
Apr 01 15:16:18 ip-10---* code-server[13218]: [2021-04-01T15:16:18.734Z] info - Authentication is disabled
Apr 01 15:16:18 ip-10---* code-server[13218]: [2021-04-01T15:16:18.734Z] info - Using certificate for HTTPS: /usr/lib/code-server/cert.pem

Actual

journalctl:
Mar 31 21:12:22 ip-10---* systemd[8572]: Started code-server.
Mar 31 21:12:23 ip-10---* code-server[26055]: [2021-03-31T21:12:23.935Z] info code-server 3.9.2 109d2ce
Mar 31 21:12:23 ip-10---* code-server[26055]: [2021-03-31T21:12:23.937Z] info Using user-data-dir ~/.local/share/code-server
Mar 31 21:12:23 ip-10---* code-server[26055]: [2021-03-31T21:12:23.970Z] info Using config file ~/.config/code-server/config.yaml
Mar 31 21:12:23 ip-10---* code-server[26055]: [2021-03-31T21:12:23.970Z] info HTTP server listening on http://127.0.0.1:9001
Mar 31 21:12:23 ip-10---* code-server[26055]: [2021-03-31T21:12:23.970Z] info - Authentication is disabled
Mar 31 21:12:23 ip-10---* code-server[26055]: [2021-03-31T21:12:23.970Z] info - Using certificate for HTTPS: /usr/lib/code-server/cert.pem
Mar 31 21:13:08 ip-10---* code-server[26055]: Error: invalid distance too far back
Mar 31 21:13:08 ip-10---* code-server[26055]: at Zlib.zlibOnError [as onerror] (zlib.js:180:17) {
Mar 31 21:13:08 ip-10---* code-server[26055]: errno: -3,
Mar 31 21:13:08 ip-10---* code-server[26055]: code: 'Z_DATA_ERROR'
Mar 31 21:13:08 ip-10---* code-server[26055]: }
Mar 31 21:13:08 ip-10---* code-server[26055]: [2021-03-31T21:13:08.418Z] warn vscode invalid distance too far back
Mar 31 21:13:18 ip-10---* code-server[26055]: [2021-03-31T21:13:18.326Z] error vscode Handshake timed out {"token":"7310faa7-c169-4ed7-9f78-73d1af8bbedf"}

Notes

This issue can be reproduced in VS Code: No

@sweet-mentat
Copy link
Author

In the browser, it hangs, then says that it cannot reconnect.

@lovetodream
Copy link

I have the same issues on a Raspberry Pi 4 with Debian using standard password authentication.

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Apr 1, 2021
@jsjoeio jsjoeio added this to Triage in code-server via automation Apr 1, 2021
@jsjoeio jsjoeio added this to the On Deck milestone Apr 1, 2021
@gbruno16
Copy link

gbruno16 commented Apr 2, 2021

Same issues on Termux for Android

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 2, 2021

@gbruno16 are you able to post reproduction steps? Might help with debugging as I have an Android I can test on.

@gbruno16
Copy link

gbruno16 commented Apr 2, 2021

I followed exactly the steps in https://github.com/cdr/code-server/blob/main/docs/install.md#termux on a fresh installation of Termux 0.108.
My device is a Huawei Matepad 10.4 (Android 10). Code server starts but after some seconds it disconnects and gives the same error reported above

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 2, 2021

Okay, thanks for the notes! Can you try running with code-server --log debug and posting the logs here?

@gbruno16
Copy link

gbruno16 commented Apr 3, 2021

I hope this is what you asked for:

[2021-04-03T09:27:04.844Z] info code-server 3.9.2 109d2ce
[2021-04-03T09:27:04.846Z] info Using user-data-dir ~/.local/share/code-server
[2021-04-03T09:27:04.872Z] info Using config file ~/.config/code-server/config.yaml
[2021-04-03T09:27:04.872Z] info HTTP server listening on http://127.0.0.1:8080
[2021-04-03T09:27:04.872Z] info - Authentication is enabled
[2021-04-03T09:27:04.872Z] info - Using password from ~/.config/code-server/config.yaml
[2021-04-03T09:27:04.872Z] info - Not serving HTTPS
Error: invalid distance too far back
at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
errno: -3,
code: 'Z_DATA_ERROR'
}
[2021-04-03T09:27:12.510Z] warn vscode invalid distance too far back
Error: invalid distance too far back
at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
errno: -3,
code: 'Z_DATA_ERROR'
}
[2021-04-03T09:27:21.239Z] warn vscode invalid distance too far back
[2021-04-03T09:27:22.481Z] error vscode Handshake timed out {"token":"6f236eec-8108-4bc6-a4b9-f16930416b93"}
Error: invalid distance too far back
at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
errno: -3,
code: 'Z_DATA_ERROR'
}
[2021-04-03T09:27:26.265Z] warn vscode invalid distance too far back
[2021-04-03T09:27:31.212Z] error vscode Handshake timed out {"token":"bda65549-df28-488d-9e7a-7891255812d9"}
ERR /data/data/com.termux/files/home/.local/share/code-server/extensions [Error: ENOENT: no such file or directory, scandir '/data/data/com.termux/files/home/.local/share/code-server/extensions'] {
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/data/data/com.termux/files/home/.local/share/code-server/extensions'
}
Error: invalid distance too far back
at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
errno: -3,
code: 'Z_DATA_ERROR'
}
[2021-04-03T09:27:33.999Z] warn vscode invalid distance too far back
[2021-04-03T09:27:36.072Z] error vscode Handshake timed out {"token":"c57e8aab-c55d-4194-ac89-ce4c618cad4b"}
[2021-04-03T09:27:43.652Z] error vscode Handshake timed out {"token":"2dafe5e3-5051-43b2-b015-119531d1c85d"}
ERR /data/data/com.termux/files/home/.local/share/code-server/extensions [Error: ENOENT: no such file or directory, scandir '/data/data/com.termux/files/home/.local/share/code-server/extensions'] {
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/data/data/com.termux/files/home/.local/share/code-server/extensions'
}

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 5, 2021

Perfect! Exactly what we needed. I've seen this same issue so you're not alone. Thanks for posting the logs! We'll look into this.

@EdgarAlonsoPerez
Copy link

Same problem here.
local device: raspberry Pi 3
remote device 1: Ipad (ipadOs 14.4.2)
Browsers that i used to test: Brave (Version 1.23.1 (21.2.24.16)), Safari, Chrome
code-server version: 3.9.2

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 8, 2021

Hi can you try upgrade to 3.9.3 and letting us know if you're still experiencing the same issue?

Feel free to post in the release discussion as well.

@lovetodream
Copy link

The issue is resolved after the update, at least for me. 👍

@sweet-mentat
Copy link
Author

sweet-mentat commented Apr 9, 2021

I updated, and received these errors in journalctl:
Apr 09 16:59:08 ip-10- systemd[10796]: Started code-server.
Apr 09 16:59:09 ip-10 code-server[30652]: [2021-04-09T16:59:09.769Z] info code-server 3.9.3 fe2dc2d
Apr 09 16:59:09 ip-10- code-server[30652]: [2021-04-09T16:59:09.772Z] info Using user-data-dir ~/.local/share/code-server
Apr 09 16:59:09 ip-10- code-server[30652]: [2021-04-09T16:59:09.838Z] info Using config file ~/.config/code-server/config.yaml
Apr 09 16:59:09 ip-10- code-server[30652]: [2021-04-09T16:59:09.838Z] info HTTP server listening on http://127.0.0.1:9001
Apr 09 16:59:09 ip-10- code-server[30652]: [2021-04-09T16:59:09.838Z] info - Authentication is disabled
Apr 09 16:59:09 ip-10- code-server[30652]: [2021-04-09T16:59:09.838Z] info - Using certificate for HTTPS: /usr/lib/code-server/cert.pem
Apr 09 16:59:16 ip-10- code-server[30652]: [2021-04-09T16:59:16.647Z] error vscode is not running Error: vscode is not running
Apr 09 16:59:16 ip-10- code-server[30652]: at VscodeProvider.send (/usr/lib/code-server/out/node/vscode.js:206:19)
Apr 09 16:59:16 ip-10- code-server[30652]: at VscodeProvider. (/usr/lib/code-server/out/node/vscode.js:198:30)
Apr 09 16:59:16 ip-10- code-server[30652]: at step (/usr/lib/code-server/out/node/vscode.js:63:23)
Apr 09 16:59:16 ip-10- code-server[30652]: at Object.next (/usr/lib/code-server/out/node/vscode.js:44:53)
Apr 09 16:59:16 ip-10- code-server[30652]: at fulfilled (/usr/lib/code-server/out/node/vscode.js:35:58)
Apr 09 16:59:16 ip-10- code-server[30652]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
Apr 09 16:59:16 ip-10- code-server[30652]: [2021-04-09T16:59:16.742Z] error vscode is not running Error: vscode is not running
Apr 09 16:59:16 ip-10- code-server[30652]: at VscodeProvider.send (/usr/lib/code-server/out/node/vscode.js:206:19)
Apr 09 16:59:16 ip-10- code-server[30652]: at VscodeProvider. (/usr/lib/code-server/out/node/vscode.js:198:30)
Apr 09 16:59:16 ip-10- code-server[30652]: at step (/usr/lib/code-server/out/node/vscode.js:63:23)
Apr 09 16:59:16 ip-10- code-server[30652]: at Object.next (/usr/lib/code-server/out/node/vscode.js:44:53)
Apr 09 16:59:16 ip-10- code-server[30652]: at fulfilled (/usr/lib/code-server/out/node/vscode.js:35:58)
Apr 09 16:59:16 ip-10- code-server[30652]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
Apr 09 16:59:25 ip-10- code-server[30652]: [2021-04-09T16:59:25.628Z] warn vscode Version mismatch (41ad0c0 instead of fe2dc2d)
Apr 09 16:59:26 ip-10- code-server[30652]: Error: invalid distance too far back
Apr 09 16:59:26 ip-10- code-server[30652]: at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
Apr 09 16:59:26 ip-10- code-server[30652]: errno: -3,
Apr 09 16:59:26 ip-10- code-server[30652]: code: 'Z_DATA_ERROR'
Apr 09 16:59:26 ip-10- code-server[30652]: }
Apr 09 16:59:26 ip-10- code-server[30652]: [2021-04-09T16:59:26.017Z] warn vscode invalid distance too far back
Apr 09 16:59:30 ip-10- code-server[30652]: [2021-04-09T16:59:30.711Z] warn vscode Version mismatch (41ad0c0 instead of fe2dc2d)
Apr 09 16:59:31 ip-10- code-server[30652]: [2021-04-09T16:59:31.609Z] warn vscode Version mismatch (41ad0c0 instead of fe2dc2d)
Apr 09 16:59:35 ip-10- code-server[30652]: [2021-04-09T16:59:35.992Z] error vscode Handshake timed out {"token":"9eb85fc6-f60b-47b5-973d-afb81ea6ae0d"}

So I updated vscode to 1.55.1-1617808414

Now I'm seeing these same errors:
Apr 09 17:04:49 ip-10 systemd[10796]: Started code-server.
Apr 09 17:04:50 ip-10 code-server[31198]: [2021-04-09T17:04:50.519Z] info code-server 3.9.3 fe2dc2d
Apr 09 17:04:50 ip-10 code-server[31198]: [2021-04-09T17:04:50.522Z] info Using user-data-dir ~/.local/share/code-server
Apr 09 17:04:50 ip-10 code-server[31198]: [2021-04-09T17:04:50.554Z] info Using config file ~/.config/code-server/config.yaml
Apr 09 17:04:50 ip-10 code-server[31198]: [2021-04-09T17:04:50.554Z] info HTTP server listening on http://127.0.0.1:9001
Apr 09 17:04:50 ip-10 code-server[31198]: [2021-04-09T17:04:50.554Z] info - Authentication is disabled
Apr 09 17:04:50 ip-10 code-server[31198]: [2021-04-09T17:04:50.554Z] info - Using certificate for HTTPS: /usr/lib/code-server/cert.pem
Apr 09 17:05:07 ip-10- code-server[31198]: Error: invalid distance too far back
Apr 09 17:05:07 ip-10- code-server[31198]: at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
Apr 09 17:05:07 ip-10- code-server[31198]: errno: -3,
Apr 09 17:05:07 ip-10- code-server[31198]: code: 'Z_DATA_ERROR'
Apr 09 17:05:07 ip-10- code-server[31198]: }
Apr 09 17:05:07 ip-10- code-server[31198]: [2021-04-09T17:05:07.305Z] warn vscode invalid distance too far back
Apr 09 17:05:17 ip-10- code-server[31198]: [2021-04-09T17:05:17.295Z] error vscode Handshake timed out {"token":"9866a080-0504-4e2e-a8c9-aa67b80da9d6"}

Also, code server version 3.9.1 works...

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 12, 2021

Interesting! Thanks for confirming @lovetodream

Thanks for the logs @sweet-mentat - we'll have to dig into this a bit more.

@jwh9456
Copy link

jwh9456 commented Apr 25, 2021

I'm getting the same issue,

4월 25 16:40:32 localhost.localdomain code-server[22661]: }
4월 25 16:40:32 localhost.localdomain code-server[22661]: [2021-04-25T07:40:32.905Z] warn vscode invalid distance too far back
4월 25 16:40:37 localhost.localdomain code-server[22661]: Error: invalid distance too far back
4월 25 16:40:37 localhost.localdomain code-server[22661]: at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
4월 25 16:40:37 localhost.localdomain code-server[22661]: errno: -3,
4월 25 16:40:37 localhost.localdomain code-server[22661]: code: 'Z_DATA_ERROR'
4월 25 16:40:37 localhost.localdomain code-server[22661]: }
4월 25 16:40:37 localhost.localdomain code-server[22661]: [2021-04-25T07:40:37.081Z] warn vscode invalid distance too far back
4월 25 16:40:42 localhost.localdomain code-server[22661]: [2021-04-25T07:40:42.873Z] error vscode Handshake timed out {"token":"5bdfbd05-25d1-4393-b17d-a9bfa576d4c0"}
4월 25 16:40:46 localhost.localdomain code-server[22661]: [2021-04-25T07:40:46.988Z] error vscode Handshake timed out {"token":"1fc5665a-a7f0-4f78-ad1a-37d5f7528314"}

I'm using SBC, Udoo X86 advanced with additional SSD, just on eMMC.
CentOS for OS.
I'm suspecting on I/O...

@code-asher code-asher self-assigned this Apr 26, 2021
@code-asher code-asher moved this from Triage to Next in code-server Apr 26, 2021
@code-asher code-asher modified the milestones: On Deck, v3.9.4 Apr 26, 2021
@julpod
Copy link

julpod commented May 1, 2021

Same here

[2021-04-30T18:01:15.424Z] warn  vscode Socket is closed
[2021-04-30T18:01:15.432Z] warn  vscode Socket is closed
[2021-04-30T18:01:15.447Z] warn  vscode Socket is closed
[2021-04-30T18:01:35.569Z] warn  vscode Socket is closed
[2021-04-30T18:05:21.106Z] warn  vscode Socket is closed
[2021-04-30T18:05:21.147Z] warn  vscode Socket is closed
[2021-04-30T18:13:39.670Z] warn  vscode Socket is closed
[2021-04-30T18:13:39.726Z] warn  vscode Socket is closed
[2021-04-30T18:13:39.726Z] warn  vscode Socket is closed
[2021-04-30T18:21:52.239Z] warn  vscode Socket is closed
[2021-04-30T18:21:52.290Z] warn  vscode Socket is closed
[2021-04-30T18:21:52.326Z] warn  vscode Socket is closed
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-30T19:11:45.236Z] warn  vscode invalid distance too far back
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-30T19:11:45.242Z] warn  vscode invalid distance too far back
[2021-04-30T19:11:45.297Z] warn  vscode Socket is closed
[2021-04-30T19:11:55.224Z] error vscode Handshake timed out {"token":"e663c03e-2467-4273-871a-114f8ff8f2ef"}
[2021-04-30T19:11:55.238Z] error vscode Handshake timed out {"token":"5260062d-86f6-4817-86a3-b0c614f32287"}
[2021-04-30T19:12:05.708Z] warn  vscode Socket is closed
[2021-04-30T19:21:39.486Z] warn  vscode Socket is closed
[2021-04-30T20:22:13.620Z] warn  vscode Socket is closed
[2021-04-30T20:41:02.546Z] warn  vscode Socket is closed
Error: invalid distance too far back
    at Zlib.zlibOnError [as onerror] (zlib.js:182:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}
[2021-04-30T20:49:34.521Z] warn  vscode invalid distance too far back
[2021-04-30T20:49:44.517Z] error vscode Handshake timed out {"token":"e225145c-f283-4221-a82d-62039fb89031"}

Running on k3s from the codercom/code-server:3.9.3 docker image.

@code-asher code-asher changed the title Getting zlib error when trying to connect to code server 3.9.2 with the browser zlib error with websocket compression enabled May 7, 2021
@code-asher code-asher modified the milestones: v3.9.4, v3.9.5 May 7, 2021
@code-asher
Copy link
Member

code-asher commented May 7, 2021

Just FYI for the next release we will be toggling websocket compression off by default so hopefully this resolves it for everyone. If not then the problem is something else.

@code-asher code-asher modified the milestones: v3.10.1, 3.11.0 May 17, 2021
@jsjoeio jsjoeio modified the milestones: 3.10.2, 3.11.0 May 21, 2021
@jsjoeio jsjoeio modified the milestones: 3.11.0, 3.12.0 Jul 19, 2021
@GirlBossRush
Copy link
Contributor

@code-asher @jsjoeio I believe this issue will be resolved in the vscode fork. While it’s currently disabled, zlib compression does appear to work in local testing if the configuration is negotiated by the client.

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 5, 2021

That's awesome to hear!

@code-asher code-asher removed their assignment Aug 12, 2021
@code-asher code-asher modified the milestones: 3.12.0, On Deck Aug 12, 2021
@stale
Copy link

stale bot commented Feb 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale This issue has not had activity in a while and will be closed label Feb 8, 2022
@stale stale bot closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-investigation This issue needs to be further investigated stale This issue has not had activity in a while and will be closed
Projects
No open projects
Development

No branches or pull requests

9 participants