coder/code-server

error Please specify at least one file or folder

Closed this issue ยท 27 comments

I had code-server installed and it worked already, but now i got this error
[2021-03-06T13:02:10.023Z] error Please specify at least one file or folder
and I have no idea how to solve it. Maybe someone else had the same problem and knows how to solve it.

OS:
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

yarn version v1.22.5

code-server:
version: 3.9.0

Hmm...it sounds like code-server is trying to open on your machine but can't find any files or folders. Are there any files or folders on your device?

Sure, a lot. Funny is, if i ssh into my Pi with my phone it works but if I try the same on my PC it gives me this error

Hmm...I've definitely seen this happen before but can't recall what fixed it. Okay let's do two things:

  1. Can you provide reproduction steps? Walk me through how you're starting/running code-server on your PC?
  2. When you run code-server run it with --log debug and paste the logs here?

It is really difficult because --log debug doesnt give any additional information and i dont know how i can explain it.

I open plain VSC and connect it with VSC-server with SSH and try to run ~/.yarn/bin/code-server

In VSC it doesnt work but with RaspController it works.

No worries on the logs.

I dont know how i can explain it.

Walk me through it like it's my first time ever using an editor/IDE. Here's an example if it helps.

I open plain VSC and connect it with VSC-server with SSH

Sorry, I'm a bit dense. What is VSC?

VSC = Visual Studio Code

I open VSC, connect VSC with the "Remote - SSH" extension over SSH with my pi and open a terminal, there i enter ~/.yarn/bin/code-server

On my phone I open the App RaspController, there I open the SSH-Shell and enter ~/.yarn/bin/code-server

On my phone does it work
On my PC it doesnt work

AH! You're trying to connect to code-server via the Remote - SSH extension.

Can you please look at #2748? It sounds like that's what you're trying to achieve here?

No no, they are independent. I just use the Terminal of Remote-SSH to start code-server, but that doesnt work.

I dont want to use the Terminal in Code-Server.

Ok, I just tried something different.

Instead of using Remote-SSH to start the process, I tried Putty and there it works too.

So it looks like it is a problem with the SSH connection over Remote-SSH

Great! Glad that worked.

So it looks like it is a problem with the SSH connection over Remote-SSH

Yeah I think this is a known issue that we're tracking here: So it looks like it is a problem with the SSH connection over Remote-SSH.

I tried Putty and there it works too.

Glad it's working! Going to close this issue now.

I think we missunderstood each other

I think you are thinking that I try to open Remote SSH in code-server, like in the comment you linked before but that is not my issue

So
code-server->Remote-SSH->code-server

But my problem is
VSCode->Remote-SSH->code-server

So I think the issue should stay open till we know, why this error exists and fires in the Terminal of VSCode but not in other SSH connections

Hmm...maybe we have misunderstood each other.

VSCode->Remote-SSH->code-server

If you're using VSCode, why do you need code-server? See comment

Reproduction Steps

Does this look right to you?

  1. Open VSCode on desktop
  2. Use the "Remote - SSH" extension to SSH into code-server host environment (where code-server is installed)
  3. Open a terminal and run ~/.yarn/bin/code-server

Expected

code-server should start running on host machine

Actual

error Please specify at least one file or folder

Because im not allways able to use VSCode if im not home and if i try something with code-server at home, I allways try to start the server with the builtin Terminal of VSCode and not with 3rd-party programms like Putty.

Thats why.
I found the bug by accident, when i tried to change some configs of code-server and looked if i could run them like they are and also if they would work.

Reproduction Steps

Does this look right to you?

  1. Open VSCode on desktop
  2. Use the "Remote - SSH" extension to SSH into code-server host environment (where code-server is installed)
  3. Open a terminal and run ~/.yarn/bin/code-server

Expected

code-server should start running on host machine

Actual

error Please specify at least one file or folder

That is what i meant. Sorry if I didnt explain it correctly.

No worries at all! I don't think you explained it incorrectly, more so you and I just trying to get on the same page.

I spoke someone about this and they said try running VSCODE_IPC_HOOK_CLI= code-server when you start code-server.

As a parameter? Like ~/.yarn/bin/code-server VSCODE_IPC_HOOK_CLI= code-server?

I looked in the code of the code-server executable and found the error

It shuts down, if you run code-server with no folderURIs or fileURIs

So maybe the reason is my config

Ok, I edited my config and tried it again and got the same error so it is not my config

Sorry I meant to say VSCODE_IPC_HOOK_CLI= ~/.yarn/bin/code-server

It seems like you have code-server installed globally with yarn so you could also just run VSCODE_IPC_HOOK_CLI= code-server

No difference

Okay I've been thinking about this and I think we should take a few steps back and ask, "What are we trying to solve?"

Access coding files from any machine and code with VS Code

Because im not allways able to use VSCode if im not home and if i try something with code-server at home,

Here's what I'm understanding. You want to be able to access you coding files and folders from any machine.

  • at home? Use VS Code + Remote SSH extension. SSH into your remote machine.
  • on the go? Use Raspberry Pi + code-server.

If you're on your PC at home with VS Code installed, then there's no need to use VSCode + Remote-SSH to access code-server. code-server is meant to take the VS Code client and put it in the browser (when normally it's only available as a desktop application). So running code-server from VS Code feels redundant (unless I'm misunderstanding something)?

Does that help at all?

Most of it is right but all my code is not on my PC but on my Pi, which I access over SSH from my PC.

     ,-->Where my Code is

PC--Pi--code-server--(Internet)--other-maschine

That is more how it is.

Great! Well I think in that case, you don't need to do VSCode->Remote-SSH->code-server. Just do VSCode->Remote-SSH. VSCode and code-server are basically the same thing.

This should also fix your issue.

I think for some specific scenario it is still necessary to do VSCode -> Remote-SSH -> code-server?
E.g. one might want to setup code-server for iPad, he/she may use VSCode Remote-SSH on a window desktop and do the setup work.

And looks like "sudo code-server" works for my case.

That's interesting, I also meet this question when i use VSCode Remote-SSH to init code-server.
It's not serious but confused. Thanks for your issue and I will use the openssh in CMD to init code-server.

bblgbr commented

Sorry I meant to say VSCODE_IPC_HOOK_CLI= ~/.yarn/bin/code-server

It seems like you have code-server installed globally with yarn so you could also just run VSCODE_IPC_HOOK_CLI= code-server

That's interesting, I also meet this question when i use VSCode Remote-SSH to init code-server. But I use this command and deal with the problem successfully.