dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.91k stars 476 forks source link

Error viewing container volumes when a same host path is mounted at different places in a container using .NET Aspire 9 RC1 #6509

Closed asimmon closed 3 weeks ago

asimmon commented 3 weeks ago

Is there an existing issue for this?

Describe the bug

Using .NET Aspire 9 RC1, if the container has two or more bind mounts where the host path is the same, trying to open the container resource details in the dashboard will fail with the error "An unhandled error has occurred. [Reload]."

Image

There are cases where the same file or directory could be mounted in different places. It is common to mount a certificate authority bundle to these container paths:

/etc/ssl/certs/ca-certificates.crt                // Debian/Ubuntu/Gentoo etc.
/etc/pki/tls/certs/ca-bundle.crt                  // Fedora/RHEL 6
/etc/ssl/ca-bundle.pem                            // OpenSUSE
/etc/pki/tls/cacert.pem                           // OpenELEC
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem // CentOS/RHEL 7
/etc/ssl/cert.pem                                 // Alpine Linux

This is valid in Docker Desktop:

Image

Expected Behavior

No response

Steps To Reproduce

var builder = DistributedApplication.CreateBuilder(args);

builder.AddContainer("myapp", "mcr.microsoft.com/dotnet/samples", "aspnetapp")
    .WithBindMount("file.txt", "/foo/file.txt")
    .WithBindMount("file.txt", "/bar/file.txt");

builder.Build().Run();

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

Nothing else, much love.

drewnoakes commented 3 weeks ago

Thanks very much for the great bug report @asimmon.

This bug reproduces in release/9.0-rc1 but not in release/9.0. It was fixed in #6241.

FYI @JamesNK