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

Unable to start debugging Docker container #162

Closed
shaggygi opened this issue Nov 20, 2016 · 15 comments
Closed

Unable to start debugging Docker container #162

shaggygi opened this issue Nov 20, 2016 · 15 comments

Comments

@shaggygi
Copy link

shaggygi commented Nov 20, 2016

I'm trying out the new Visual Studio 2017 RC and ASP.NET Core web app and get a prompt stating "Unable to start debugging. Unable to establish a connection to CLRDBG. Debug output may contain more information."

Output Windows shows the following:

Starting: "docker" exec -i 7459ff7a006c /clrdbg/clrdbg --interpreter=mi
rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"/clrdbg/clrdbg\": stat /clrdbg/clrdbg: no such file or directory"\n"
"docker" exited with code 126 (0x7E).

Steps to reproduce the issue

  1. Open VS 2017 RC
  2. Create new ASP.NET Core Web App
  3. Debug with Docker

Expected behavior

Should run app in container and allow breakpoints, etc.

Actual behavior

It prompts with error mentioned above. It does appear to deploy and run a container.

Output of docker version

Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Thu Oct 27 00:09:21 2016
 OS/Arch:      windows/amd64
 Experimental: true

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Thu Oct 27 00:09:21 2016
 OS/Arch:      linux/amd64
 Experimental: true

Output of docker info

Containers: 16
 Running: 1
 Paused: 0
 Stopped: 15
Images: 18
Server Version: 1.12.3
Storage Driver: overlay2
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge null host overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.30-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.918 GiB
Name: moby
ID: BXGQ:D5Z4:FWIC:H6YH:HMMF:CP3R:PEDV:7JSU:OLPN:PGM3:CMSO:RSTX
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 22
 Goroutines: 51
 System Time: 2016-11-20T01:17:14.7498244Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
@dbreshears
Copy link

Hi shaggygi,

Couple things to check with you. Do you have your systemdrive shared with Docker For Windows? Do you find a %userprofile%\clrdbg folder? My guess is that this local folder not getting volume mapped into the container for some reason.

@shaggygi
Copy link
Author

@dbreshears I can navigate and see the mentioned folder and is empty.

@dbreshears
Copy link

@shaggygi . We download a script named "GetClrDbg.ps1" to the %TMP% folder and attempt to execute that. This script will result in creating the %userprofile%\clrbdg. Do you see that script in the temp folder? Do you happen to have any spaces in the path for %TMP%?

@shaggygi
Copy link
Author

@dbreshears I can see "GetClrDbg.ps1" file in the temp directory and there are no spaces in the path. For example...

C:\Users\MyUserName\AppData\Local\Temp

@weidazhao
Copy link

weidazhao commented Nov 23, 2016

@shaggygi, please try deleting the "GetClrDbg.ps1" from the %temp% folder and try F5 again. If it still doesn't work, please let us know.

Meanwhile, you also could run the following PS command from PowerShell command prompt as a workaround:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\GetClrDbg.ps1 -Version latest -RuntimeID debian.8-x64 -InstallPath "$env:UserProfile\clrdbg"

It will pull the latest version of clrdbg to %UserProfile%\clrdbg and you should be able to get through the issue.

@shaggygi
Copy link
Author

shaggygi commented Nov 23, 2016

@dbreshears @weidazhao I deleted "GetClrDbg.ps1" and tried rebuilding and deploying, but get same error on not able to debug.

I tried the second instruction of running the provided PowerShell command and worked. I was able to deploy to the container, the ASP.NET Core app opened in browser and was able to set a breakpoint to step through code.

I did notice red squiggles and such throughout code, but should not be related to this issue. I'm seeing other issues on other repro projects related to VS 2017 RC bugs.

Thanks for being patient and helping with my problem. I can close this issue unless it might be needed to help track for future fix. Let me know.

@weidazhao
Copy link

@shaggygi, can you please reproduce the issue and find the logs in the Build output window to send to me? You can delete %UserProfile%\clrdbg and F5 to repro the issue. VS will try to download the debugger again. Thanks.

@shaggygi
Copy link
Author

@weidazhao I deleted the clrdbg directory and GetClrDbg.ps1 and rebuilt the app. It appeared to create them again and my demo app ran/debugged fine. I don't think I will be able to reproduce the original error:

"Unable to start debugging. Unable to establish a connection to CLRDBG. Debug output may contain more information."

@MichaelSimons
Copy link
Member

Glad to see a solution was found. @weidazhao, if necessary please track any needed fixes on your side. This issue is not related to the dotnet/dotnet-docker repo therefore I am closing it.

@nitin-a
Copy link

nitin-a commented Nov 29, 2016

I tried the above steps and get the below success message
PS C:\users\username\appdata\Local\Temp> .\GetClrDbg.ps1 -Version latest -RuntimeID debian.8-x64 -InstallPath "$env:User Profile\clrdbg" >> c:\test11.txt Info: Using clrdbg version '14.0.25406-preview-3044032' Info: Using Runtime ID 'debian.8-x64' Info: Generating project.json Info: Generating NuGet.config Info: Executing dotnet restore Info: Executing dotnet publish Info: Successfully installed clrdbg at 'C:\Users\username\clrdbg' PS C:\users\username\appdata\Local\Temp>

But when I looked at the clrdbg folder I could see only two files

success_rid.txt
success_version.txt

On my friend's machine there are 100+ files.

Any suggestion ?

@DanJ210
Copy link

DanJ210 commented Jun 11, 2017

I am getting this error when I've already been building a .Net Core Web Application connected to VTFS and published on Azure, this morning I did my normal thing and started coding but when I ran locally I got this error. Below is the only thing in my output window. I'm going to try the powershell command above.

Starting: "docker" exec -i 7d1a1971b5a0 /clrdbg/vsdbg/vsdbg --interpreter=mi rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"/clrdbg/vsdbg/vsdbg\": stat /clrdbg/vsdbg/vsdbg: no such file or directory" "docker" exited with code 126 (0x7E).

@DanJ210
Copy link

DanJ210 commented Jun 11, 2017

When I try to run .\GetClrDbg.ps1 -Version latest -RuntimeID debian.8-x64 -InstallPath "$env:UserProfile\clrdbg" I am told that .\GetClrDbg.ps1 is not recognized as the name of a cmdlet. So this solution isn't working for me apparently.

@DanJ210
Copy link

DanJ210 commented Jun 11, 2017

Just to report. Everything above checked out and all I did was click "restart Docker" even though I had already closed it and opened it. Then debugging started working again so I have no idea what the problem was.

@malramsay
Copy link

A similar error occurred to me today. Clicking "restart Docker" as per DanJS10's instructions seemed to fix the problem.

@smartouss
Copy link

I had the similar issue, when i restarted docker as DanJS10 mention worked, the problem was docker checkign clrdbg\vsdbg\vsdbg which don't exists, all files are under clrdbg\vsdbg

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

No branches or pull requests

8 participants