Skip to content

Improve logging when container fails to start #5993

@afscrome

Description

@afscrome

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

If you create a container with a bad image name (or any other scenario in which the container fails to start), it can be hard to troublehsoot why this is the case.

The container on the dashboard gets marked as "Failed to start"
image

But nothing shows in the dashboard logs to help you work out why the container fails to start
image

If you look at the app host console output, you do get some logs, but these are easy to miss - especially if you have a lot going on and the error gets quickly supersceeded by others.

fail: Aspire.Hosting.Dcp.dcpctrl.ContainerReconciler[0]
      could not create the container    {"Container": {"name":"mycontainer-xgdnxzrc"}, "Reconciliation": 3, "error": "docker command 'CreateContainer' returned with non-zero exit code 1: command output: Stdout: '' Stderr: 'Unable to find image 'docker.io/fake/does/not/exist:bad-tag' locally\nError response from daemon: manifest for docker.io/fake/does/not/exist:bad-tag not found: manifest unknown: manifest tagged by \"bad-tag\" is not found\n'"}

Describe the solution you'd like

I'd like to see the stdout and stderr from docker written to the console logs in the dashboard when a container fails to be created.

Something like:
image

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationarea-orchestrator

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions