code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Restart service after upgrading

Open kuhar opened this issue 3 years ago • 11 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome 98
  • Local OS: Chrome OS 98
  • Remote OS: Debian; Kernel 4.15.15
  • Remote Architecture: amd64
  • code-server --version: 4.1.0

Steps to Reproduce

  1. Install vscode 3.12.0. Verify that it launches.
  2. Install vscode 4.0.1 or 4.1.0 and attempt to launch.

(This is using the default installation script.)

Expected

Upgraded vscode launches.

Actual

The webpage shows: ENOENT: no such file or directory, open '/usr/lib/code-server/src/browser/pages/vscode.html'

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code?

  • [X] I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

Downgrading back to 3.12.0 resolves the issue.

kuhar avatar Mar 15 '22 18:03 kuhar

Install vscode 3.12.0. Verify that it launches.

I'm assuming hear you meant code-server.

browser/pages/vscode.html

No longer exists in 4.1.0 so this is expected. Can you share the install logs?

And can you share a screenshot and more information about how you're accessing/running code-server? What happens when you go to the root?

jsjoeio avatar Mar 15 '22 18:03 jsjoeio

Thanks for a quick reply, @jsjoeio!

I'm assuming hear you meant code-server.

My vscode version is 1.63.2.

No longer exists in 4.1.0 so this is expected. Can you share the install logs?

The install output was:

$ curl -fsSL https://code-server.dev/install.sh | sh                                   
                                                                                       
Debian GNU/Linux
Installing v4.1.0 of the amd64 deb package from GitHub.                                
                                                                                                                                                                               
+ mkdir -p ~/.cache/code-server                                                                                                                                                
+ curl -#fL -o ~/.cache/code-server/code-server_4.1.0_amd64.deb.incomplete -C - https://github.com/coder/code-server/releases/download/v4.1.0/code-server_4.1.0_amd64.deb      
######################################################################## 100.0%                                                                                                
+ mv ~/.cache/code-server/code-server_4.1.0_amd64.deb.incomplete ~/.cache/code-server/code-server_4.1.0_amd64.deb                                                              
+ sudo dpkg -i ~/.cache/code-server/code-server_4.1.0_amd64.deb                                                                                                                
[sudo] password for kubak:                                                                                                                                                     
(Reading database ... 558562 files and directories currently installed.)               
Preparing to unpack .../code-server_4.1.0_amd64.deb ...                                
Unpacking code-server (4.1.0) over (3.12.0) ...                                        
Setting up code-server (4.1.0) ...                                                                                                                                             
                                           
deb package has been installed.                                                                                                                                                
                                                                                                                                                                               
To have systemd start code-server now and restart on boot:                             
  sudo systemctl enable --now code-server@$USER                                        
Or, if you don't want/need a background service you can run:                           
  code-server    

And can you share a screenshot and more information about how you're accessing/running code-server? What happens when you go to the root?

I ran the systemcl command printed and then accessed the code-server via http://127.0.0.1:/49369.

My config file is:

bind-addr: localhost:49369
auth: none
cert: false
disable-telemetry: true
extensions-dir: $HOME/.vscode/extensions
user-data-dir: $HOME/.config/Code

(with shell variables expanded)

What do you mean by 'go to the root`?

image

kuhar avatar Mar 15 '22 19:03 kuhar

Thanks for all the details! I doubt this is related, but what happens if you try clearing your cache and navigate to http://localhost:49369/login?

jsjoeio avatar Mar 15 '22 19:03 jsjoeio

How can I clean the cache?

kuhar avatar Mar 15 '22 19:03 kuhar

A couple options:

  • https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn
  • https://otechworld.com/hard-refresh-chrome-browser/

jsjoeio avatar Mar 15 '22 20:03 jsjoeio

Ah, I thought you wanted me to clear the code-server's cache on the remote machine.

I ran this in an incognito tab and it didn't help.

But restarting the service did the trick: sudo systemctl restart code-server@$USER. Perhaps this could be added to the installation script's output when it detects an upgrade?

kuhar avatar Mar 15 '22 20:03 kuhar

Ah, I thought you wanted me to clear the code-server's cache on the remote machine.

Ahhhh! My fault - I should have been more specific. Sorry about that!

But restarting the service did the trick: sudo systemctl restart code-server@$USER. Perhaps this could be added to the installation script's output when it detects an upgrade?

Nice find 🙌🏼 @code-asher thoughts?

jsjoeio avatar Mar 15 '22 20:03 jsjoeio

We should either add this to the installation script like @kuhar suggests (in which case this is a bug) or we update the Troubleshooting docs.

jsjoeio avatar Mar 15 '22 20:03 jsjoeio

Restarting after upgrade sounds reasonable to me.

code-asher avatar Mar 17 '22 17:03 code-asher

Oh I was thinking automatically but just adding to the output is even easier.

code-asher avatar Mar 17 '22 17:03 code-asher

Ran into this same issue when upgrading from an old 3.x version - running sudo systemctl restart code-server@$USER gave me:

Warning: The unit file, source configuration file or drop-ins of [email protected] changed on disk. Run 'systemctl daemon-reload' to reload units.`

Just restarted the whole machine and that fixed it.

josephrocca avatar Aug 07 '23 04:08 josephrocca