microsoft / microsoft/MSBuildCache

ystem.InvalidOperationException: File access reported from process

Open
#159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
64
Forks
24
Avg merge
1d 14h
Merged PRs (30d)
2

Description

https://dev.azure.com/dnceng-public/public/_build/results?buildId=1523806&view=logs&j=1f132584-ab08-5fbf-e5d0-5685de454342&t=7bc96f1d-1be1-57c3-f7fb-1c61e7f4a005

MSBUILD : warning : HandleFileAccess failed after 0 ms: System.InvalidOperationException: File access reported from process `ProcessId: 2192` after the project finished. This may lead to incorrect caching. Node Id: SRC_ADAPTER_MSTESTADAPTER.PLATFORMSERVICES_MSTESTADAPTER.PLATFORMSERVICES.CSPROJ_OKU0DL90CASQU8S9EBLOAA, Path: C:\Windows\System32\ci.dll
MSBUILD : warning :    at Microsoft.MSBuildCache.FileAccess.FileAccessRepository.FileAccessesState.AddFileAccess(FileAccessData fileAccessData) in D:\a\_work\1\s\src\Common\FileAccess\FileAccessRepository.cs:line 215
MSBUILD : warning :    at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.HandleFileAccessInner(FileAccessContext fileAccessContext, FileAccessData fileAccessData) in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 511
MSBUILD : warning :    at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.<>c__DisplayClass62_0.<HandleFileAccess>b__0() in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 491
MSBUILD : warning :    at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.TimeAndLog(PluginLoggerBase logger, Action inner, String memberName) in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 1329


Unhandled Exception: System.InvalidOperationException: File access reported from process `ProcessId: 2192` after the project finished. This may lead to incorrect caching. Node Id: SRC_ADAPTER_MSTESTADAPTER.PLATFORMSERVICES_MSTESTADAPTER.PLATFORMSERVICES.CSPROJ_OKU0DL90CASQU8S9EBLOAA, Path: C:\Windows\System32\ci.dll
   at Microsoft.MSBuildCache.FileAccess.FileAccessRepository.FileAccessesState.AddFileAccess(FileAccessData fileAccessData) in D:\a\_work\1\s\src\Common\FileAccess\FileAccessRepository.cs:line 215
   at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.HandleFileAccessInner(FileAccessContext fileAccessContext, FileAccessData fileAccessData) in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 511
   at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.<>c__DisplayClass62_0.<HandleFileAccess>b__0() in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 491
   at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.TimeAndLog(PluginLoggerBase logger, Action inner, String memberName) in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 1340
   at Microsoft.MSBuildCache.MSBuildCachePluginBase`1.HandleFileAccess(FileAccessContext fileAccessContext, FileAccessData fileAccessData) in D:\a\_work\1\s\src\Common\MSBuildCachePluginBase.cs:line 493
   at Microsoft.Build.ProjectCache.ProjectCacheService.<>c__DisplayClass19_1.<CreateAndInitializePluginAsync>b__2(BuildRequest buildRequest, FileAccessData fileAccessData)
   at Microsoft.Build.FileAccesses.FileAccessManager.ReportFileAccess(FileAccessData fileAccessData, Int32 nodeId)
   at Microsoft.Build.BackEnd.DetouredNodeLauncher.DetoursEventListener.HandleFileAccess(FileAccessData fileAccessData)
   at BuildXL.Processes.SandboxedProcessReports.FileAccessReportLineReceived[T](T& data, FileAccessReportProvider`1 parser, Boolean isAnAugmentedFileAccess, String& errorMessage) in \.\Public\Src\Engine\Processes\SandboxedProcessReports.cs:line 849
   at BuildXL.Processes.SandboxedProcessReports.ReportLineReceived(String data) in \.\Public\Src\Engine\Processes\SandboxedProcessReports.cs:line 378
   at BuildXL.Processes.SandboxedProcess.ReportLineReceived(String data) in \.\Public\Src\Engine\Processes\SandboxedProcess.cs:line 555
   at BuildXL.Processes.Internal.AsyncPipeReader.FlushMessageQueue() in \.\Public\Src\Engine\Processes\Internal\AsyncPipeReader.cs:line 435
   at BuildXL.Processes.Internal.AsyncPipeReader.GetLinesFromCharBuffers(Int32 len) in \.\Public\Src\Engine\Processes\Internal\AsyncPipeReader.cs:line 410
   at BuildXL.Processes.Internal.AsyncPipeReader.BuildXL.Native.Streams.IIOCompletionTarget.OnCompletion(FileAsyncIOResult asyncIOResult) in \.\Public\Src\Engine\Processes\Internal\AsyncPipeReader.cs:line 314
   at BuildXL.Native.Streams.Windows.IOCompletionManager.<>c.<ReleaseOvelappedAndQueueCompletionNotification>b__18_0(Object state) in \.\Public\Src\Utilities\Native\Streams\Windows\IOCompletionManager.cs:line 255
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Azure build log, then trace the failure through Common/FileAccess/FileAccessRepository.cs at line 215 and Common/MSBuildCachePluginBase.cs at lines 491 and 511. Confirm how the late file-access report is produced and establish the expected behavior for this case; done should include a reproducible diagnosis and a regression check showing the build no longer fails unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.