CoplayDev/unity-mcp · error · InvalidOperationException
Remote directory not found: {normalizedSubdir}
Error message
Remote directory not found: {normalizedSubdir} What it means
After filtering the full tree by the skill subdir prefix, zero blob entries remained. The configured SkillSubdir (.claude/skills/unity-mcp-skill) does not exist at the fetched commit, so there is nothing to sync.
Source
Thrown at MCPForUnity/Editor/Setup/SkillSyncService.cs:239
? remotePath
: remotePath.Substring(subdirPrefix.Length);
if (string.IsNullOrWhiteSpace(relativePath) || string.IsNullOrWhiteSpace(entry.sha))
{
continue;
}
if (!TryNormalizeRelativePath(relativePath, out var safeRelativePath))
{
log?.Invoke($"Skip unsafe remote path: {remotePath}");
continue;
}
remoteFiles[safeRelativePath] = entry.sha.Trim().ToLowerInvariant();
}
if (remoteFiles.Count == 0)
{
throw new InvalidOperationException($"Remote directory not found: {normalizedSubdir}");
}
log?.Invoke($"Remote file count: {remoteFiles.Count}");
return new RemoteSnapshot(commitSha, normalizedSubdir, remoteFiles);
}
private static string FetchBranchHeadCommitSha(HttpClient client, GitHubRepoInfo repoInfo, string branch, Action<string> log)
{
var branchApiUrl = BuildBranchApiUrl(repoInfo, branch);
log?.Invoke($"Fetching branch head commit...");
var branchJson = DownloadString(client, branchApiUrl);
var branchResponse = JsonUtility.FromJson<GitHubBranchResponse>(branchJson);
var commitSha = branchResponse?.commit?.sha?.Trim();
if (string.IsNullOrWhiteSpace(commitSha))
{
throw new InvalidOperationException($"Failed to resolve branch head commit SHA for: {branch}");
}
View on GitHub (pinned to c21bf496bc)
Solutions
- Confirm the directory exists in the repo at the target branch via the GitHub UI.
- Switch to a branch that contains the skill files (main or beta).
- If the directory was renamed upstream, update to the latest version of the package.
- Use the default repo (CoplayDev/unity-mcp) which is known to contain the directory.
Defensive patterns
Strategy: validation
Prevention
- Confirm the skill directory exists on the target branch before syncing.
- Prefer the default repo/branch unless you maintain a fork with the same layout.
- Watch for upstream directory renames when upgrading the package.
When it happens
Trigger: The branch does not contain the skill directory; the directory was renamed or moved; the wrong branch was selected; a fork removed the skill files.
Common situations: Syncing against a branch that predates the skill directory; fork reorganized the repo layout; typo in the configured subdir (hardcoded constant).
Related errors
- Repo URL is not a recognized GitHub repository URL: {repoUrl
- Failed to resolve branch head commit SHA for: {branch}
- Failed to write config file '{path}': {ex.Message}
- The selected uvx executable does not exist
- The selected Claude CLI executable does not exist
AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13).
Data as JSON: /api/errors/4596bcb3bc8bee9e.
Report an issue: GitHub.