Skip to content
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

cannot attach to process #10678

Open
6 tasks done
imre84 opened this issue Feb 3, 2025 · 2 comments
Open
6 tasks done

cannot attach to process #10678

imre84 opened this issue Feb 3, 2025 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@imre84
Copy link

imre84 commented Feb 3, 2025

Is there an existing issue for this bug?

  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.

Required Troubleshooting Steps

  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar

[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I COULD successfully SSH to the remote machine with the generated SSH command

Remote-SSH Log

ssh log ouput

[16:04:24.389] Log Level: 2
[16:04:24.410] SSH Resolver called for "ssh-remote+xtmsc1", attempt 1
[16:04:24.412] remote.SSH.useLocalServer = false
[16:04:24.413] remote.SSH.useExecServer = true
[16:04:24.413] remote.SSH.showLoginTerminal = false
[16:04:24.413] remote.SSH.remotePlatform = {"xtmsc1":"linux"}
[16:04:24.413] remote.SSH.path = undefined
[16:04:24.413] remote.SSH.configFile = undefined
[16:04:24.413] remote.SSH.useFlock = true
[16:04:24.413] remote.SSH.lockfilesInTmp = false
[16:04:24.413] remote.SSH.localServerDownload = auto
[16:04:24.413] remote.SSH.remoteServerListenOnSocket = false
[16:04:24.413] remote.SSH.defaultExtensions = []
[16:04:24.413] remote.SSH.loglevel = 2
[16:04:24.413] remote.SSH.enableDynamicForwarding = true
[16:04:24.413] remote.SSH.enableRemoteCommand = false
[16:04:24.413] remote.SSH.serverPickPortsFromRange = {}
[16:04:24.413] remote.SSH.serverInstallPath = {}
[16:04:24.413] remote.SSH.permitPtyAllocation = false
[16:04:24.413] remote.SSH.preferredLocalPortRange = undefined
[16:04:24.413] remote.SSH.useCurlAndWgetConfigurationFiles = false
[16:04:24.414] remote.SSH.experimental.chat = false
[16:04:24.414] remote.SSH.experimental.enhancedSessionLogs = false
[16:04:24.422] VS Code version: 1.96.4
[16:04:24.422] Remote-SSH version: [email protected]
[16:04:24.422] win32 x64
[16:04:24.429] SSH Resolver called for host: xtmsc1
[16:04:24.429] Setting up SSH remote "xtmsc1"
[16:04:24.437] Using commit id "cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba" and quality "stable" for server
[16:04:24.443] Script variables:
 {
  "ExitCode.0": "OK",
  "ExitCode.64": "LinuxPrereqs",
  "ExitCode.65": "ProxyAuthenticationRequired",
  "ExitCode.128": "UnparsableOutput",
  "ExitCode.129": "EmptyOutput",
  "ExitCode.131": "UnhandledResolverExitCode",
  "ExitCode.132": "OfflineError",
  "ExitCode.133": "SshInstall",
  "ExitCode.134": "FindLocalPort",
  "ExitCode.135": "Timeout",
  "ExitCode.136": "ExhaustedRetries",
  "ExitCode.137": "PermissionDenied",
  "ExitCode.138": "MitmPortForwardingDisabled",
  "ExitCode.139": "Canceled",
  "ExitCode.140": "BadLocalDownloadRequest",
  "ExitCode.141": "LocalDownloadFailed",
  "ExitCode.142": "LocalLockTimeout",
  "ExitCode.143": "NoBash",
  "ExitCode.144": "InvalidHostName",
  "ExitCode.145": "BadInstallScriptResult",
  "ExitCode.146": "ShellRequestFailedOnChannel",
  "ExitCode.147": "InvalidPortRange",
  "ExitCode.148": "SendDisconnectBrokenPipe",
  "ExitCode.149": "LocalServerCrashed",
  "ExitCode.150": "NoFreePortInRange",
  "ExitCode.151": "InvalidCustomServerPath",
  "ExitCode.192": "AlreadyInProgress",
  "ExitCode.193": "ServerDownloadFailed",
  "ExitCode.194": "NoDownloaderAvailable",
  "ExitCode.195": "NoDownloaderAvailableForStatusCheck",
  "ExitCode.196": "UnsupportedArch",
  "ExitCode.197": "StatusCheckFailed",
  "ExitCode.198": "NeedInsidersArch",
  "ExitCode.199": "ServerTransferFailed",
  "ExitCode.200": "ServerFailedToStart",
  "ExitCode.201": "NeedInsidersWindows",
  "ExitCode.202": "CreateInstallDirFailed",
  "ExitCode.203": "UnsupportedPlatform",
  "ExitCode.204": "ServerTerminatedCVE20201416",
  "ExitCode.205": "UnpackFailed",
  "ExitCode.206": "ChangeDirFailed",
  "ExitCode.1023": "UnclassifiedError",
  "ExitCode.OK": "0",
  "ExitCode.LinuxPrereqs": "64",
  "ExitCode.ProxyAuthenticationRequired": "65",
  "ExitCode.UnparsableOutput": "128",
  "ExitCode.EmptyOutput": "129",
  "ExitCode.UnhandledResolverExitCode": "131",
  "ExitCode.OfflineError": "132",
  "ExitCode.SshInstall": "133",
  "ExitCode.FindLocalPort": "134",
  "ExitCode.Timeout": "135",
  "ExitCode.ExhaustedRetries": "136",
  "ExitCode.PermissionDenied": "137",
  "ExitCode.MitmPortForwardingDisabled": "138",
  "ExitCode.Canceled": "139",
  "ExitCode.BadLocalDownloadRequest": "140",
  "ExitCode.LocalDownloadFailed": "141",
  "ExitCode.LocalLockTimeout": "142",
  "ExitCode.NoBash": "143",
  "ExitCode.InvalidHostName": "144",
  "ExitCode.BadInstallScriptResult": "145",
  "ExitCode.ShellRequestFailedOnChannel": "146",
  "ExitCode.InvalidPortRange": "147",
  "ExitCode.SendDisconnectBrokenPipe": "148",
  "ExitCode.LocalServerCrashed": "149",
  "ExitCode.NoFreePortInRange": "150",
  "ExitCode.InvalidCustomServerPath": "151",
  "ExitCode.AlreadyInProgress": "192",
  "ExitCode.ServerDownloadFailed": "193",
  "ExitCode.NoDownloaderAvailable": "194",
  "ExitCode.NoDownloaderAvailableForStatusCheck": "195",
  "ExitCode.UnsupportedArch": "196",
  "ExitCode.StatusCheckFailed": "197",
  "ExitCode.NeedInsidersArch": "198",
  "ExitCode.ServerTransferFailed": "199",
  "ExitCode.ServerFailedToStart": "200",
  "ExitCode.NeedInsidersWindows": "201",
  "ExitCode.CreateInstallDirFailed": "202",
  "ExitCode.UnsupportedPlatform": "203",
  "ExitCode.ServerTerminatedCVE20201416": "204",
  "ExitCode.UnpackFailed": "205",
  "ExitCode.ChangeDirFailed": "206",
  "ExitCode.UnclassifiedError": "1023",
  "InstallUnpackCode.Success": "success",
  "InstallUnpackCode.Error": "error",
  "InstallUnpackCode.MissingFiles": "missingFiles",
  "uuid": "08e7b134cd94",
  "startMarker": "08e7b134cd94: running",
  "commitId": "cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba",
  "quality": "stable",
  "token": "11111111-1111-11a1-a111-a1a11aa11a1a",
  "vscodeAgentFolder": "$HOME/.vscode-server",
  "allowClientDownload": "1",
  "forceClientDownload": "0",
  "cliNameInArchive": "code",
  "ignoreWgetConfigFlag": " --no-config ",
  "ignoreCurlConfigFlag": " --disable ",
  "wgetTriesSegment": "--tries=1",
  "listenArgs": "--on-host=127.0.0.1 --on-port",
  "getDownloadServerStartTrigger": "08e7b134cd94:trigger_server_download",
  "getDownloadServerEndTrigger": "08e7b134cd94:trigger_server_download_end",
  "getProgressDownloading": "08e7b134cd94%%1%%",
  "getProgressInstalling": "08e7b134cd94%%2%%",
  "printVars": "echo \"SSH_AUTH_SOCK==$SSH_AUTH_SOCK==\"\necho \"DISPLAY==$DISPLAY==\""
}
[16:04:24.446] Install and start server if needed
[16:04:24.449] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"
[16:04:24.453] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT
[16:04:24.453] Checking ssh with "C:\WINDOWS\ssh.exe -V"
[16:04:24.455] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT
[16:04:24.456] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"
[16:04:24.457] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT
[16:04:24.457] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[16:04:24.458] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[16:04:24.458] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[16:04:24.488] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

[16:04:24.493] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 52168 xtmsc1 sh
[16:04:24.494] Generated SSH command: 'type "C:\Users\pentek\AppData\Local\Temp\vscode-linux-multi-line-command-xtmsc1-355874009.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 52168 xtmsc1 sh'
[16:04:24.495] Using connect timeout of 17 seconds
[16:04:24.496] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:04:24.750] > 
[16:04:24.751] Got some output, clearing connection timeout
[16:04:25.516] > 08e7b134cd94: running
> Script executing under PID: 27022
[16:04:25.530] > Found existing installation at /home/ktmroot/.vscode-server...
> Starting VS Code CLI...
> printenv:
>     CRDIR=/usr/ktm
>     XDG_SESSION_ID=215706
>     IDENTDIR=/usr/ktm/src/ident
>     IECINCLUDE=/usr/ktm/src/include/iec
>     FLAGDIR=/usr/ktm/lib
>     SELINUX_ROLE_REQUESTED=
>     SUBRLIB=subr
>     KTMSYSMODE_NONE=3
>     SHELL=/bin/bash
>     ORACLE_HOME2=/u01/app/oracle/product/19_19
>     SSH_CLIENT=192.168.88.13 52169 22
>     NLS_LANG=AMERICAN_AMERICA.EE8ISO8859P2
>     SELINUX_USE_CURRENT_RANGE=
>     SUBRLIBDIR=/usr/ktm/lib
>     UTILLOG=/usr/ktm/log
>     CRMAINVER=1.1
>     KTMSETIN=/usr/ktm/data/Command/Set
>     KTM_PWDEXPWARN=15
>     SUBRINCLUDE=/usr/ktm/src/include
>     CRDD_DEFAULT=CRDD_ROOT.KTM
>     CRBIN=/usr/ktm/bin
>     KTMMODE=0
>     ORACLE_BASE2=/u01/app/oracle/product/19_19
>     USER=ktmroot
>     CRINCLUDE=/usr/ktm/src/include
>     KTMPROC_CFG=/usr/ktm/src/oracle/ktmproc.cfg
>     KTM_PWDEXPDWARN=5
>     LD_LIBRARY_PATH=/u01/app/oracle/product/12.2.0/client_1/lib:/u01/app/oracle/
> /product/19_19:
>     CRDD_DIRECTORY=/usr/ktm/crdb/struct
>     KTMOWNER=ktmroot
>     ORACLE_SID=xtmdb
>     KTMDB=xtmdb2
>     KTMGW=none
>     KTM_WHOSTS=
>     ORACLE_BASE=/u01/app/oracle/product/12.2.0
>     CRDD_DICTIONARY=crdd_dict
>     CRSTRUCT=/usr/ktm/crdb/struct
>     KTMLIBDIR=/usr/ktm/lib
>     KTM_LHOSTS=xtmsc1 xtmdb2 xtmds1
>     KTMSC=xtmsc1
>     PATH=/usr/ktm/bin:/usr/ktm/admin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/
> /u01/app/oracle/product/12.2.0/client_1/bin:/u01/app/oracle/product/12.2.0/client
> t_1/lib:/u01/app/oracle/product/19_19
>     MAIL=/var/mail/ktmroot
>     MSG_IMAGELIST=/usr/ktm/lib/msg.imglist
>     KTM_ORADB=xtmdb
>     KTMDIR=/usr/ktm
>     CRLOG=/usr/ktm/log
>     IDENTDIR_2=/usr/ktm/src/ident_2
>     KTMLOGOUT=/usr/ktm/data/Command/Log
>     PWD=/home/ktmroot
>     KTMBIN=/usr/ktm/bin
>     KTMDIAG_RUN=/usr/ktm/tmp/diag_run
>     KTMSYSMODE_NORMAL=0
>     KTM_PWDEXPMSGDAYS=,0,1,2,3,5,8,11,14,
>     KTMOWNERID=1200
>     LANG=en_US.UTF-8
>     KTM_LDAP=ldap:
>     UTILBIN=/usr/ktm/bin
>     SELINUX_LEVEL_REQUESTED=
>     UTILHELPDIR=/usr/ktm/doc
>     KTMSYSMODE_TEST=2
>     CRSAVE=/usr/ktm/crdb/save
>     HOME=/home/ktmroot
>     SHLVL=2
>     KTMDIAG_WORK=/usr/ktm/tmp/diag
>     XTM_HOSTS=xtmsc1 xtmdb2 xtmds1
>     CRGCCFLAGS=-Wall -g -Wunused-value
>     LOGNAME=ktmroot
>     SUBR2THLIB=subr2_th
>     KTMLOG=/usr/ktm/log
>     SSH_CONNECTION=192.168.88.13 52169 192.168.188.83 22
>     XDG_DATA_DIRS=/home/ktmroot/.local/share/flatpak/exports/share/:/var/lib/fla
> atpak/exports/share/:/usr/local/share/:/usr/share/
>     CRLIBDIR=/usr/ktm/lib
>     INDLOAD_DO_LDAPUSER=1
>     SUBR2LIB=subr2
>     LESSOPEN=||/usr/bin/lesspipe.sh %s
>     KTMIDENT=/usr/ktm/src/ident
>     XDG_RUNTIME_DIR=/run/user/1200
>     ORACLE_HOME=/u01/app/oracle/product/12.2.0/client_1
>     KTMDC2=none
>     UTILETC=/usr/ktm/etc
>     KTMDC1=xtmdc1
>     _=/usr/bin/printenv
> Removing old logfile at /home/ktmroot/.vscode-server/.cli.cd4ee3b1c348a13bafd8f9
> 9ad8060705f6d4b9cba.log
[16:04:25.540] > 
> Spawned remote CLI: 27120
> Waiting for server log...
[16:04:25.560] > 
[16:04:25.578] > Waiting for server log...
[16:04:25.642] > 08e7b134cd94: start
> listeningOn==127.0.0.1:34205==
> osReleaseId==rhel==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1200==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==88==
> execServerToken==11111111-1111-11a1-a111-a1a11aa11a1a==
> platformDownloadPath==cli-alpine-x64==
> SSH_AUTH_SOCK====
> DISPLAY====
> 08e7b134cd94: end
[16:04:25.643] Received install output: 
listeningOn==127.0.0.1:34205==
osReleaseId==rhel==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1200==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==88==
execServerToken==11111111-1111-11a1-a111-a1a11aa11a1a==
platformDownloadPath==cli-alpine-x64==
SSH_AUTH_SOCK====
DISPLAY====

