Repository navigation
Description
- VSCode Version: Version 1.34.0-insider (1.34.0-insider) 473af338e1bd9ad4d9853933da1cd9d5d9e07dc9
- Local OS Version: MacOS Mojave 10.14.4 (18E226)
- Remote OS Version: PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian - Remote Extension/Connection Type: SSH
Steps to Reproduce:
-
Cmd-Shift-P,
Remote-SSH: Connect current window to host... -
Connection is successful. Remote tools are installed and server is running on remote:
$ ps -ef | grep code
root 281660 1 0 16:36 ? 00:00:00 sh /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/server.sh --port=0
root 281669 281660 5 16:36 ? 00:00:00 /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/node /root/.vscode-remote/bin/473af338e1bd9ad4d9853933da1cd9d5d9e07dc9/out/remoteExtensionHostAgent.js --port=0 -
Here's the full log:
SSH Resolver called for "ssh-remote+redacted.machinename.com"
SSH Resolver called for host: redacted.machinename.com
Setting up SSH remote "redacted.machinename.com"
Using commit id "473af338e1bd9ad4d9853933da1cd9d5d9e07dc9" and quality "insider" for server
Install and start server if needed
> Linux redacted.machinename.com 4.14.80 #4 SMP Tue Nov 13 16:27:02 EST 2018 x86_64
>
> mesg: ttyname failed:
> Inappropriate ioctl for device
> bash: cannot set terminal process group (281625): Inappropriate ioctl for device
> bash: no job control in this shell
> mesg: ttyname failed: Inappropriate ioctl for device
> Found existing installation...
> Printing the current remote environment...
> PYTHON_EGG_CACHE=/var/tmp/
> LC_ALL=en_US.utf8
> LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext
> SSH_CONNECTION=10.0.7.10 60630 10.0.29.202 22
> VERTICAINI=/etc/vertica.ini
> LANG=en_US.UTF-8
> HISTTIMEFORMAT=%D %T
> JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
> S_COLORS=auto
> USER=root
> PWD=/root
> HOME=/root
> SSH_CLIENT=10.0.7.10 60630 22
> https_proxy=http://proxy.redacteddomain.com:3128
> http_proxy=http://proxy.redacteddomain.com:3128
>
> no_proxy=localhost,127.0.0.1,10.*,172.16.*,192.168.*,redacteddomain.com
> MAIL=/var/mail/root
> SHELL=/bin/bash
> LS_OPTIONS=--color=auto
> TMOUT=3600
> SHLVL=3
> LANGUAGE=en_US
> TERMINFO=/lib/terminfo
> LOGNAME=root
> XDG_RUNTIME_DIR=/run/user/0
> PATH=/opt/vertica/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
> _=/usr/bin/printenv
> Starting agent...
> Waiting for server log...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> 1bab7624-76d1-4d65-9542-c072562363dd==42089==
"install" terminal command done
Received install output: 1bab7624-76d1-4d65-9542-c072562363dd==42089==
Server is listening on port 42089
Spawning tunnel with: ssh redacted.machinename.com -N -L localhost:9456:localhost:42089
Spawned SSH tunnel between local port 9456 and remote port 42089
Waiting for ssh tunnel to be ready
Tunneling remote port 42089 to local port 9456
Resolving "ssh-remote+redacted.machinename.com" to "localhost:9456", attempt: 1
The machine can be gotten to through ssh, obviously, since VSCode was able install and start the server. The server has internet access through a proxy, but there's a no_proxy that covers the IP space my laptop is in.
I've let it sit for over half an hour, and it never progresses any further.
If I can provide any further details, please let me know.
Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes
Update: The solution to my specific problem is explained here #84 (comment)

