Code-server: automatic update from 3.1.0 to 3.1.1 failed

Created on 15 Apr 2020  路  10Comments  路  Source: cdr/code-server

Hello

  • I receive just now a message to apply update to 3.1.1
  • I click on apply
  • I receive a message "updated to 3.1.1"
  • a few minutes later, I receive the same message to apply update 3.1.1

After the "update to 3.1.1" message if I check my code-server version:
3.1.0 5aded14b87e017d32d080b686515f6a26be455f1

if a restart the sytemctl service for code-server the version is the same (3.1.0) and I continue to receive the message "apply update to 3.1.1"

could you help me?
@code-asher

Thank you
Capture d鈥櫭ヽran 2020-04-15 脿 23 01 04
Capture d鈥櫭ヽran 2020-04-15 脿 23 01 12

bug needs-investigation

Most helpful comment

Hi,
solution found :-)
=> folder /tmp/code-server was not accessible by the code-server user (permission dined)... :-(
I changed the permission to the temp folder and after that code-server was able to update to 3.1.1

thank you

All 10 comments

I'm getting the same error trying to update mine.

Hmm, I've been trying to replicate using the steps in https://github.com/cdr/code-server/issues/1513#issuecomment-613041017 (except I used 3.1.0 instead of 3.0.2) but it always works for me so far.

Do you see any output from code-server after applying the update? (If you're using systemd I imagine it'll be in the journal by default.)

According to that other issue you installed code-server in /var/www/code-server/ right? Do you see any other directories in there? It's supposed to rename the directory and then copy in the new files from the update so you should see something like code-server-3.1.0-linux-x86_64.1587056609700 which would be the old version.

thank you for the quick answer.
Hmm strange...
here is my complete config and installation:

My user is "gregoryweb" and my Home folder is "/var/www"
i create a folder "code-server" with "root" user in my Home directory

  gregoryweb@deb1:~$ ls -al
  -rw-------  1 gregoryweb gregoryweb 7278 avr 16 15:16 .bash_history
  drwxrwxrwx  4 gregoryweb gregoryweb 4096 avr  1 22:44 .cache
  drwxrwxrwx  4 root       root       4096 avr 15 23:35 code-server
  drwxrwxrwx  3 gregoryweb gregoryweb 4096 jan  3  2019 .config
  -rw-r--r--  1 gregoryweb gregoryweb   70 mar 21 14:10 .gitconfig
  -rw-------  1 gregoryweb gregoryweb   43 avr 15 23:46 .git-credentials
  drwxrwxrwx  3 root       root       4096 avr  2 21:08 .local
  drwxr-xr-x  6 gregoryweb gregoryweb 4096 avr 15 21:41 NodeJs
  drwxr-xr-x  6 gregoryweb gregoryweb 4096 avr 16 13:51 .npm
  -rw-------  1 gregoryweb gregoryweb   70 f茅v  3  2019 .npmrc
  drwx------  2 gregoryweb gregoryweb 4096 jan 28 20:10 .ssh
  -rw-r--r--  1 gregoryweb gregoryweb  376 avr  2 21:56 vscode_projects.json
  -rwxrwxrwx  1 gregoryweb gregoryweb  218 avr  2 20:52 .wget-hsts

I install "code-server 3-1-0" with "gregoryweb" user (download version and unzip) in "code-server" folder :

gregoryweb@deb1:~/code-server$ ls -al
total 16
drwxrwxrwx  4 root       root       4096 avr 15 23:35 .
drwxr-xr-x 15 gregoryweb gregoryweb 4096 avr 16 15:16 ..
drwxrwxrwx  7 gregoryweb gregoryweb 4096 avr  9 21:14 code-server-3.1.0-linux-x86_64
drwxr-xr-x  5 gregoryweb gregoryweb 4096 avr 15 23:51 code-server-data

here is the content of the folder "code-server-3.1.0-linux-x86_64":

gregoryweb@deb1:~/code-server/code-server-3.1.0-linux-x86_64$ ls -al
total 45056
drwxrwxrwx  7 gregoryweb gregoryweb     4096 avr  9 21:14 .
drwxrwxrwx  4 root       root           4096 avr 15 23:35 ..
-rwxrwxrwx  1 gregoryweb gregoryweb      189 avr  9 21:14 code-server
drwxrwxrwx  3 gregoryweb gregoryweb     4096 avr  9 21:13 dist
drwxrwxrwx  3 gregoryweb gregoryweb     4096 avr  9 21:12 lib
-rwxrwxrwx  1 gregoryweb gregoryweb     1084 avr  9 21:14 LICENSE.txt
-rwxrwxrwx  1 gregoryweb gregoryweb 45605784 avr  9 21:14 node
drwxrwxrwx 56 gregoryweb gregoryweb     4096 avr  9 21:14 node_modules
drwxrwxrwx  5 gregoryweb gregoryweb     4096 avr  9 21:13 out
-rwxrwxrwx  1 gregoryweb gregoryweb     2049 avr  9 21:14 package.json
-rwxrwxrwx  1 gregoryweb gregoryweb     1710 avr  9 21:14 README.md
drwxrwxrwx  5 gregoryweb gregoryweb     4096 avr  9 21:13 src
-rwxrwxrwx  1 gregoryweb gregoryweb   153148 avr  9 21:14 ThirdPartyNotices.txt
-rwxrwxrwx  1 gregoryweb gregoryweb   324598 avr  9 21:13 yarn.lock
gregoryweb@deb1:~/code-server/code-server-3.1.0-linux-x86_64$ 

I change the permissions to the code-server : chmod -R 777 ~/code-server
with the user "root" i create a "systemctl service file" : nano /lib/systemd/system/code-server.service

the content of this file is :

[Unit]
Description=code-server
After=nginx.service

[Service]
Type=simple
Environment=PASSWORD=xxx
ExecStart=/var/www/code-server/code-server-3.1.0-linux-x86_64/code-server --user-data-dir /var/www/code-server/code-server-data --auth password
Restart=always
User=gregoryweb

[Install]
WantedBy=multi-user.target

special attention to the path of "ExecStart" = /var/www/code-server/code-server-3.1.0-linux-x86_64/code-server
special attention to "User" = gregoryweb
(Maybe this path and this user are problems for update...???)

Finally I change the config in Nginx to make a reverse proxy:

server {

        #listen 80 default_server;
        #listen [::]:80 default_server;

        # SSL configuration
        #
        listen 443 ssl;
        listen [::]:443 ssl;
        ssl_certificate /etc/letsencrypt/live/code.gregvanko.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/code.gregvanko.com/privkey.pem;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name code.aaaaaaaaaaa.com;

        resolver 192.168.1.1;

        location / {
                set $target "http://localhost:8080";
                proxy_set_header Host $host;
                proxy_pass $target;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection upgrade;
                proxy_set_header Accept-Encoding gzip;
        }
        location ~ /\.ht {
                deny all;
        }
}

@code-asher where is my mistake?
Thank you very much for your help, I really appreciate to work with code-server

Hi,
solution found :-)
=> folder /tmp/code-server was not accessible by the code-server user (permission dined)... :-(
I changed the permission to the temp folder and after that code-server was able to update to 3.1.1

thank you

Ahhhh, /tmp is where it downloads and extracts the update. I'm glad you figured it out! I'll make a fix so it properly gives a good error message when that happens.

I'm still having getting 'update failed'. Have sudo chown -R coder:users /tmp The update seems to start running but ultimately failed. Are there any other directories that the update uses that might have the incorrect permissions?

Are you updating from 3.1.0 or a different version?

I'm not sure. I'm using a docker build and in Help -> About it shows:

Version: 1.43.2
Commit: e480f6527e11344a7c69b7cd024bce9379cea7f0
Date: 2020-04-01T23:37:57.354Z
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15

In the Docker container code-server is installed in /usr/local/lib so the coder user would need permissions there.

3.0.2 has a bug where it'll say update failed even though the update succeeded, but it should ask you to refresh the window and after that if you run code-server --version in the terminal you should see 3.1.1.

Can confirm ran sudo chown -R coder:users /usr/local/lib ran the update and after a little while got shown the 'Updated failed' message box then shortly after it asked me to refresh the page. Upon doing so ran code-server --version and was given 3.1.1. Thanks for the speedy response!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RealSlimMahdi picture RealSlimMahdi  路  3Comments

sa7mon picture sa7mon  路  3Comments

nol166 picture nol166  路  3Comments

avelino picture avelino  路  3Comments

korzq picture korzq  路  3Comments