-
Notifications
You must be signed in to change notification settings - Fork 381
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
Docker.DotNet seems to return InternalServerError from Docker for all errors (even for 4** status codes) #266
Comments
I'm looking into this issue as well. I do believe that this is a docker.dotnet client issue. |
Here's what I see in debugger for what's being read from the named pipe:
|
@SedarG Experiencing the same issue, not sure if you ever figured it out? |
What version of Docker.DotNet are you using? Our respond handler seems to handle this case on error by reading the body and assigning this to the |
… already exist. SftpFileStream: In Append mode, create the remote file if it does not already exist. Fixes issue dotnet#266.
… already exist. SftpFileStream: In Append mode, create the remote file if it does not already exist. Fixes issue dotnet#266.
In case it helps someone else, I got this same (unhelpful) error when my docker file referenced a local image which hadn't yet been created |
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.
Output of
dotnet --info
:PS C:\windows\system32> dotnet --info
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.2\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
What version of Docker.DotNet?:
3.125
Steps to reproduce the issue:
Expected unauthorized but we still get InternalServerError.:
Docker.DotNet.DockerApiException: Docker API responded with status code=InternalServerError, response=
at Docker.DotNet.DockerClient.HandleIfErrorResponse(HttpStatusCode statusCode, String responseBody, IEnumerable
1 handlers) at Docker.DotNet.DockerClient.<MakeRequestForStreamAsync>d__50.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.DotNet.Models.StreamUtil.<MonitorStreamForMessagesAsync>d__1
1.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
However, Docker logs via
Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-15) | Select Message produces
Handler for POST /v1.25/images/create returned error: unauthorized: authentication required
Attempting next endpoint for pull after error: unauthorized: authentication required
debug: Trying to pull myownrepo.azurecr.io/tanks2 from myownrepo.xcloudcr.azurecr.io v2
Looking 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
The text was updated successfully, but these errors were encountered: