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

Docker.DotNet fails to pull images with Docker Desktop 4.13.0 #595

Open
HofmeisterAn opened this issue Oct 24, 2022 · 2 comments
Open

Docker.DotNet fails to pull images with Docker Desktop 4.13.0 #595

HofmeisterAn opened this issue Oct 24, 2022 · 2 comments

Comments

@HofmeisterAn
Copy link
Contributor

Output of dotnet --info:

.NET SDK (reflecting any global.json):
 Version:   6.0.402
 Commit:    6862418796

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.402\

global.json file:
  Not found

Host:
  Version:      6.0.10
  Architecture: x64
  Commit:       5a400c212a

.NET SDKs installed:
  6.0.402 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

What version of Docker.DotNet?:

3.125.12

Steps to reproduce the issue:

// Given
var dockerClient = new DockerClientConfiguration().CreateClient();

// When
var pullImageTask = dockerClient.Images.CreateImageAsync(new ImagesCreateParameters { FromImage = "mysql:8.0.28" }, new AuthConfig(), null);

var exception = await Record.ExceptionAsync(() => pullImageTask)
  .ConfigureAwait(false);

// Then
Assert.Null(exception);

What actually happened?:

Xunit.Sdk.NullException
Assert.Null() Failure
Expected: (null)
Actual:   Newtonsoft.Json.JsonReaderException: Error parsing undefined value. Path '', line 1, position 2.
   at Newtonsoft.Json.JsonTextReader.MatchAndSetAsync(String value, JsonToken newToken, Object tokenValue, CancellationToken cancellationToken)
   at Newtonsoft.Json.JsonTextReader.ParseValueAsync(CancellationToken cancellationToken)
   at Docker.DotNet.Models.StreamUtil.MonitorStreamForMessagesAsync[T](Task`1 streamTask, DockerClient client, CancellationToken cancellationToken, IProgress`1 progress) in C:\Sources\GitHub\Docker.DotNet\src\Docker.DotNet\Endpoints\StreamUtil.cs:line 39
   at Docker.DotNet.Models.StreamUtil.MonitorResponseForMessagesAsync[T](Task`1 responseTask, DockerClient client, CancellationToken cancel, IProgress`1 progress) in C:\Sources\GitHub\Docker.DotNet\src\Docker.DotNet\Endpoints\StreamUtil.cs:line 51
   at Xunit.Record.ExceptionAsync(Func`1 testCode) in C:\Dev\xunit\xunit\src\xunit.core\Record.cs:line 76
   at Docker.DotNet.Tests.GitHub.Issue634() in C:\Sources\GitHub\Docker.DotNet\test\Docker.DotNet.Tests\GitHub.cs:line 22
   at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 264
--- End of stack trace from previous location ---
   at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48
   at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\Dev\xunit\xunit\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90

What did you expect to happen?:

  • Docker.DotNet pulls the image.

Additional information:

-

@HofmeisterAn
Copy link
Contributor Author

For the example above the endpoint returns unknown image in /images/create?fromImage=mysql%3A8.0.28. It works if I set the image and tag separate from each other: new ImagesCreateParameters { FromImage = "mysql", Tag = "8.0.28" }. Neverless the Docker docs say:

Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed.

@HofmeisterAn
Copy link
Contributor Author

HofmeisterAn commented Dec 6, 2022

Probably relates to following update in 4.13.0 (might by working again in later releases):

Updated Docker Engine and Docker CLI to v20.10.20, which contain mitigations against a Git vulnerability, tracked in CVE-2022-39253, and updated handling of image:tag@digest image references, as well as a fix for CVE-2022-36109.

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

1 participant