microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 292 forks source link

Error: listen EACCES: permission denied 127.0.0.1 #4503

Closed antinmaze closed 3 years ago

antinmaze commented 3 years ago

Steps to Reproduce:

  1. install remote-ssh
  2. connecting to a remote ssh server

Does this issue occur when you try this locally?: No Does this issue occur when you try this locally and all extensions are disabled?: No

The connection fails with the following error: Error: listen EACCES: permission denied 127.0.0.1 and the remote vscode server seems to be executed without a specified port

$ps-def
... sh /home/xxxxxxx/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown --port=0 --connection-secret /home/xxxxxxx/.vscode-server/.622cb03f7e070a9670c94bae1a45d78d7181fbd4.token

... /home/xxxxxxx/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/node /home/xxxxxxx/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/out/vs/server/main.js --start-server --host=127.0.0.1 --enable-remote-auto-shutdown --port=0 --connection-secret /home/xxxxxxx/.vscode-server/.622cb03f7e070a9670c94bae1a45d78d7181fbd4.token

Here the VSCODE trace:

[00:11:55.707] Log Level: 1
[00:11:55.711] remote-ssh@0.64.0
[00:11:55.711] darwin x64
[00:11:55.713] SSH Resolver called for "ssh-remote+ssh.xxxxxx.hosting.elwood.net", attempt 1
[00:11:55.714] "remote.SSH.useLocalServer": true
[00:11:55.715] "remote.SSH.sshPath": undefined
[00:11:55.715] "remote.SSH.sshConfigurationFile": undefined
[00:11:55.715] "remote.SSH.useFlock": true
[00:11:55.715] "remote.SSH.lockfilesInTmp": false
[00:11:55.716] "remote.SSH.localServerDownload": auto
[00:11:55.716] "remote.SSH.remoteServerListenOnSocket": false
[00:11:55.716] "remote.SSH.showLoginTerminal": false
[00:11:55.716] "remote.SSH.defaultExtensions": []
[00:11:55.717] SSH Resolver called for host: ssh.cluster666.hosting.elwood.net
[00:11:55.717] Setting up SSH remote "ssh.xxxxxx.hosting.elwood.net"
[00:11:55.721] Acquiring local install lock: /var/folders/49/p1vzrfdx0f53lnq0ssp5clj80000gn/T/vscode-remote-ssh-ssh.xxxxxx.hosting.elwood.net-install.lock
[00:11:55.763] Looking for existing server data file at /Users/xxxxxx/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-ssh.xxxxxx.hosting.elwood.net-622cb03f7e070a9670c94bae1a45d78d7181fbd4-0.64.0/data.json
[00:11:55.784] Using commit id "622cb03f7e070a9670c94bae1a45d78d7181fbd4" and quality "stable" for server
[00:11:55.791] Install and start server if needed
[00:11:55.838] Checking ssh with "ssh -V"
[00:11:55.860] > OpenSSH_7.9p1, LibreSSL 2.7.3

