Item was not correctly removed in BuildOutputCapture
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
I tried `aspire deploy` on an app recently and got this error message:
```
16:17:32 (provision-production-acr) → Deploying production-acr
❌ The connection to the AppHost was lost: The JSON-RPC connection with the remote party was lost before the request could complete..
info: Aspire.Hosting.Azure.AppService.AzureAppServiceInfrastructure[0]
HTTP endpoints will use HTTPS (port 443) in Azure App Service: aspiredev:http. To opt out, use .WithHttpsUpgrade(false) on the app service
environment.
info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 13.3.0-pr.16137.ge9b1ad10
info: Aspire.Hosting.Publishing.PipelineExecutor[0]
Initializing deployment for environment 'Production'
info: Aspire.Hosting.Publishing.PipelineExecutor[0]
Setting default deploy tag 'aspire-deploy-20260416211554' for compute resource(s).
info: Aspire.Hosting.ContainerRuntime[0]
Container runtime auto-detected: Docker (docker).
info: Aspire.Hosting.Publishing.ResourceContainerImageManager[0]
Building container image for resource aspiredev
info: Aspire.Hosting.Publishing.ResourceContainerImageManager[0]
Building image: aspiredev
info: Aspire.Hosting.Azure.Provisioning.Internal.DefaultTokenCredentialProvider[0]
Using AzureCliCredential for provisioning.
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Default subscription: Erhardt (/subscriptions/11002c15-c08a-4ee9-818a-27c45357fa21)
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Tenant: 570e059e-4f62-42fa-a4cc-40ce14567af8
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Creating resource group rg-aspire-aspiredevapphost in eastus2...
info: Aspire.Hosting.Azure.Provisioning.Internal.PublishModeProvisioningContextProvider[0]
Resource group rg-aspire-aspiredevapphost created.
Process terminated.
Assertion failed.
Item was not correctly removed.
at Aspire.CircularBuffer`1.Add(T item) in /_/src/Shared/CircularBuffer.cs:line 202
at Aspire.Hosting.Publishing.BuildOutputCapture.Add(String line) in /_/src/Aspire.Hosting/Publishing/BuildOutputCapture.cs:line 28
at Aspire.Hosting.Publishing.ResourceContainerImageManager.<>c__DisplayClass12_0.b__0(String output) in
/_/src/Aspire.Hosting/Publishing/ResourceContainerImageManager.cs:line 390
at Aspire.Hosting.Dcp.Process.ProcessUtil.<>c__DisplayClass2_0.b__0(Object _, DataReceivedEventArgs e) in
/_/src/Aspire.Hosting/Dcp/Process/ProcessUtil.cs:line 75
at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)
at System.Diagnostics.AsyncStreamReader.ReadBufferAsync()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(Task`1 task, TResult result)
at System.IO.Strategies.BufferedFileStreamStrategy.ReadFromNonSeekableAsync(Memory`1 destination, CancellationToken cancellationToken)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.SignalCompletion()
at System.Threading.AsyncOverSyncWithIoCancellation.InvokeAsync[TState,TResult](Func`2 func, TState state, CancellationToken cancellationToken)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
```
I'm not sure what I did to do this, but I ran it again and it got past this part. Logging this bug in case it shows up in more places.
cc @davidfowl
Contributor guide
Assessment
This issue has not been assessed yet.