aspnetcore: 'The process cannot access the file' during CI build sometimes
This has been happening a few times recently. It’s odd because BlazorTemplates.Tests doesn’t depend on Microsoft.DotNet.Web.Spa.ProjectTemplates so it shouldn’t be copying it anywhere.
There is some custom msbuild logic being invoked right before the error: https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets
So maybe that has something to do with it. We might just need to add /bl to this part of the build temporarily.
./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /datadisks/disk1/workspace/_work/_temp/7404866d-8c11-4324-8bfe-b62b36813c80.sh
RepoTasks -> /datadisks/disk1/workspace/_work/1/s/artifacts/bin/RepoTasks/Release/net6.0/RepoTasks.dll
Successfully created package '/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.Client.ItemTemplates.6.0.0-ci.nupkg'.
Successfully created package '/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.ItemTemplates.6.0.0-ci.nupkg'.
Preparing environment for tests
Removed directory /datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/BlazorTemplates.Tests/bin/Release/net6.0/TestTemplates/
Removed directory /datadisks/disk1/workspace/_work/1/s/obj/template-restore/
Created directory /datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/BlazorTemplates.Tests/bin/Release/net6.0/TestTemplates/
Created directory /datadisks/disk1/workspace/_work/1/s/obj/template-restore/
Successfully created package '/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.ProjectTemplates.6.0.6.0.0-ci.nupkg'.
/datadisks/disk1/workspace/_work/1/s/.dotnet/sdk/6.0.100-preview.4.21222.6/Microsoft.Common.CurrentVersion.targets(4965,5): error MSB3026: Could not copy "/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg" to "bin/Release/net6.0/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg". Beginning retry 1 in 1000ms. The process cannot access the file '/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg' because it is being used by another process. [/datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj]
##[error].dotnet/sdk/6.0.100-preview.4.21222.6/Microsoft.Common.CurrentVersion.targets(4965,5): error MSB3026: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not copy "/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg" to "bin/Release/net6.0/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg". Beginning retry 1 in 1000ms. The process cannot access the file '/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg' because it is being used by another process.
Successfully created package '/datadisks/disk1/workspace/_work/1/s/artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0.6.0.0-ci.nupkg'.
Preparing environment for tests
Removed directory /datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/test/bin/Release/net6.0/TestTemplates/
Removed directory /datadisks/disk1/workspace/_work/1/s/obj/template-restore/
Created directory /datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/test/bin/Release/net6.0/TestTemplates/
Created directory /datadisks/disk1/workspace/_work/1/s/obj/template-restore/
BlazorTemplates.Tests -> /datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/BlazorTemplates.Tests/bin/Release/net6.0/BlazorTemplates.Tests.dll
ProjectTemplates.Tests -> /datadisks/disk1/workspace/_work/1/s/src/ProjectTemplates/test/bin/Release/net6.0/ProjectTemplates.Tests.dll
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 36 (32 by maintainers)
I suggest examining a binary log and trying to determine what else is accessing the file. We don’t use
mono-based runtimes ourselves and unfortunately can’t help directly.That’s a different issue, see https://github.com/dotnet/aspnetcore/pull/37715 and https://teams.microsoft.com/l/message/19:8d76f8f67d8e4237b9f0b87235ec870e@thread.skype/1634747033503?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=fdff90ed-0b3b-4caa-a30a-efb4dd47665f&parentMessageId=1634747033503&teamName=DotNet&channelName=ASP.NET Build&createdTime=1634747033503 for context
Ah, rerun overwrote the _Logs artifact 😦 I got the dumps from the Windows_Test_Dumps artifact. Went looking there because we capture
dotnetdumps now and the process didn’t exit normally according to the console logs for the first attempt.Might be interesting to include the attempt number in some of the artifact names❔