Skip to content

Reinstalled, and now can't load code-server, at all #2286

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
jpbberry opened this issue Nov 10, 2020 · 12 comments
Closed

Reinstalled, and now can't load code-server, at all #2286

jpbberry opened this issue Nov 10, 2020 · 12 comments

Comments

@jpbberry
Copy link

After reinstalling code-server to update, the page loads, but no longer can open the editor.
I've done some deep searching through all the libraries and things involved, and figured out that the browser is requesting a .js file from /lib/vscode/...
However the files in here are .ts. And so in the console you receive a 404 for a lot of files.
Going to the 404 url, and replacing .js with .ts, shows the file properly, however, obviously, this shouldn't be requesting the .js files in the first place.
Below is a screenshot of the networks tab of all these 404's showing up:
image
And here's a screenshot of the /lib/vscode/out/vs/common/base where the uri.js is supposed to be, and you can see it is instead here in a .ts
image
Everything in this directory is a .ts except performance.js and it's map.

I can also tell this is the issue but right clicking, opening the 404'd URL in the new tab, and replacing .js with .ts at the end of the file, which then shows the contents of the file properly.

Which also makes me super confused, because I know that code-server has pretty much always used typescript for it's frontend exports, but for some reason it's requesting for a .js file.
There ought to be something that I'm doing wrong, any help is appreciated, and hopefully this opens some insight into some ease-of-use installing fixes causing unexpected issues.

  • Web Browser: Chrome / Chromium
  • Local OS: Happens on Windows 10 and ChromeOS
  • Remote OS: Ubuntu 18.04.2 LTS
  • Remote Architecture: x86_64
  • code-server --version: 3.6.2
@code-asher
Copy link
Member

code-asher commented Nov 10, 2020 via email

@jpbberry
Copy link
Author

@code-asher
I just did this and yes the files are there,
and also just to note, the the workbench,web.api files did work for me in the original issue
But now running the node . in the code-server directory, still causes the exact same errors.
The .ts files are never compiled into .js and they always return a 404 upon loading the editor.

I've done it through the install script, I've done it through git and pulling code-server, but also the vscode repo, and now I've tried it from this tar. It's constantly the same error and no compiling every happens

@jpbberry
Copy link
Author

And also with the new install, the entire vscode/out folder is completely missing anyways, so of course it'll error, there's something up with how this thing is installed, I don't know changed but it worked beautifully a few months ago.

@jpbberry
Copy link
Author

image
here you can see me literally perfectly following the install guide, and it not working, and presenting the same errors.

@jpbberry
Copy link
Author

jpbberry commented Nov 10, 2020

In order to even get a temporary solution, I had to do way too much.
Here are the steps I took if anyone else is running into the same issue, and hopefully some sort of fix comes

  • Use the install script curl -fsSL https://code-server.dev/install.sh | sh to download code-server.

  • Create a directory called "vscode" (in the future this will be referenced in /usr/lib for me)

  • Git the vscode repository inside of this directory

    • git init and git remote add origin https://github.com/microsoft/vscode
    • git fetch
    • git merge 93c2f0f Merging with this commit because it's what code-server is meant to be using
  • Copy vscode/src to vscode/out (inside of directory) cp -r ./src ./out. This is to make sure all files non ts files are still present

  • Compile vscode's typescript into js.

    • Go into the vscode/src directory, and run tsc. This will take a while, but I promise it's working
    • Ensure everything compiled by going to /usr/lib/vscode/out/vs/base/common and running ls and make sure there are a bunch of .js files, expect .ts files too however.
  • Merge the two folders by running rsync -a /usr/lib/code-server/lib/vscode/ /usr/lib/vscode/
    Note: the reason I'm doing this backwards is because code-server has some other edited files, like yarn configs

  • Remove the old vscode from code-server by doing rm -r /usr/lib/code-server/lib/vscode

  • Now move the merged folder into code-server, by doing mv /usr/lib/vscode /usr/lib/code-server/lib/vscode

  • Now do your final install, inside the base code-server directory, run yarn, this will install dependencies for both code-server and vscode.

And that's it, should no longer receive errors while starting up nor receive 404's while trying to load, use code-server to start on up.

Regards,
I'm hoping this fixes issues but also brings awareness to a possible mess up within the installer process.
Even in the git it clearly states the commit that the vscode commit comes from, but look inside the downloaded files and you can see it's different.
Even if this issue is my fault somehow, I didn't do it on purpose, meaning anyone else could possibly run into whatever issue it is, so hopefully there's some improvement, maybe a fix or a warning about something going wrong which causes this.
Thanks

@code-asher
Copy link
Member

and now I've tried it from this tar. It's constantly the same error and no compiling every happens

The tar doesn't require compiling; it'll already be compiled. But if the browser is still requesting development files then I think it's probably either because of browser caching (does clearing the cache or using an incognito window help?) or because of a bug in the loader code.

I'm hoping this fixes issues but also brings awareness to a possible mess up within the installer process.

I think the installer is unlikely to be the issue; all it does is pull the release and unpack it for you, which we've both verified has the right files. But it could be a bug in the code itself that is responsible for fetching the right files from disk from the browser. It could be requesting the development files instead of the production ones for some reason.

In other issues I've seen users report that when running a prebuilt release the 404s show but the page still loads and works. Was that the case for you when you tried the tar?
#1759

It's also been reported to happen when workbench.web.api.js doesn't finish downloading (#2203 (comment)), so it's possible there is a timeout or error and then it falls back to trying the development assets instead. Does workbench.web.api.js fully load for you?

@jpbberry
Copy link
Author

probably either because of browser caching (does clearing the cache or using an incognito window help?) or because of a bug in the loader code.

The same thing happened across completely different machines, apps, browsers, and clearing cache didn't help. Leaving a possible loader issue.

I think the installer is unlikely to be the issue

I'm not sure exactly what the issue is, but from what I gathered it was just missing files, but regardless it trying to request these and failing should maybe log something, or describe what the issue could be. Cuz again it's not something I was purposely trying to do, so any user could possibly find this issue

In other issues I've seen users report that when running a prebuilt release the 404s show but the page still loads and works. Was that the case for you when you tried the tar?

The issue happened with both the tar, and with the install.sh code, both times it did the same thing.

It's also been reported to happen when workbench.web.api.js doesn't finish downloading

The workbench files were, and a few others, the only files that successfully loaded according to the network tab at least.

@code-asher
Copy link
Member

code-asher commented Nov 12, 2020 via email

@jpbberry
Copy link
Author

After a fresh restart of my system, the error seems to have gone away.
I have suspicions that it had something to do with NGINX, because it was acting very wonky.

I noticed that sometimes serving static files for my sites got cut in half randomly, restarting NGINX fixed that, but I didn't have time to take a look before restarting so I could be wrong in my thinking the same thing happened to code-server.

@code-asher
Copy link
Member

code-asher commented Nov 18, 2020 via email

@TheChemicalWorkshop
Copy link

TheChemicalWorkshop commented Aug 22, 2022

Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/common/lifecycle.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/common/network.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/parts/request/browser/request.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/common/resources.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/common/uri.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/platform/product/common/product.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/platform/window/common/window.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/common/path.js
Aug 22 19:31:49 api.thechemicalworkshop.com code-server[3978449]: File not found: /usr/lib/code-server/lib/vscode/out/vs/base/common/strings.js```

same issue

@code-asher
Copy link
Member

code-asher commented Aug 24, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants