{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/Docker.DotNet/issues/266","repository_url":"https://api.github.com/repos/Microsoft/Docker.DotNet","labels_url":"https://api.github.com/repos/Microsoft/Docker.DotNet/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/Docker.DotNet/issues/266/comments","events_url":"https://api.github.com/repos/Microsoft/Docker.DotNet/issues/266/events","html_url":"https://github.com/Microsoft/Docker.DotNet/issues/266","id":266555587,"node_id":"MDU6SXNzdWUyNjY1NTU1ODc=","number":266,"title":"Docker.DotNet seems to return InternalServerError from Docker for all errors (even for 4** status codes)","user":{"login":"rvarna","id":1279370,"node_id":"MDQ6VXNlcjEyNzkzNzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1279370?v=4","gravatar_id":"","url":"https://api.github.com/users/rvarna","html_url":"https://github.com/rvarna","followers_url":"https://api.github.com/users/rvarna/followers","following_url":"https://api.github.com/users/rvarna/following{/other_user}","gists_url":"https://api.github.com/users/rvarna/gists{/gist_id}","starred_url":"https://api.github.com/users/rvarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvarna/subscriptions","organizations_url":"https://api.github.com/users/rvarna/orgs","repos_url":"https://api.github.com/users/rvarna/repos","events_url":"https://api.github.com/users/rvarna/events{/privacy}","received_events_url":"https://api.github.com/users/rvarna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-18T16:21:35Z","updated_at":"2018-10-30T18:35:05Z","closed_at":null,"author_association":"NONE","body":"I have been noticing that we always get InternalServerError from the docker daemon for any kind of issues. Today, I was trying to test out a case where we should be getting unauthorized, but we still end up getting InternalServerError.\r\n\r\n**Output of `dotnet --info`:**\r\nPS C:\\windows\\system32> dotnet --info\r\n.NET Command Line Tools (2.0.2)\r\n\r\nProduct Information:\r\n Version:            2.0.2\r\n Commit SHA-1 hash:  a04b4bf512\r\n\r\nRuntime Environment:\r\n OS Name:     Windows\r\n OS Version:  10.0.14393\r\n OS Platform: Windows\r\n RID:         win10-x64\r\n Base Path:   C:\\Program Files\\dotnet\\sdk\\2.0.2\\\r\n\r\nMicrosoft .NET Core Shared Framework Host\r\n\r\n  Version  : 2.0.0\r\n  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d\r\n\r\n**What version of Docker.DotNet?:**\r\n3.125\r\n\r\n**Steps to reproduce the issue:**\r\n1. Try getting an image from a registry with invalid credentials.\r\n2.\r\n3.\r\n\r\n\r\nExpected unauthorized but we still get InternalServerError.:\r\nDocker.DotNet.DockerApiException: Docker API responded with status code=InternalServerError, response=\r\n   at Docker.DotNet.DockerClient.HandleIfErrorResponse(HttpStatusCode statusCode, String responseBody, IEnumerable`1 handlers)\r\n   at Docker.DotNet.DockerClient.<MakeRequestForStreamAsync>d__50.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Docker.DotNet.Models.StreamUtil.<MonitorStreamForMessagesAsync>d__1`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n\r\n\r\nHowever, Docker logs via \r\n Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-15) | Select Message   produces\r\n\r\nHandler for POST /v1.25/images/create returned error: unauthorized: authentication required\r\nAttempting next endpoint for pull after error: unauthorized: authentication required\r\ndebug: Trying to pull myownrepo.azurecr.io/tanks2 from myownrepo.xcloudcr.azurecr.io v2\r\n\r\n\r\nLooking at the code, I don't think this is a problem with Docker DotNet, but just wanted to check with the community here. It seems weird that docker would have one thing in the event log but return another. The docker API https://docs.docker.com/engine/api/v1.25/#operation/ImageCreate says we should get 4** status code"},"comment":{"url":"https://api.github.com/repos/Microsoft/Docker.DotNet/issues/comments/434419752","html_url":"https://github.com/Microsoft/Docker.DotNet/issues/266#issuecomment-434419752","issue_url":"https://api.github.com/repos/Microsoft/Docker.DotNet/issues/266","id":434419752,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDQxOTc1Mg==","user":{"login":"dev31000","id":24605580,"node_id":"MDQ6VXNlcjI0NjA1NTgw","avatar_url":"https://avatars0.githubusercontent.com/u/24605580?v=4","gravatar_id":"","url":"https://api.github.com/users/dev31000","html_url":"https://github.com/dev31000","followers_url":"https://api.github.com/users/dev31000/followers","following_url":"https://api.github.com/users/dev31000/following{/other_user}","gists_url":"https://api.github.com/users/dev31000/gists{/gist_id}","starred_url":"https://api.github.com/users/dev31000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dev31000/subscriptions","organizations_url":"https://api.github.com/users/dev31000/orgs","repos_url":"https://api.github.com/users/dev31000/repos","events_url":"https://api.github.com/users/dev31000/events{/privacy}","received_events_url":"https://api.github.com/users/dev31000/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T18:35:05Z","updated_at":"2018-10-30T18:35:05Z","author_association":"NONE","body":"@SedarG Experiencing the same issue, not sure if you ever figured it out?"}}
{"actor":{"display_login":"dev31000"}}