{"record":{"id":"1d94f2f94c8cf352","repo":"microsoft/aspire","slug":"container-runtime-did-not-return-image-configuration-for","errorCode":null,"errorMessage":"Container runtime did not return image configuration for '{imageReference}'.","messagePattern":"Container runtime did not return image configuration for '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs","lineNumber":1123,"sourceCode":"    private static async Task<ContainerImageMetadata> InspectLocalContainerImageAsync(PipelineStepContext context, string imageReference)\n    {\n        var runtime = await ResolveContainerRuntimeAsync(context).ConfigureAwait(false);\n        var result = await runtime.InspectImageConfigAsync(imageReference, context.CancellationToken).ConfigureAwait(false);\n        if (result.Status == ContainerImageInspectionStatus.Unsupported)\n        {\n            throw new NotSupportedException(\n                $\"Container runtime '{runtime.Name}' does not support image configuration inspection, which is required for Azure sandbox deployment.\");\n        }\n\n        if (result.Status == ContainerImageInspectionStatus.Failed)\n        {\n            throw new InvalidOperationException(\n                result.ErrorMessage ?? $\"Container runtime failed to inspect image configuration '{imageReference}'.\");\n        }\n\n        if (!result.TryGetConfig(out var config))\n        {\n            throw new InvalidOperationException($\"Container runtime did not return image configuration for '{imageReference}'.\");\n        }\n\n        return new ContainerImageMetadata(\n            config.Entrypoint,\n            config.Command,\n            new Dictionary<string, string>(StringComparer.Ordinal),\n            config.WorkingDirectory,\n            new HashSet<string>(StringComparer.OrdinalIgnoreCase));\n    }\n\n    private static Task<IContainerRuntime> ResolveContainerRuntimeAsync(PipelineStepContext context)\n    {\n        return context.Services.GetRequiredService<IContainerRuntimeResolver>().ResolveAsync(context.CancellationToken);\n    }\n\n    internal static async Task<ResolvedEnvironmentVariables> ResolveEnvironmentVariablesAsync(PipelineStepContext context, IResource resource)\n    {\n        var environmentVariables = new Dictionary<string, object>();","sourceCodeStart":1105,"sourceCodeEnd":1141,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs#L1105-L1141","documentation":"Even when config inspection reports success, the integration requires an actual config payload (TryGetConfig). If the runtime returned a success status but no parseable configuration object, this InvalidOperationException is thrown, indicating an empty or malformed inspection result rather than a hard failure.","triggerScenarios":"InspectImageConfigAsync returns a non-failed status but the result contains no config entry — e.g. a runtime adapter that reports success with an empty payload, or an image with an anomalous/empty config blob.","commonSituations":"Bugs or version drift in the container runtime CLI producing output the adapter cannot parse into a config; images with empty/legacy config blobs; adapter/runtime version mismatch after a runtime upgrade.","solutions":["Verify the runtime can dump the config: `docker image inspect --format '{{json .Config}}' <image>`; if empty, re-pull the image.","Upgrade or align the container runtime version with the Aspire integration expectations.","Re-pull the image (docker pull) to replace a potentially corrupt or anomalous config blob.","If it persists, capture the raw inspect output and file an issue against the integration's runtime adapter."],"exampleFix":"// before (shell)\n# runtime returns success but empty config\ndocker image inspect myapp   # malformed output\n\n// after\ndocker pull myapp && docker image inspect --format '{{json .Config}}' myapp   # valid config, retry deploy","handlingStrategy":"retry","validationCode":"var cfg = await GetImageConfigJsonAsync(\"docker\", \"image inspect --format '{{json .Config}}' <image>\");\nif (string.IsNullOrWhiteSpace(cfg)) throw new InvalidOperationException(\"Runtime returned empty image config; re-pull the image.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await DeployToSandboxAsync(...);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"did not return image configuration\"))\n{\n    logger.LogWarning(ex, \"Empty config from runtime; re-pulling image and retrying.\");\n    await RepullAndRetryAsync(...);\n}","preventionTips":["Re-pull images whose inspect output looks empty or malformed.","Keep runtime CLI versions aligned with integration expectations.","Report persistent empty-config results with raw inspect output to the integration maintainers."],"tags":["containers","docker","image","sandbox"],"backgroundTag":"unexpected-response-shape","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"}