Activity
davidwin commentedon May 3, 2019
Is TCP forwarding enabled on the ssh server? I see the exact same issue where I am testing this and we have forwarding disabled for security reasons.
joeygibson commentedon May 3, 2019
There was nothing in
/etc/ssh/sshd_configenabling or disabling it, so I addedAllowTcpForwarding yesand restartedsshd, but it made no difference.davidwin commentedon May 3, 2019
Hm, have you tried the same ssh command with a different client port (i.e.
ssh redacted.machinename.com -N -L localhost:9457:localhost:42089) and then tried accessing the local port? When I do that, the ssh client reports that the operation is "administratively prohibited" or something like that. (Can't test now.)wqfan commentedon May 3, 2019
David Windehem (@davidwin) I have the same issue as Joey Gibson (@joeygibson). The tunnel was established:
When I tried to access
localhost:53777from browser, I got "Not Found" on the page.Also, VS Code shows an error at right-bottom:
joeygibson commentedon May 4, 2019
I ran
ssh redacted.machinename.com -N -L localhost:9457:localhost:42089and then thisroblourens commentedon May 4, 2019
Qingfan Wu (@wqfan) Do you know whether
AllowTcpForwardingis disabled?Also can you share the logs from the "Remote - SSH" output channel that might explain
Unauthorized client refused?roblourens commentedon May 4, 2019
Joey Gibson (@joeygibson) I don't understand, did you try to run a curl command or is that an error that was written?
wqfan commentedon May 4, 2019
roblourens I have
AllowTcpForwardingenabled. I believe my server is able to do TCP forwarding since I have been using SSH channel for other purposes.Here is the full output from "Remote - SSH" channel:
Logs from "Log (Window)" channel:
roblourens commentedon May 4, 2019
This warning sounds relevant, can you tell me about your remote OS? And possibly the output of
ps --version?wqfan commentedon May 4, 2019
roblourens Sure.
roblourens commentedon May 4, 2019
Qingfan Wu (@wqfan) please open another issue, I realized that you got through the SSH part successfully and
Unauthorized client refusedis a different sort of issue. We can continue debugging in another issue.wqfan commentedon May 4, 2019
roblourens Sounds good. I opened: #103
lars18th commentedon May 5, 2019
Hi,
I have the same problem. And after some debug in the server, I see this behaviour:
So, I suggest:
Regards.
16 remaining items
lars18th commentedon May 11, 2019
Hi,
The relevant part is this bug (log copied from the first post) is this:
See my comment at #103 (comment)
zbage commentedon May 16, 2019
server: centos
Failed to connect to the remote extension host server (Error: Connection error: Unauthorized client refused.)
Anudorannador commentedon May 17, 2019
Exactly the same for me : (
syockit commentedon May 18, 2019
Somehow these two values never match.
Forcing the signed data to be the same as the UUID made it work for me.
Ankit Chhabra (@achhabr1)
Please install newer libstdc++ and point LD_LIBRARY_PATH to there from your login script (.bashrc, but somehow in my workplace it was .bash_login)
P/S: While that solves running the node module, I now have problem starting the CPP extension because it requires a new libc, which cannot be easily overriden using LD_LIBRARY_PATH (due to relocation problem), but that is of course off-topic for this ticket.
PP/S: Well, managed to make the CPP extension work by unpacking newer glibc to somewhere local, renaming the extension binaries to something else and replace it with a script that runs the new glibc's ld.
roblourens commentedon May 19, 2019
The "unauthorized client refused" error is being tracked here: #103
I don't believe the OP in this issue is having the same issue, this issue should focus on whatever Joey Gibson (@joeygibson) is seeing which we haven't gotten to the bottom of.
Sorry for neglecting this issue, my best guess is still just that tcp forwarding is somehow disabled based on seeing
vscodebot commentedon May 26, 2019
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
joeygibson commentedon May 29, 2019
As multiple people suggested, the problem was, in fact, that TCP forwarding was blocked. I tried setting
AllowTcpForwarding=yesin/etc/ssh/sshd_configand restartingssh, but that didn't work. It turned out that-o AllowTcpForwarding=nowas present in/etc/default/ssh, which I didn't know to check. Once I removed that option and restartedssh, everything worked.lars18th commentedon May 29, 2019
No, quite the opposite in 99%!
The forwarding works but the listening port on the server is not running. That's why the connection fails. The real problem is just that: the logs don't print that the server is closed, and the connection through the forwarding fails because the end point is closed.
Cases like yours only represent 1%. But I'm glad you could work it out. 😉
RyanEwen commentedon May 29, 2019
Tried this on Centos 6 (WHM/cPanel server) without any luck.
Chuxel commentedon May 29, 2019
Ryan Ewen (@RyanEwen) CentOS 6 is due to outdated glibc and libstdc++ libraries in the distribution. That's being discussed in #103.
LiamMahoney commentedon Jun 20, 2019
Wondering if anyone has any suggestions/best practices concerning allowing TCP Forwarding? The environment I'm working in has set
AllowTcpForwardingto NO, and everyone I've reached out to seems hesitant on changing that setting. I've been looking into using theMatch User <username>withinsshd_configto limit TCP forwarding to my specific user which worked fine in testing. However, it was also suggested to me that I should be using thePermitOpenrule to limit the IPs and ports thatTCPForwardingwould work on. I haven't been able to figure out how to properly configure that setting to get my remote connection to work. Any suggestions?Here's an example of my sshd_config:
davidwin commentedon Jun 20, 2019
See if you can get acceptance for setting
AllowTcpForwardingtolocal, which adds very little risk since you have shell access already. At least for now it is sufficient to get VS Code working.If you're lucky, your IT department will see the value in developers using VS Code this way and will roll out a configuration change. It worked for me. :)
mrseanryan commentedon Jul 5, 2019
in case it helps anyone:
I add similar issue, with error like this:
I ran this command in Visual Code:
F1->Remote-SSH: Kill VS Code Server on Host...Then re-connecting in Visual Code worked OK.
It looks like the Visual Code host on server either got in a hung state OR could not be updated ....