{"record":{"id":"a582951e2cd9b657","repo":"microsoft/aspire","slug":"aspire-skills-bundle-version-0-does-not-match-expected","errorCode":null,"errorMessage":"Aspire skills bundle version '{0}' does not match expected version '{1}'.","messagePattern":"Aspire skills bundle version '(.+?)' does not match expected version '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Agents/AspireSkills/AspireSkillsInstaller.cs","lineNumber":924,"sourceCode":"\n    internal static bool IsCacheLockContention(IOException exception, bool isWindows)\n    {\n        if (isWindows)\n        {\n            return exception.HResult is WindowsSharingViolationHResult or WindowsLockViolationHResult;\n        }\n\n        // On Unix, FileStream implements FileShare.None with a non-blocking flock and exposes\n        // EWOULDBLOCK as the raw errno in IOException.HResult: 11 on Linux and 35 on macOS.\n        // See https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs.\n        return exception.HResult is LinuxWouldBlockHResult or MacOsWouldBlockHResult;\n    }\n\n    private static void ValidateBundleVersion(AspireSkillsBundle bundle, string expectedVersion)\n    {\n        if (!string.Equals(bundle.Version, expectedVersion, StringComparison.OrdinalIgnoreCase))\n        {\n            throw new InvalidOperationException(string.Format(\n                CultureInfo.InvariantCulture,\n                \"Aspire skills bundle version '{0}' does not match expected version '{1}'.\",\n                bundle.Version,\n                expectedVersion));\n        }\n    }\n\n    private static string ComputeArchiveSha256(string archivePath)\n    {\n        using var stream = File.OpenRead(archivePath);\n        return Convert.ToHexString(SHA256.HashData(stream)).ToLowerInvariant();\n    }\n\n    private static string ComputeArchiveSha512(string archivePath)\n    {\n        using var stream = File.OpenRead(archivePath);\n        return Convert.ToHexString(SHA512.HashData(stream)).ToLowerInvariant();\n    }","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Agents/AspireSkills/AspireSkillsInstaller.cs#L906-L942","documentation":"ValidateBundleVersion compares the version embedded in a downloaded/unpacked Aspire skills bundle against the version the CLI expected. A mismatch means the bundle metadata does not describe the bundle that was requested — typically a corrupted, stale, or tampered cache/payload. The installer aborts rather than installing a bundle that may be from a different CLI release.","triggerScenarios":"Thrown by ValidateBundleVersion when bundle.Version is not equal (case-insensitive) to expectedVersion — i.e. the bundle loaded from cache or extracted from an embedded/downloaded archive declares a different version than the running CLI requires.","commonSituations":"A stale cache directory survives a CLI upgrade or downgrade; the bundle archive was corrupted or partially extracted; a cached bundle from a prerelease/daily channel is reused by a stable build; manual edits or copies of the cache directory.","solutions":["Clear the Aspire skills cache directory shown in the error and re-run the command so a fresh, matching bundle is staged.","Verify the installed CLI version matches the bundle version expected (aspire --version) and upgrade or downgrade the CLI accordingly.","Re-download/reinstall the skills bundle if using an explicit bundle source; the archive may be corrupt or from another channel.","If running daily vs stable channels, ensure you are not mixing cache between channels."],"exampleFix":"// before\n# stale cache after CLI upgrade\naspire skills install  // version '9.4.0' vs expected '9.5.0'\n// after\nrm -rf ~/.aspire/skills/cache\naspire skills install  // re-stages bundle matching current CLI","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await installer.InstallAsync(...);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"does not match expected version\"))\n{\n    // delete the stale cache directory and retry to force a fresh bundle\n}","preventionTips":["Clear the skills cache after upgrading or switching the CLI channel.","Do not share one cache directory across daily/stable CLI builds.","Re-run the install command after any interrupted (killed) install."],"tags":["versioning","cache","validation","cli"],"backgroundTag":"version-mismatch","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}