[00:11:55.869] askpass server listening on /var/folders/49/p1vzrfdx0f53lnq0ssp5clj80000gn/T/vscode-ssh-askpass-1bf667bd8c95303b8af95be90254c4763303a274.sock
[00:11:55.870] Spawning local server with {"ipcHandlePath":"/var/folders/49/p1vzrfdx0f53lnq0ssp5clj80000gn/T/vscode-ssh-askpass-3086fd385d93f0ba1016e38c75b92bfedef2bfa2.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","59580","-o","ConnectTimeout=15","ssh.xxxxxx.hosting.elwood.net"],"dataFilePath":"/Users/myuser/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-ssh.xxxxxx.hosting.elwood.net-622cb03f7e070a9670c94bae1a45d78d7181fbd4-0.64.0/data.json"}
[00:11:55.870] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/49/p1vzrfdx0f53lnq0ssp5clj80000gn/T/vscode-ssh-askpass-1bf667bd8c95303b8af95be90254c4763303a274.sock"}
[00:11:55.874] Spawned 2916
[00:11:56.033] > local-server> Spawned ssh: 2917
[00:11:56.042] stderr> OpenSSH_7.9p1, LibreSSL 2.7.3
[00:11:56.043] stderr> debug1: Reading configuration data /Users/myuser/.ssh/config
[00:11:56.043] stderr> debug1: /Users/myuser/.ssh/config line 1: Applying options for ssh.cluster666.hosting.elwood.net
[00:11:56.043] stderr> debug1: Reading configuration data /etc/ssh/ssh_config
[00:11:56.043] stderr> debug1: /etc/ssh/ssh_config line 48: Applying options for *
[00:11:56.099] stderr> debug1: Connecting to ssh.cluster666.hosting.elwood.net [XX.XX.XX.XX0] port 22.
[00:11:56.135] stderr> debug1: fd 5 clearing O_NONBLOCK
[00:11:56.135] stderr> debug1: Connection established.
[00:11:56.135] stderr> debug1: identity file /Users/myuser/.ssh/id_rsa type -1
[00:11:56.135] stderr> debug1: identity file /Users/myuser/.ssh/id_rsa-cert type -1
[00:11:56.135] stderr> debug1: identity file /Users/myuser/.ssh/id_dsa type -1
[00:11:56.135] stderr> debug1: identity file /Users/myuser/.ssh/id_dsa-cert type -1
[00:11:56.135] stderr> debug1: identity file /Users/myuser/.ssh/id_ecdsa type -1
[00:11:56.136] stderr> debug1: identity file /Users/myuser/.ssh/id_ecdsa-cert type -1
[00:11:56.136] stderr> debug1: identity file /Users/myuser/.ssh/id_ed25519 type -1
[00:11:56.136] stderr> debug1: identity file /Users/myuser/.ssh/id_ed25519-cert type -1
[00:11:56.136] stderr> debug1: identity file /Users/myuser/.ssh/id_xmss type -1
[00:11:56.136] stderr> debug1: identity file /Users/myuser/.ssh/id_xmss-cert type -1
[00:11:56.137] stderr> debug1: Local version string SSH-2.0-OpenSSH_7.9
[00:11:56.137] stderr> debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1
[00:11:56.137] stderr> debug1: match: OpenSSH_7.4p1 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
[00:11:56.137] stderr> debug1: Authenticating to ssh.cluster666.hosting.elwood.net:22 as 'xxxxxxx'
[00:11:56.137] stderr> debug1: SSH2_MSG_KEXINIT sent
[00:11:56.153] stderr> debug1: SSH2_MSG_KEXINIT received
[00:11:56.153] stderr> debug1: kex: algorithm: curve25519-sha256
[00:11:56.154] stderr> debug1: kex: host key algorithm: ssh-ed25519
[00:11:56.154] stderr> debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
[00:11:56.154] stderr> debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
[00:11:56.156] stderr> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
[00:11:56.234] stderr> debug1: Server host key: ssh-ed25519 SHA256:9qMjj4nx0ZF5L0s9LGrxNY/riLL8geIh2MuAT/2DKrQ
[00:11:56.235] stderr> debug1: Host 'ssh.cluster666.hosting.elwood.net' is known and matches the ED25519 host key.
[00:11:56.235] stderr> debug1: Found key in /Users/myuser/.ssh/known_hosts:2
[00:11:56.239] stderr> debug1: rekey after 134217728 blocks
[00:11:56.239] stderr> debug1: SSH2_MSG_NEWKEYS sent
[00:11:56.240] stderr> debug1: expecting SSH2_MSG_NEWKEYS
[00:11:56.240] stderr> debug1: SSH2_MSG_NEWKEYS received
[00:11:56.240] stderr> debug1: rekey after 134217728 blocks
[00:11:56.240] stderr> debug1: Will attempt key: /Users/myuser/.ssh/id_rsa 
[00:11:56.240] stderr> debug1: Will attempt key: /Users/myuser/.ssh/id_dsa 
[00:11:56.240] stderr> debug1: Will attempt key: /Users/myuser/.ssh/id_ecdsa 
[00:11:56.240] stderr> debug1: Will attempt key: /Users/myuser/.ssh/id_ed25519 
[00:11:56.241] stderr> debug1: Will attempt key: /Users/myuser/.ssh/id_xmss 
[00:11:56.241] stderr> debug1: SSH2_MSG_EXT_INFO received
[00:11:56.241] stderr> debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
[00:11:56.317] stderr> debug1: SSH2_MSG_SERVICE_ACCEPT received
[00:11:56.335] stderr> debug1: Authentications that can continue: publickey,password
[00:11:56.335] stderr> debug1: Next authentication method: publickey
[00:11:56.335] stderr> debug1: Trying private key: /Users/myuser/.ssh/id_rsa
[00:11:56.335] stderr> debug1: Trying private key: /Users/myuser/.ssh/id_dsa
[00:11:56.335] stderr> debug1: Trying private key: /Users/myuser/.ssh/id_ecdsa
[00:11:56.335] stderr> debug1: Trying private key: /Users/myuser/.ssh/id_ed25519
[00:11:56.335] stderr> debug1: Trying private key: /Users/xxxxxxx/.ssh/id_xmss
[00:11:56.335] stderr> debug1: Next authentication method: password
[00:11:56.336] stderr> debug1: read_passphrase: can't open /dev/tty: Device not configured
[00:11:56.507] Got askpass request: {"request":"xxxxxxx@ssh.cluster666.hosting.elwood.net's password:"}
[00:11:56.508] Showing password prompt
[00:11:56.510] Listening for interwindow password on /var/folders/49/p1vzrfdx0f53lnq0ssp5clj80000gn/T/vscode-ssh-askpass-c41d0b0bc700563891fb1fde2acc9933553196d9.sock
[00:11:56.510] Writing password prompt to globalState
[00:12:09.263] Got password response
[00:12:09.263] Interactor gave response: ************
[00:12:09.264] Cleaning up other-window auth server
[00:12:09.323] stderr> debug1: Authentication succeeded (password).
[00:12:09.323] stderr> Authenticated to ssh.cluster666.hosting.elwood.net ([XX.XX.XX.XX0]:22).
[00:12:09.323] stderr> debug1: Local connections to LOCALHOST:59580 forwarded to remote address socks:0
[00:12:09.323] stderr> debug1: Local forwarding listening on ::1 port 59580.
[00:12:09.324] stderr> debug1: channel 0: new [port listener]
[00:12:09.324] stderr> debug1: Local forwarding listening on 127.0.0.1 port 59580.
[00:12:09.324] stderr> debug1: channel 1: new [port listener]
[00:12:09.324] stderr> debug1: channel 2: new [client-session]
[00:12:09.324] stderr> debug1: Requesting no-more-sessions@openssh.com
[00:12:09.324] stderr> debug1: Entering interactive session.
[00:12:09.325] stderr> debug1: pledge: network
[00:12:09.340] stderr> debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
[00:12:09.356] stderr> debug1: Sending environment.
...
[00:12:09.393] > ready: f93ef016adea
[00:12:09.412] > Linux 4.14.154-elwood-vps-grsec-zfs-classid #1 SMP Wed Nov 13 11:24:26 CET 2019
[00:12:09.413] Platform: linux
[00:12:09.464] > f93ef016adea: running
[00:12:09.483] > Acquiring lock on /home/xxxxxxx/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/vscode-remote-lock.xxxxxxx.622cb03f7e070a9670c94bae1a45d78d7181fbd4
[00:12:09.485] > Found existing installation at /home/xxxxxxx/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4...
[00:12:09.485] > Checking /home/xxxxxxx/.vscode-server/.622cb03f7e070a9670c94bae1a45d78d7181fbd4.log and /home/xxxxxxx/.vscode-server/.622cb03f7e070a9670c94bae1a45d78d7181fbd4.pid for a running server
[00:12:09.486] > Looking for server with pid: 15342
[00:12:09.491] > Starting server with command... /home/xxxxxxx/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown  --port=0  &> "/home/xxxxxxx/.vscode-server/.622cb03f7e070a9670c94bae1a45d78d7181fbd4.log" < /dev/null
> printenv:
[00:12:09.492] >     SHELL=/bin/elwood_ssh
>     HISTTIMEFORMAT=[%F %T] 
>     PWD=/home/xxxxxxx
>     LOGNAME=xxxxxxx
>     HOME=/home/xxxxxxx
>     USERNAME=
>     LANG=fr_FR.UTF-8
>     LS_COLORS=
>     VSCODE_AGENT_FOLDER=/home/xxxxxxx/.vscode-server
>     SSH_CONNECTION=XX.XX.XX.XX 59582 XX.XX.XX.XX0 22
>     USER=xxxxxxx
>     SHLVL=1
>     BASH_ENV=/home/xxxxxxx/.bashrc
>     SSH_CLIENT=XX.XX.XX.XX 59582 22
>     elwood_ENVIRONMENT=development
>     TMOUT=300
>     PATH=/usr/local/bin:/usr/bin:/bin:/home/xxxxxxx/bin
>     elwood_APP_ENGINE_VERSION=3.8
>     elwood_APP_ENGINE=wsgi
>     MAIL=/var/mail/xxxxxxx
>     _=/usr/bin/printenv
[00:12:09.502] > Spawned remote server: 27089
[00:12:09.504] > Waiting for server log...
.......
[00:12:17.003] > Waiting for server log...
[00:12:17.036] >  
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
[00:12:17.036] > *
>  
[00:12:17.040] > Server did not start successfully. Full server log at /home/xxxxxxx/.vscode-server/.622cb03f7e070a9670c94bae1a45d78d7181fbd4.log >>>
[00:12:17.041] > [23:12:09] Extension host agent started.
> [23:12:09] Error occurred in server
> [23:12:09] Error: listen EACCES: permission denied 127.0.0.1
>     at Server.setupListenHandle [as _listen2] (net.js:1296:21)
>     at listenInCluster (net.js:1361:12)
>     at doListen (net.js:1498:7)
>     at processTicksAndRejections (internal/process/task_queues.js:85:21) {
>   code: 'EACCES',
>   errno: 'EACCES',
>   syscall: 'listen',
>   address: '127.0.0.1'
> }
> <<< End of server log
> f93ef016adea: start
> exitCode==32==
> listeningOn====
> osReleaseId==debian==
[00:12:17.042] > arch==x86_64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime==7541==
> f93ef016adea: end
[00:12:17.042] Received install output: 
exitCode==32==
listeningOn====
osReleaseId==debian==arch==x86_64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==7541==

