{"record":{"id":"1e933b613cb825cb","repo":"microsoft/aspire","slug":"toolbox-name-changed-concurrently-version-version-was","errorCode":null,"errorMessage":"Toolbox '{name}' changed concurrently: version '{version}' was created or selected, but the Toolbox is no longer visible. No further changes were made.","messagePattern":"Toolbox '(.+?)' changed concurrently: version '(.+?)' was created or selected, but the Toolbox is no longer visible\\. No further changes were made\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Foundry/Toolbox/FoundryToolboxReconciler.cs","lineNumber":420,"sourceCode":"            throw CreateConcurrentChangeException(\n                definition.Name,\n                $\"default version '{expectedDefaultVersion}' matched, but version '{current.DefaultVersion}' with a different configuration is now the default\");\n        }\n    }\n\n    private async Task PromoteOwnedVersionAsync(\n        FoundryToolboxDeploymentDefinition definition,\n        string version,\n        string? observedDefaultVersion,\n        CancellationToken cancellationToken)\n    {\n        // Toolbox administration has no conditional update or ETag support. Re-read immediately\n        // before promotion and require the exact default observed while reconciling. Otherwise one\n        // Aspire deployment could overwrite another Aspire deployment's newer default. This is\n        // coordination, not an atomic lock: another writer can still update the Toolbox after the\n        // final read.\n        var before = await administration.GetAsync(definition.Name, cancellationToken).ConfigureAwait(false)\n            ?? throw CreateConcurrentChangeException(\n                definition.Name,\n                $\"version '{version}' was created or selected, but the Toolbox is no longer visible\");\n\n        ValidateOwnedDefault(definition.Name, before, concurrentChange: true);\n        ValidatePromotionTarget(definition, before, version);\n        if (string.Equals(before.DefaultVersion, version, StringComparison.Ordinal))\n        {\n            return;\n        }\n\n        if (observedDefaultVersion is null ||\n            !string.Equals(before.DefaultVersion, observedDefaultVersion, StringComparison.Ordinal))\n        {\n            var expectedDefault = observedDefaultVersion is null\n                ? \"no default version\"\n                : $\"default version '{observedDefaultVersion}'\";\n            throw CreateConcurrentChangeException(\n                definition.Name,","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Foundry/Toolbox/FoundryToolboxReconciler.cs#L402-L438","documentation":"Before promoting a Toolbox version to default, the reconciler re-reads the Toolbox (Foundry Toolbox administration has no ETag/conditional update) and requires it to still exist and match the reconciled state. This error means the version was created or selected successfully, but the Toolbox vanished before promotion - a concurrent writer deleted it. The reconciler made no further changes to avoid clobbering other deployments.","triggerScenarios":"PromoteOwnedVersionAsync calls administration.GetAsync(definition.Name) and receives null; ReconcileAsync throws the concurrent-change error via CreateConcurrentChangeException.","commonSituations":"Concurrent deployments where one deletes/recreates the Toolbox; manual portal deletion during a deploy; retention/cleanup policies removing the Toolbox mid-deployment.","solutions":["Re-run the deployment - it will recreate the Toolbox and retry promotion.","Ensure only one deployment mutates the same Foundry project at a time.","Investigate portal audit logs for the deleting actor.","Isolate environments to separate Foundry projects/Toolbox names."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await deploy.RunAsync();\n}\ncatch (Exception ex) when (ex.Message.Contains(\"no longer visible\"))\n{\n    logger.LogWarning(ex, \"Toolbox deleted concurrently; retrying deployment.\");\n    await deploy.RunAsync();\n}","preventionTips":["Use CI concurrency groups to serialize deployments against one Foundry project.","Exclude the Toolbox from cleanup/retention scripts while deploying.","Check audit logs to identify the concurrent deleting actor."],"tags":["azure","foundry","toolbox","concurrency","deployment"],"backgroundTag":"concurrent-modification","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"}