Skip to content

Failure running code-server --link after upgrade to 3.10 #3342

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
pkufaraway opened this issue May 11, 2021 · 14 comments
Closed

Failure running code-server --link after upgrade to 3.10 #3342

pkufaraway opened this issue May 11, 2021 · 14 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@pkufaraway
Copy link

OS/Web Information

  • Web Browser: Chrome 90.0.4430.212
  • Local OS: WIN10
  • Remote OS: WSL Ubuntu 20.04 LTS
  • Remote Architecture: A Ubuntu WIN10 sub system on same computer
  • code-server --version: 3.10.0 6610bff

Steps to Reproduce

code-server --link just does not work for me, it was working in previous version, I updated to 3.10 this afternoon and it stopped working.

My command to update it:

curl -fsSL https://code-server.dev/install.sh | sh -s

Expected

A correctly running server

Actual

It failed starting the server.

Logs

@pkufaraway
Copy link
Author

Logs:

[2021-05-11T00:38:58.704Z] trace child:2522 got message {"message":{"type":"handshake","args":{"_":[],"bind-addr":"127.0.0.1:8080","auth":"none","password":"**********************","config":"/home/allenliu/.config/code-server/config.yaml","verbose":true,"link":{},"log":"trace","user-data-dir":"/home/allenliu/.local/share/code-server","extensions-dir":"/home/allenliu/.local/share/code-server/extensions","host":"localhost","port":0,"proxy-domain":[],"usingEnvPassword":false,"usingEnvHashedPassword":false}}}
[2021-05-11T00:38:58.707Z] info  code-server 3.10.0 6610bff3216c48fdd0884191338b1092765dbb5a
[2021-05-11T00:38:58.707Z] info  Using user-data-dir ~/.local/share/code-server
[2021-05-11T00:38:58.707Z] trace Using extensions-dir ~/.local/share/code-server/extensions
[2021-05-11T00:38:58.720Z] info  Using config file ~/.config/code-server/config.yaml
[2021-05-11T00:38:58.720Z] info  HTTP server listening on http://127.0.0.1:36103 (randomized by --link)
[2021-05-11T00:38:58.720Z] info    - Authentication is disabled (disabled by --link)
[2021-05-11T00:38:58.721Z] info    - Not serving HTTPS (disabled by --link)
[2021-05-11T00:38:58.721Z] debug running agent with bind,--code-server-addr=127.0.0.1:36103,
[2021-05-11T00:38:58.846Z] info  Failed to register server: Agent version () is incompatible. Version v0.2.1 or later is required. Try updating to the latest release at https://github.com/cdr/code-server/releases
[2021-05-11T00:38:58.848Z] error --link agent exited with 1
[2021-05-11T00:38:58.849Z] debug child:2522 disposing {}

Screenshot:
image

@ToasterSticks
Copy link

ToasterSticks commented May 11, 2021

Can confirm this is the case on Debian 9 as well with the latest version. Hopefully a relatively quick patch will be released like the previous one. image

@oxy
Copy link

oxy commented May 11, 2021

I'm investigating right now, I'll be working on it and will try to patch it over the next hours.

@jsjoeio jsjoeio added the bug Something isn't working label May 11, 2021
@jsjoeio jsjoeio added this to the v3.11.0 milestone May 11, 2021
@mtxweb
Copy link

mtxweb commented May 11, 2021

same problem for me. I had to reinstall 3.9.3

@yliu224
Copy link

yliu224 commented May 12, 2021

Same issue here

@oxy
Copy link

oxy commented May 12, 2021

This was because the version field was not set on v0.2.2 of cloud-agent.
I've released v0.2.3 to address this - this will be in a 3.10.1 patch release that will be out in the coming days, but until then, a quick fix would be to replace /usr/lib/code-server/lib/coder-cloud-agent with the latest release from https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH. ($OS is darwin for macOS / linux for linux, and $ARCH is amd64/arm64)

For example:
sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-linux-amd64" -o /usr/lib/code-server/lib/coder-cloud-agent