[00:12:17.043] Terminating local server
[00:12:17.053] Resolver error: Error: The VS Code Server failed to start
    at Function.ServerInstallError (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:64057)
    at c (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:58602)
    at Object.t.handleInstallOutput (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:62898)
    at Object.t.tryInstallWithLocalServer (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:405581)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:310867
    at async Object.t.withShowDetailsEvent (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:406337)
    at async /Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:404105
    at async S (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:400873)
    at async Object.t.resolveWithLocalServer (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:403732)
    at async Object.t.resolve (/Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:1:314879)
    at async /Users/myuser/.vscode/extensions/ms-vscode-remote.remote-ssh-0.64.0/out/extension.js:127:110431
[00:12:17.056] Local server exit: 15
[00:12:17.058] TELEMETRY: {"eventName":"resolver","properties":{"osReleaseId":"debian","arch":"x86_64","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","remoteInConfigFile":"1","gotUnrecognizedPrompt":"0","dynamicForwarding":"1","localServer":"1","didLocalDownload":"0","installUnpackCode":"0","outcome":"failure","reason":"ExitCode","exitCodeLabel":"ServerFailedToStart"},"measures":{"exitCode":32,"resolveAttempts":1,"retries":1,"timing.totalResolveTime":21334,"timing.preSshTime":157,"timing.establishSshTime":13594}}
[00:12:17.061] ------
bamurtaugh commented 3 years ago

Hey @antoinemaze - are you able to SSH into your host via an external terminal (i.e. the permission denied error only occurs when using Remote-SSH in VS Code)?

antinmaze commented 3 years ago

Hi, no issue with standard ssh connection using the macos terminal.

roblourens commented 3 years ago

Is this still an issue? We are trying to open a port, is there some reason you wouldn't have permission to do that? listen EACCES: permission denied 127.0.0.1