dotnet / sdk-container-builds

Libraries and build tooling to create container images from .NET projects using MSBuild
https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container
MIT License
179 stars 38 forks source link

Unexpected EOF on container publish #593

Closed rainersigwald closed 4 weeks ago

rainersigwald commented 2 months ago

@rainersigwald Thank you, this problem was solved after I updated it, but then a new problem appeared, I don't know what's happening

Executing: dotnet publish
"C:\Users\32512\source\repos\AspireApp.AppHost\../AspireApp.ApiService/AspireApp.ApiService.csproj" -t:PublishContainer
--verbosity "quiet" --nologo -r "linux-x64" -p:ContainerRepository="apiservice" -p:ContainerImageTag="latest"
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:
鈥淐reateNewImage鈥濅换鍔℃剰澶栧け璐ャ€?[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:
System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32
estimatedSize) [C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IV
alueTaskSource<TResult>.GetResult(Int16 token)
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken)
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IV
alueTaskSource<TResult>.GetResult(Int16 token)
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Net.Http.HttpConnection.FillAsync(Boolean async)
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, Boolean async, UInt64 length, Int32
bufferSize, CancellationToken cancellationToken)
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken
cancellationToken) [C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.NET.Build.Containers.Registry.DownloadBlobAsync(String repository, Descriptor descriptor, CancellationToken
cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs:line 337
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.NET.Build.Containers.DockerCli.WriteImageToStreamAsync(BuiltImage image, SourceImageReference sourceReference,
DestinationImageReference destinationReference, Stream imageStream, CancellationToken cancellationToken) in
/_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs:line 282
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.NET.Build.Containers.DockerCli.LoadAsync(BuiltImage image, SourceImageReference sourceReference,
DestinationImageReference destinationReference, CancellationToken cancellationToken) in
/_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs:line 104
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.NET.Build.Containers.Tasks.CreateNewImage.PushToLocalRegistryAsync(BuiltImage builtImage, SourceImageReference
sourceImageReference, DestinationImageReference destinationImageReference, Telemetry telemetry, CancellationToken
cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 218
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.NET.Build.Containers.Tasks.CreateNewImage.ExecuteAsync(CancellationToken cancellationToken) in
/_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 182
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.NET.Build.Containers.Tasks.CreateNewImage.Execute() in
/_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 36
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]
C:\Program Files\dotnet\sdk\8.0.401\Containers\build\Microsoft.NET.Build.Containers.targets(242,5): error MSB4018:    at
Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext
taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
[C:\Users\32512\source\repos\AspireApp.ApiService\AspireApp.ApiService.csproj]

鏈夊彲鐢ㄧ殑宸ヤ綔璐熻浇鏇存柊銆傛湁鍏宠缁嗕俊鎭紝璇疯繍琛?`dotnet workload list`銆?
(1): Aspirate will now exit.

Originally posted by @ArsiIksait in https://github.com/dotnet/msbuild/issues/7453#issuecomment-2322029001

rainersigwald commented 2 months ago

@baronfel @MichalPavlik ring any bells?

baronfel commented 2 months ago

This looks to be communication with the local Docker daemon - maybe it's in the 'resource saving' mode and not active? I know other container tools have had problems with this.

ArsiIksait commented 2 months ago

@rainersigwald Oh, sorry, my bad, I just read the tutorial and managed to post it without any errors! Aspir8 from Scratch This is not an MSBuild issue, this is because I didn't install Kubernetes inside Docker Desktop, and registry, because the registry service is not started or ContainerRegistry is not set to a value, so building the manifest using the Aspirate (Aspir8) tool file using the Aspirate (Aspir8) tool resulted in this error

image image

baronfel commented 4 weeks ago

Thanks for confirming!