[16:04:25.643] Remote server is listening on port 34205
[16:04:25.643] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":34205},"osReleaseId":"rhel","arch":"x86_64","sshAuthSock":"","display":"","tmpDir":"/run/user/1200","platform":"linux","execServerToken":"11111111-1111-11a1-a111-a1a11aa11a1a"},"serverStartTime":88,"installUnpackCode":""}
[16:04:25.647] Starting forwarding server. local port 52170 -> socksPort 52168 -> remotePort 34205
[16:04:25.648] Forwarding server listening on port 52170
[16:04:25.648] Waiting for ssh tunnel to be ready
[16:04:25.651] [Forwarding server port 52170] Got connection 0
[16:04:25.652] Tunneled port 34205 to local port 52170
[16:04:25.653] Resolved "ssh-remote+xtmsc1" to "port 52170"
[16:04:25.660] Initizing new exec server for ssh-remote+xtmsc1
[16:04:25.660] Resolving exec server at port 52170
[16:04:25.674] [Forwarding server port 52170] Got connection 1
[16:04:25.786] Exec server for ssh-remote+xtmsc1 created and cached
[16:04:25.794] ------




[16:04:25.794] No hints found in the recent session.
[16:04:25.827] [server] Checking /home/ktmroot/.vscode-server/cli/servers/Stable-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/log.txt and /home/ktmroot/.vscode-server/cli/servers/Stable-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/pid.txt for a running server...
[16:04:25.829] [server] Found running server (pid=25400)
[16:04:28.692] Opening exec server for ssh-remote+xtmsc1
[16:04:28.734] Opening exec server for ssh-remote+xtmsc1
[16:04:28.746] Verified and reusing cached exec server for ssh-remote+xtmsc1
[16:04:28.746] No hints found in the recent session.
[16:04:28.751] Verified and reusing cached exec server for ssh-remote+xtmsc1
[16:04:28.751] No hints found in the recent session.
[16:04:28.762] Opening exec server for ssh-remote+xtmsc1
[16:04:28.767] Verified and reusing cached exec server for ssh-remote+xtmsc1
[16:04:28.767] No hints found in the recent session.

