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

Remote Debugging: Unable to list processes from Windows #6729

Closed
AlexandrStarov opened this issue Dec 8, 2023 · 4 comments · Fixed by #6730
Closed

Remote Debugging: Unable to list processes from Windows #6729

AlexandrStarov opened this issue Dec 8, 2023 · 4 comments · Fixed by #6730
Labels

Comments

@AlexandrStarov
Copy link

AlexandrStarov commented Dec 8, 2023

Environment data

dotnet 6
VS Code version: 1.85
C# Extension version: 2.13.10

OmniSharp log

Steps to reproduce

  1. Go to https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4&tabs=csharp&pivots=iotedge-dev-ext
  2. Create a new module project according documentation via Azure IoT Edge extension (v1.25.11)
  3. Check if your application is working
  4. Open https://learn.microsoft.com/en-us/azure/iot-edge/debug-module-vs-code?view=iotedge-1.4&tabs=c&pivots=iotedge-dev-ext
  5. Try to repeat Remotely debug your module

Expected behavior

It is possible to attach to the selected project

Actual behavior

Can't debug application in the docker container.

Error:
Executing: docker exec -i DataProcessor sh -c "sh -s" < "c:\Users\aleksandr.starov.vscode\extensions\ms-dotnettools.csharp-2.13.10-win32-x64\scripts\remoteProcessPickerScript"
stderr: sh: 30: Syntax error: "}" unexpected (expecting "then")
Error Message: Command failed: docker exec -i DataProcessor sh -c "sh -s" < "c:\Users\aleksandr.starov.vscode\extensions\ms-dotnettools.csharp-2.13.10-win32-x64\scripts\remoteProcessPickerScript"
sh: 30: Syntax error: "}" unexpected (expecting "then")

Additional context

Config

{
"name": "DataProcessor Remote Debug (.NET Core)",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickRemoteProcess}",
"pipeTransport": {
"pipeProgram": "docker",
"pipeArgs": [
"exec",
"-i",
"DataProcessor",
"sh",
"-c"
],
"debuggerPath": "~/vsdbg/vsdbg",
"pipeCwd": "${workspaceFolder}",
"quoteArgs": true
},
"sourceFileMap": {
"/app": "${workspaceFolder}/modules/DataProcessor"
},
"justMyCode": true
}

@AlexandrStarov AlexandrStarov changed the title Unable to debug IoT edge solution in docker Not able to debug IoT edge solution in docker Dec 8, 2023
@gregg-miskelly
Copy link
Contributor

@AlexandrStarov To work around this bug, open the referenced script (c:\Users\aleksandr.starov.vscode\extensions\ms-dotnettools.csharp-2.13.10-win32-x64\scripts\remoteProcessPickerScript) and change the file from CLLF line ends to LF line endings.

@gregg-miskelly gregg-miskelly changed the title Not able to debug IoT edge solution in docker Remote Debugging: Unable to list processes from Windows Dec 8, 2023
gregg-miskelly added a commit that referenced this issue Dec 8, 2023
The change to produce the Windows .vsix files on a Windows machine exposed the fact that we didn't have a .gitattributes entry in this repo to force the process listing script to use LF line endings, thus breaking remote process listing from Windows.

This fixes #6729
@AlexandrStarov
Copy link
Author

@gregg-miskelly Thanks for the quick fix and suggested workaround!
Unfortunately, I still can’t run the debug. Will this bug also be fixed in the next release? Since, according to the example, this error should not exist

Starting: "docker" exec -i DataProcessor sh -c "~/vsdbg/vsdbg --interpreter=vscode"
Error from pipe program 'docker': sh: 1: /home/moduleuser/vsdbg/vsdbg: not found
The pipe program 'docker' exited unexpectedly with code 127.

@gregg-miskelly
Copy link
Contributor

@AlexandrStarov What that error means is that nothing installed vsdbg to whatever path your launch.json indicated it is installed at (pipeTransport.debuggerPath). I am not super familiar with the Azure IoT Edge tooling, so the owners of that extension might be able to provide you with better advice (ex: maybe that extension is trying to install it for you). But the C# extension leaves it to users to install it. See here for instructions.

@AlexandrStarov
Copy link
Author

Unfortunately it didn't help me. I have found another similar bug #1369
I will create a new issue. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants