CoplayDev/unity-mcp · error · Exception
Could not find external project's validation results
Error message
Could not find external project's validation results
What it means
Thrown by ExternalProjectValidator.ParseValidationResult when CachingService.GetCachedValidatorStateData cannot find cached results for the external project path. The external validation flow runs in a temporary project and stores results in a cache keyed by project path; if that cache is missing or was cleared, parsing cannot proceed.
Source
Thrown at TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Validator/Scripts/ExternalProjectValidator.cs:165
}
if (exitCode != 0)
{
result.Status = ValidationStatus.Failed;
result.Exception = new Exception($"Validating the temporary project failed (exit code {exitCode})\n\nMore information can be found in the log file: {logFilePath}");
}
else
{
result.Status = ValidationStatus.RanToCompletion;
}
return result;
}
private ValidationResult ParseValidationResult(string externalProjectPath)
{
if (!CachingService.GetCachedValidatorStateData(externalProjectPath, out var validationStateData))
throw new Exception("Could not find external project's validation results");
var cachedResult = validationStateData.GetResults();
var cachedTestResults = cachedResult.GetResults();
var tests = GetApplicableTests(ValidationType.Generic, ValidationType.UnityPackage);
foreach (var test in tests)
{
if (!cachedTestResults.Any(x => x.Key == test.Id))
continue;
var matchingTest = cachedTestResults.First(x => x.Key == test.Id);
test.Result = matchingTest.Value;
}
var result = new ValidationResult()
{
Status = cachedResult.GetStatus(),
HadCompilationErrors = cachedResult.GetHadCompilationErrors(),
View on GitHub (pinned to c21bf496bc)
Solutions
- Re-run the full external validation flow so CachingService stores fresh results before parsing.
- Ensure the externalProjectPath used for parsing exactly matches the path used during the validation run.
- Avoid clearing the caching service temp directory between validation and result parsing.
Example fix
// before // parse immediately after a cache wipe var res = validator.ParseValidationResult(projectPath); // after // run validation first so results are cached, then parse await validator.RunValidation(); var res = validator.ParseValidationResult(projectPath);
Defensive patterns
Strategy: retry
Validate before calling
if (!CachingService.GetCachedValidatorStateData(path, out _))
throw new Exception($"No cached results for {path}; run validation first"); Type guard
static bool HasCachedResults(string path) =>
CachingService.GetCachedValidatorStateData(path, out _); Try / catch
try { return validator.ParseValidationResult(path); }
catch (Exception ex) when (ex.Message.Contains("validation results")) { /* re-run validation */ } Prevention
- Run the full validation flow before parsing results.
- Keep the cache path stable between run and parse.
When it happens
Trigger: Calling ParseValidationResult(externalProjectPath) when the temporary validation project never completed, the caching service was reset, the cache key (project path) differs from what was written, or the validation run crashed before caching results.
Common situations: The temporary project was cleaned up (e.g. by a temp-dir sweep or editor restart) before results were read; the validation run was interrupted; or the externalProjectPath passed to parse differs (absolute vs relative, trailing slash) from the one used during caching.
Related errors
- No validation paths were set
- The following directories do not exist:
- Package was not found
- Path does not correspond to a valid package
- Source directory not found: {dir.FullName}
AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13).
Data as JSON: /api/errors/30bc8c9555f3d26d.
Report an issue: GitHub.