Hi,
I have recently stopped on rather simple looking error while debugging eShopOnContainer. Visual Studio starts building solution, continues with docker images, start containers successfully and just after debugging session starts it detach itself and stops.
VS version: 2019 (version 16.4.4)
Docker desktop community version: 2.2.0.0 (42247)
CLI approach using docker-compose build and docker-compose up works without any problems.
Steps to reproduce
Expected behaviour:
All containers alive and debugging session started. Application available.
Actual behaviour:
All containers alive (which is ok, i see containers in up status) debugging session closed. Application unavailable.
Although, containers are reported as healthy (up status) i application is not responding.
docker logs any-eshop-container-id-here
Prints:
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
I was trying to:
Command executed inside of the container created by VS.
dotnet --list-sdks
Prints:
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
I am not sure what I am missing. I would appreciate any help.
Regards
Paweł
Today I have tried to find workaround one more time. What I have find out is that while creating new project ASP.NET Core Web Application with Docker support and docker-compose enabled. The same error occur. Moreover it is one of this nasty bugs that are votaile because sometimes it works sometimes crashes.
Temporary workaround:
Change your build config to RELEASE which will disable performance optimization described here
https://docs.microsoft.com/en-us/visualstudio/containers/container-build?view=vs-2019#debugging
Workaround has two major cons:
I've been having the same issue. I did find that if I place the following in the csproj it does seem to work.
<ServerGarbageCollection>false</ServerGarbageCollection>
Sometimes I got FATAL ERROR: Failed to initialize dispatcher with error 8ede0006.
Reinstall vsdbg helps once.
Additional logs:
1> DebugAdapterHost version: 16.5.40108.1 commit:068aa0a129e050278b8e96d3a10cef33f02f2c89
1> Starting 'docker' with arguments 'exec -i e6bc85d7c09855fc515a2194afaa712588ab3b49fb500d3560d6b7335261bffc /bin/sh -c "/remote_debugger/vsdbg --interpreter=vscode"'
1> [DebugAdapter] --> C (initialize-1): {"type":"request","command":"initialize","arguments":{"pathFormat":"path","clientID":"visualstudio","clientName":"Visual Studio","adapterID":"coreclr","locale":"en-US","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsHandshakeRequest":true},"seq":1}
1> ERROR: Debug adapter error output: FATAL ERROR: Failed to initialize dispatcher with error 8ede0006
1> ERROR: Debug Adapter did not respond to initial requests.
1> ERROR: Unexpected error
AggregateException: One or more errors occurred.
Aggregate exception:
DebugAdapterLaunchException: Failed to launch debug adapter. Additional information may be available in the output window.
Failure Location: UserCanceled
Inner Exception:
OperationCanceledException: The operation was canceled.
Inner Exception:
DebugAdapterLaunchException: Failed to launch debug adapter. Additional information may be available in the output window.
Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Engine.Implementation.DebuggedProcess.<StartDebugAdapter>b__103_1(Exception ex)
Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Utilities.TaskExtensions.<>c__DisplayClass11_0`1.<Catch>b__0(TException ex)
Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Utilities.TaskExtensions.<>c__DisplayClass10_0`1.<Catch>b__0(AggregateException ex)
Failure Location: UserCanceled
Inner Exception:
OperationCanceledException: The operation was canceled.
1> Debug adapter process exited.
1> ERROR: One or more errors occurred.
Failed to launch debug adapter. Additional information may be available in the output window.
The operation was canceled.
vsdbg is available, but cannot be started (I also tried to start it manual)
my issue was related with docker filesystem bug (2.2.0.0) : https://github.com/docker/for-win/issues/5698
@vchirikov it seams like a separate error to me at the first glance. However, may I ask where to find error log like yours?
@wicharypawel your error:
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Definitely about the bug with a new filesystem in docker-desktop. I think you should downgrade docker to 2.1.0.5. (your message like I got in bash sh: getcwd: No such file or directory)
However, may I ask where to find error log like yours?
You can enable a debug log of container tools with DebugAdapterHost.Logging /On /OutputWindow in the command window in VS.
@vchirikov thanks for letting me know about additional logging. However I must admit sadly I have a quite different output. 😢 I have removed duplicated lines from logs to make it readable. getcwd can not find a folder, it looks like some performance optimizations gone to far.
We have had a joke in a dev team that if you want to make your database queries blazing fast, simply remove all data. I see some similarities here. 😆 @microsoft help us 🙏
1> 02/07/2020 10:07:57.913: DebugAdapterHost version: 16.4.31017.1 commit:e5b3c2d5a5904b50882623bba67340844037b6c0
2> 02/07/2020 10:07:57.958: DebugAdapterHost version: 16.4.31017.1 commit:e5b3c2d5a5904b50882623bba67340844037b6c0
1> 02/07/2020 10:07:57.967: Starting 'docker' with arguments 'exec -i b9980b6dddc3 /bin/sh -c "ID=.; if [ -e /etc/os-release ]; then . /etc/os-release; fi; if [ $ID = alpine ] && [ -e /remote_debugger/linux-musl-x64/vsdbg ]; then VSDBGPATH=/remote_debugger/linux-musl-x64; else VSDBGPATH=/remote_debugger; fi; $VSDBGPATH/vsdbg --interpreter=vscode"'
1> 02/07/2020 10:07:57.971: [DebugAdapter] --> C (initialize-1): {"type":"request","command":"initialize","arguments":{"pathFormat":"path","clientID":"visualstudio","clientName":"Visual Studio","adapterID":"coreclr","locale":"en-US","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsHandshakeRequest":true},"seq":1}
3> 02/07/2020 10:07:57.976: DebugAdapterHost version: 16.4.31017.1 commit:e5b3c2d5a5904b50882623bba67340844037b6c0
2> 02/07/2020 10:07:57.976: Starting 'docker' with arguments 'exec -i 5948a21fc6f5 /bin/sh -c "ID=.; if [ -e /etc/os-release ]; then . /etc/os-release; fi; if [ $ID = alpine ] && [ -e /remote_debugger/linux-musl-x64/vsdbg ]; then
[...]
1> 02/07/2020 10:07:58.378: ERROR: Debug adapter error output: sh: 0: getcwd() failed: No such file or directory
[...]
2> 02/07/2020 10:07:58.725: [DebugAdapter] <-- C (handshake-1): {"seq":1,"type":"request","command":"handshake","arguments":{"value":"5QaFLDox+QJgZZd6Sslk5rToZ4yDCXoINoeEUWmN8uI="}}
2> 02/07/2020 10:07:58.725: [DebugAdapter] --> R (handshake-1): {"type":"response","request_seq":1,"success":true,"command":"handshake","body":{"signature":"181xnl5uMJVX9G0emqHW/zKXZrkLCJjt8pbHII52k7P+yo="},"seq":3}
4> 02/07/2020 10:07:58.729: ERROR: Debug adapter error output: sh: 0: getcwd() failed: No such file or directory
5> 02/07/2020 10:07:58.729: ERROR: Debug adapter error output: sh: 0: getcwd() failed: No such file or directory
[...]
16> 02/07/2020 10:07:59.166: WARNING: Request 'initialize-1' has not received a response within 1000 ms!
13> 02/07/2020 10:07:59.170: [DebugAdapter] <-- R (initialize-1) [1058 ms]: {"seq":0,"type":"response","request_seq":1,"success":true,"command":"initialize","message":"","body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"exceptionBreakpointFilters":[{"filter":"all","label":"All Exceptions","default":false},{"filter":"user-unhandled","label":"User-Unhandled
[...]
14> 02/07/2020 10:07:59.304: [DebugAdapter] <-- E (output): {"seq":17,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/Launch","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.SourceFileMappings":0,"VS.Diagnostics.Debugger.vsdbg.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.vsdbg.Launch.Duration":161,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"debian","VS.Diagnostics.Debugger.vsdbg.TargetType":"Live","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"10","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.3.10904.1 commit:c4e609b9bafdd0463d7ff33680c0b968e74b7549"}}}
14> 02/07/2020 10:07:59.304: [DebugAdapter] <-- R (configurationDone-14) [79 ms]: {"seq":18,"type":"response","request_seq":14,"success":true,"command":"configurationDone"}
14> 02/07/2020 10:07:59.308: [DebugAdapter] <-- E (output): {"seq":19,"type":"event","event":"output","body":{"category":"stderr","output":"The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.\n"}}
14> 02/07/2020 10:07:59.309: [DebugAdapter] <-- E (output): {"seq":20,"type":"event","event":"output","body":{"category":"stdout","output":" It was not possible to find any installed .NET Core SDKs\n"}}
14> 02/07/2020 10:07:59.309: [DebugAdapter] <-- E (output): {"seq":21,"type":"event","event":"output","body":{"category":"stdout","output":" Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:\n"}}
14> 02/07/2020 10:07:59.309: [DebugAdapter] <-- E (output): {"seq":22,"type":"event","event":"output","body":{"category":"stdout","output":" https://aka.ms/dotnet-download\n"}}
14> 02/07/2020 10:07:59.310: [DebugAdapter] <-- E (exited): {"seq":23,"type":"event","event":"exited","body":{"exitCode":145}}
14> 02/07/2020 10:07:59.310: [DebugAdapter] <-- E (terminated): {"seq":24,"type":"event","event":"terminated","body":{}}
14> 02/07/2020 10:07:59.310: [DebugAdapter] --> C (disconnect-15): {"type":"request","command":"disconnect","arguments":{},"seq":15}
5> 02/07/2020 10:07:59.311: [DebugAdapter] <-- E (output): {"seq":17,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/Launch","data":{"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.SourceFileMappings":0,"VS.Diagnostics.Debugger.vsdbg.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.vsdbg.Launch.Duration":183,"VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"debian","VS.Diagnostics.Debugger.vsdbg.TargetType":"Live","VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"10","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.vsdbg.Version":"16.3.10904.1 commit:c4e609b9bafdd0463d7ff33680c0b968e74b7549"}}}
Any updates regarding this issue, me too facing the same problem using vs 2019
Just downgrade docker to 2.1.0.5
@mustafamg can you confirm downgrade solution proposed by vchirikov works for you? (can be a thumbs up on his answer as well)
Possibly this issue may be connected with new filesharing implementation in docker:
https://www.docker.com/blog/new-filesharing-implementation-in-docker-desktop-windows/
I would like to thank @vchirikov for his hint as this lead me to the solution.
The latest release Docker Desktop Community 2.2.0.3 has these issues resolved, just upgrade to the latest version and it will work fine with visual studio 2019.
Thanks @wicharypawel i believe this can be closed now
Yes, I have updated to docker 2.2.0.3 and it worked for me as well.
Looks to me like this is once again broken again. Not had issues for a while, upgraded to Docker 2.2.0.4 yesterday, issues have now returned.
I have delayed my upgrade 🍀, for now i will stick with 2.2.0.3 🥇
I would suggest downgrade or looking at ugly workarounds described above.