@oxy oxy pinned this issue May 12, 2021
@naseefalikp6273
Copy link

naseefali@NASEEFs-MacBook-Pro ~ % sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-linux-amd64" -o /usr/lib/code-server/lib/coder-cloud-agent
Password:
curl: (23) Failed writing body (0 != 943)

@naseefali
Copy link

sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-linux-amd64" -o /usr/lib/code-server/lib/coder-cloud-agent
Password:
curl: (23) Failed writing body (0 != 943)

@jsjoeio
Copy link
Contributor

jsjoeio commented May 13, 2021

@naseefalikp6273 it looks like you're on macOS so that won't work. If you installed code-server with homebrew then you need to run:
sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-darwin-amd64" -o /usr/local/Cellar/code-server/3.10.0/libexec/lib/coder-cloud-agent and type in your password.

@naseefali
Copy link

naseefali commented May 13, 2021

@naseefalikp6273 it looks like you're on macOS so that won't work. If you installed code-server with homebrew then you need to run:
sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-darwin-amd64" -o /usr/local/Cellar/code-server/3.10.0/libexec/lib/coder-cloud-agent and type in your password.

Yes I'm using Mac..

naseefali@NASEEFs-MacBook-Pro t_login % sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-darwin-amd64" -o /usr/local/Cellar/code-server/3.10.0/libexec/lib/coder-cloud-agent
Password:
naseefali@NASEEFs-MacBook-Pro t_login % code-server --link[2021-05-13T17:58:46.253Z] info code-server 3.10.0 f9b6d04
[2021-05-13T17:58:46.255Z] info Using user-data-dir ~/.local/share/code-server
[2021-05-13T17:58:46.269Z] info Using config file ~/.config/code-server/config.yaml
[2021-05-13T17:58:46.269Z] info HTTP server listening on http://127.0.0.1:62626 (randomized by --link)
[2021-05-13T17:58:46.269Z] info - Authentication is disabled (disabled by --link)
[2021-05-13T17:58:46.270Z] info - Not serving HTTPS (disabled by --link)
[2021-05-13T17:58:48.275Z] info Unfortunately we cannot ensure a good user experience with your connection latency (189ms). Efforts are underway to accommodate users in most areas.
[2021-05-13T17:58:48.278Z] error --link agent exited with 1
naseefali@NASEEFs-MacBook-Pro t_login %

@jsjoeio
Copy link
Contributor

jsjoeio commented May 13, 2021

For others, here's how you can figure out where code-server lives and how to fix it:

  1. where code-server this tells you where the bin folder is. on macOS, you get /usr/local/bin/code-server
  2. if you cat that file, you get something like this:
#!/bin/bash
PATH="/usr/local/opt/node@14/bin:$PATH" exec "/usr/local/Cellar/code-server/3.10.0/libexec/out/node/entry.js"  "$@"

Looking at the exec path, we see where code-server's files actually live.
3. Now if we cd into /usr/local/Cellar/code-server/3.10.0/libexec, we'll see a lib folder.
4. We can type cd lib and type ls and we'll see the coder-cloud-agent. Now we have the output path which we can use with that curl command suggested by @oxy

@jsjoeio
Copy link
Contributor

jsjoeio commented May 13, 2021

Unfortunately we cannot ensure a good user experience with your connection latency (189ms). Efforts are underway to accommodate users in most areas.

@naseefali this looks like a different error. My guess is because you are in India and we probably don't have a cluster close to you to ensure a fast connection latency.

@alliter8
Copy link

alliter8 commented May 16, 2021

I am getting the same error on Linux Mint 20.1:

sudo curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-linux-amd64" -o /usr/lib/code-server/lib/coder-cloud-agent
curl: (23) Failed writing body (0 != 1369)

@code-asher
Copy link
Member

code-asher commented May 17, 2021

The fixed version has been released in 3.10.1. 🎉

@jsjoeio jsjoeio unpinned this issue May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants