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

error Please specify at least one file or folder

Open Playit3110 opened this issue 5 years ago • 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

Playit3110 avatar Mar 06 '21 13:03 Playit3110

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?

jsjoeio avatar Mar 08 '21 17:03 jsjoeio

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

Playit3110 avatar Mar 08 '21 17:03 Playit3110

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?

jsjoeio avatar Mar 08 '21 17:03 jsjoeio

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.

Playit3110 avatar Mar 08 '21 17:03 Playit3110

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?

jsjoeio avatar Mar 08 '21 17:03 jsjoeio

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

Playit3110 avatar Mar 08 '21 18:03 Playit3110

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

Can you please look at https://github.com/cdr/code-server/issues/2748? It sounds like that's what you're trying to achieve here?

jsjoeio avatar Mar 08 '21 18:03 jsjoeio

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.

Playit3110 avatar Mar 08 '21 18:03 Playit3110

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

Playit3110 avatar Mar 08 '21 18:03 Playit3110

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.

jsjoeio avatar Mar 08 '21 18:03 jsjoeio

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

Playit3110 avatar Mar 08 '21 18:03 Playit3110

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

jsjoeio avatar Mar 08 '21 18:03 jsjoeio

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

jsjoeio avatar Mar 08 '21 18:03 jsjoeio

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.

Playit3110 avatar Mar 08 '21 18:03 Playit3110

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.

Playit3110 avatar Mar 08 '21 18:03 Playit3110

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.

jsjoeio avatar Mar 08 '21 19:03 jsjoeio

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

Playit3110 avatar Mar 08 '21 19:03 Playit3110

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

Playit3110 avatar Mar 08 '21 19:03 Playit3110

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

Playit3110 avatar Mar 08 '21 19:03 Playit3110

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

jsjoeio avatar Mar 08 '21 20:03 jsjoeio