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

TaskCanceledException: A task was canceled. hitting ctrl-c during container create #36593

Closed
danmoseley opened this issue Nov 1, 2023 · 2 comments
Labels
Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member

Comments

@danmoseley
Copy link
Member

Installed today's 8.0.100 SDK on Windows.
Started a dotnet publish /t:PublishContainer -r linux-x64 then quickly hit Ctrl-C

The Microsoft.NET.Build.Containers.DockerCli.LoadAsync or above appears to be missing a catch block for TaskCanceledException. I would have expected no message, or a one line saying it was canceled. Then the task should return immediately from the Microsoft.NET.Build.Containers.Tasks.CreateNewImage.Execute() method.

C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018: The "CreateNewImage" task failed unexpectedly. [C:\git\eshop2\src\WebApp\WebApp.csproj
]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018: System.Threading.Tasks.TaskCanceledException: A task was canceled. [C:\git\eshop2\src\
WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at System.Diagnostics.Process.WaitForExitAsync(CancellationToken cancellationToken)
 [C:\git\eshop2\src\WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at Microsoft.NET.Build.Containers.DockerCli.LoadAsync(BuiltImage image, SourceImage
Reference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs:line 101 [C
:\git\eshop2\src\WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at Microsoft.NET.Build.Containers.Tasks.CreateNewImage.PushToLocalRegistryAsync(Bui
ltImage builtImage, SourceImageReference sourceImageReference, DestinationImageReference destinationImageReference, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Contain
ers/Tasks/CreateNewImage.cs:line 172 [C:\git\eshop2\src\WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at Microsoft.NET.Build.Containers.Tasks.CreateNewImage.ExecuteAsync(CancellationTok
en cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 142 [C:\git\eshop2\src\WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at Microsoft.NET.Build.Containers.Tasks.CreateNewImage.Execute() in /_/src/Containe
rs/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 34 [C:\git\eshop2\src\WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecution
Host.Execute() [C:\git\eshop2\src\WebApp\WebApp.csproj]
C:\Program Files\dotnet\sdk\8.0.100\Containers\build\Microsoft.NET.Build.Containers.targets(202,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost t
askExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\git\eshop2\src\WebApp\WebApp.csproj]
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Nov 1, 2023
@baronfel baronfel added Area-Containers Related to dotnet SDK containers functionality and removed Area-NetSDK labels Nov 3, 2023
@baronfel
Copy link
Member

baronfel commented Nov 3, 2023

Thanks for this - we clearly need to clean up this reporting.

@baronfel
Copy link
Member

baronfel commented Jan 8, 2024

This error should be much better in 8.0.200.

@baronfel baronfel closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants