{"record":{"id":"7c979fd3b7a2845e","repo":"CoplayDev/unity-mcp","slug":"missing-synced-file-remoteentry-key","errorCode":null,"errorMessage":"Missing synced file: {remoteEntry.Key}","messagePattern":"Missing synced file: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Setup/SkillSyncService.cs","lineNumber":475,"sourceCode":"                var targetFile = ResolvePathUnderRoot(targetRoot, relativePath, pathComparison);\n                if (File.Exists(targetFile))\n                {\n                    File.Delete(targetFile);\n                }\n            }\n\n            RemoveEmptyDirectories(targetRoot);\n        }\n\n        private static void ValidateFileHashes(string installRoot, Dictionary<string, string> remoteFiles, StringComparison pathComparison, Action<string> log)\n        {\n            var checkedCount = 0;\n            foreach (var remoteEntry in remoteFiles)\n            {\n                var localPath = ResolvePathUnderRoot(installRoot, remoteEntry.Key, pathComparison);\n                if (!File.Exists(localPath))\n                {\n                    throw new InvalidOperationException($\"Missing synced file: {remoteEntry.Key}\");\n                }\n\n                var localBlobSha = ComputeGitBlobSha1(localPath);\n                if (!string.Equals(localBlobSha, remoteEntry.Value, StringComparison.Ordinal))\n                {\n                    throw new InvalidOperationException($\"File hash mismatch: {remoteEntry.Key} ({ShortHash(localBlobSha)} != {ShortHash(remoteEntry.Value)})\");\n                }\n\n                checkedCount++;\n            }\n\n            log?.Invoke($\"Hash checks passed ({checkedCount}/{remoteFiles.Count}).\");\n        }\n\n        internal static string ComputeGitBlobSha1(string filePath)\n        {\n            var bytes = File.ReadAllBytes(filePath);\n            return ComputeGitBlobSha1(bytes);","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Setup/SkillSyncService.cs#L457-L493","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["filesystem","validation","windows"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}