Expected Behavior

  • vs code attaching to the process
  • as can be verified by the output provided in debug console tab (*.so files being listed in yellow)
  • as can be verified by the mini debug toolbox (debug break continue etc buttons) appearing on the top

Actual Behavior

vs code doesn't attach to the process

Steps To Reproduce

  1. your remote is a RHEL 7.4
  2. have these extensions:
  3. Image
  4. verify that the session is attached to the remote (edit some file, save and try git diff on the remote server)
  5. press f5
  6. select the desired process
  7. check that the debugger isn't attached to the process as outlined in expected behaviour
  8. now press f5 again
  9. select a process that doesn't match the program setting in your launch.json
  10. verify you don't get the usual error that the process doesn't match the program in your launch.json
  11. verify that you can use gdb manually when you login using putty

Anything else?

It worked on jan 29th wednesday then it didn't work on jan 31st friday (2025)

@imre84 imre84 added the ssh Issue in vscode-remote SSH label Feb 3, 2025
@joshspicer
Copy link
Member

It worked on jan 29th wednesday then it didn't work on jan 31st friday (2025)

Did you update either VS Code or the Remote SSH extension between those dates? (No stable release of either was made available during those dates).

Would you be able to share a repro with some code illustrating the issue? That could help us determine if this is indeed a bug with Remote - SSH or perhaps a configuration issue on your machine.

@joshspicer joshspicer added the info-needed Issue requires more information from poster label Feb 4, 2025
@imre84
Copy link
Author

imre84 commented Feb 5, 2025

Hello, the code is proprietary. would it be OK if I made a separate workspace with some minimal hello world style code inside it? (same technologies: same gcc, automake, compiled by hand, trying to attach to that process)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

2 participants