CoplayDev/unity-mcp · error · InvalidOperationException
Missing synced file: {remoteEntry.Key}
Error message
Missing synced file: {remoteEntry.Key} What it means
ValidateFileHashes runs after ApplyPlan writes all files. For each remote file it resolves the local path and checks File.Exists; a missing file means a write silently failed or the file disappeared, so the sync is reported as inconsistent rather than silently incomplete.
Source
Thrown at MCPForUnity/Editor/Setup/SkillSyncService.cs:475
var targetFile = ResolvePathUnderRoot(targetRoot, relativePath, pathComparison);
if (File.Exists(targetFile))
{
File.Delete(targetFile);
}
}
RemoveEmptyDirectories(targetRoot);
}
private static void ValidateFileHashes(string installRoot, Dictionary<string, string> remoteFiles, StringComparison pathComparison, Action<string> log)
{
var checkedCount = 0;
foreach (var remoteEntry in remoteFiles)
{
var localPath = ResolvePathUnderRoot(installRoot, remoteEntry.Key, pathComparison);
if (!File.Exists(localPath))
{
throw new InvalidOperationException($"Missing synced file: {remoteEntry.Key}");
}
var localBlobSha = ComputeGitBlobSha1(localPath);
if (!string.Equals(localBlobSha, remoteEntry.Value, StringComparison.Ordinal))
{
throw new InvalidOperationException($"File hash mismatch: {remoteEntry.Key} ({ShortHash(localBlobSha)} != {ShortHash(remoteEntry.Value)})");
}
checkedCount++;
}
log?.Invoke($"Hash checks passed ({checkedCount}/{remoteFiles.Count}).");
}
internal static string ComputeGitBlobSha1(string filePath)
{
var bytes = File.ReadAllBytes(filePath);
return ComputeGitBlobSha1(bytes);View on GitHub (pinned to c21bf496bc)
Solutions
- Shorten the install directory path to stay under Windows' 260-char limit.
- Free disk space and confirm write permissions on the install dir.
- Exclude the install dir from antivirus/OneDrive real-time scanning.
- Retry the sync after fixing the environment.
Defensive patterns
Strategy: validation
Prevention
- Keep install paths short to avoid Windows MAX_PATH limits.
- Exclude the install dir from antivirus/OneDrive real-time scanning.
- Confirm disk space and write permissions before syncing.
When it happens
Trigger: File write failed (disk full, permission denied); antivirus/quarantine removed the file immediately; Windows MAX_PATH (260 char) exceeded so the write path was invalid; another process moved/deleted the file.
Common situations: Windows long-path limit on deep install directories; OneDrive/Defender real-time scanning quarantines new files; disk full; install dir on a read-only mount.
Related errors
- Selected folder does not exist.
- The selected uvx executable does not exist
- The selected Claude CLI executable does not exist
- Screenshot folder '{folderOverride}' resolves outside the Un
- Source directory not found: {dir.FullName}
AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13).
Data as JSON: /api/errors/7c979fd3b7a2845e.
Report an issue: GitHub.