{"record":{"id":"1c50206b3ce1202e","repo":"microsoft/aspire","slug":"docker-compose-file-not-found-at-dockercomposefilepath","errorCode":null,"errorMessage":"Docker Compose file not found at {dockerComposeFilePath}","messagePattern":"Docker Compose file not found at (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs","lineNumber":436,"sourceCode":"        }\n\n        foreach (var (name, value) in activationEnvironmentVariables)\n        {\n            environmentVariables.TryAdd(name, value);\n        }\n    }\n\n    private static OtlpExporterAnnotation? GetEffectiveOtlpExporterAnnotation(IResource resource)\n        => resource.Annotations.OfType<OtlpExporterAnnotation>().LastOrDefault();\n\n    private async Task DockerComposeUpAsync(PipelineStepContext context)\n    {\n        var outputPath = PublishingContextUtils.GetEnvironmentOutputPath(context, this);\n        var dockerComposeFilePath = Path.Combine(outputPath, \"docker-compose.yaml\");\n\n        if (!File.Exists(dockerComposeFilePath))\n        {\n            throw new InvalidOperationException($\"Docker Compose file not found at {dockerComposeFilePath}\");\n        }\n\n        var runtime = await context.Services.GetRequiredService<IContainerRuntimeResolver>().ResolveAsync(context.CancellationToken).ConfigureAwait(false);\n\n        var deployTask = await context.ReportingStep.CreateTaskAsync(\n            new MarkdownString($\"Running compose up for **{Name}** using **{runtime.Name}**\"),\n            context.CancellationToken).ConfigureAwait(false);\n        await using (deployTask.ConfigureAwait(false))\n        {\n            try\n            {\n                var composeContext = CreateComposeOperationContext(context);\n\n                await runtime.ComposeUpAsync(composeContext, context.CancellationToken).ConfigureAwait(false);\n\n                // Persist deployment state so destroy can find the compose file and project name\n                var deploymentStateManager = context.Services.GetRequiredService<IDeploymentStateManager>();\n                var stateSection = await deploymentStateManager.AcquireSectionAsync($\"DockerCompose:{Name}\", context.CancellationToken).ConfigureAwait(false);","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs#L418-L454","documentation":"DockerComposeUpAsync runs 'compose up' during deployment, but first checks that docker-compose.yaml exists in the environment's publish output path. If the file is absent, deployment cannot proceed and it throws InvalidOperationException with the expected full path. This means the publish step that generates the compose file did not run or wrote elsewhere.","triggerScenarios":"Deploying a DockerComposeEnvironment when the publish step did not emit docker-compose.yaml into the environment output directory — publish phase skipped, output path customized, or the file named/emitted differently by an earlier failing step.","commonSituations":"Running the deploy step standalone without publish; CI pipelines that cleaned or relocated the artifacts folder; a publishing failure earlier in the pipeline silently leaving no output; stale output path configuration (PublishingContextUtils.GetEnvironmentOutputPath pointing at the wrong folder).","solutions":["Run the full publish/deploy pipeline ( aspire publish then aspire deploy, or the complete pipeline) so docker-compose.yaml is generated before compose up.","Check the path in the error message and verify the file exists there; if not, inspect earlier publish step logs for failures.","Verify no custom output-path configuration moved the artifacts to a different directory."],"exampleFix":"// before (deploy without publish output)\naspire deploy\n// after: generate the compose file first\naspire publish\naspire deploy\n// and confirm <output-path>/docker-compose.yaml exists","handlingStrategy":"validation","validationCode":"// before deploy, verify the compose file exists in the output path\nvar outputPath = PublishingContextUtils.GetEnvironmentOutputPath(context, environmentResource);\nvar composeFile = Path.Combine(outputPath, \"docker-compose.yaml\");\nif (!File.Exists(composeFile))\n    throw new InvalidOperationException($\"Run publish first; expected compose file at {composeFile}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run the publish step before deploy so docker-compose.yaml is generated","Check earlier publish step logs for silent failures before deploying","Verify custom output-path configuration matches where deploy looks for artifacts"],"tags":["docker-compose","deployment","file-not-found","publish"],"backgroundTag":"file-not-found","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"}