-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] .NET Aspire - Bind Mount upload operation fails #4413
Comments
@vhvb1989 can you take a look? |
Same issue I think: var builder = DistributedApplication.CreateBuilder(args);
// PG SQL container is configured with an auto-generated password by default
// and supports setting the default database name via an environment variable & running *.sql/*.sh scripts in a bind mount.
var databaseName = "keyval-db";
var databaseReference = builder.AddPostgres("keyval-storage")
// Set the name of the default database to auto-create on container startup.
.WithEnvironment("POSTGRES_DB", databaseName)
// Mount the SQL scripts directory into the container so that the init scripts run.
.WithBindMount("../Project/Database/Scripts", "/docker-entrypoint-initdb.d")
// Add the default database to the application model so that it can be referenced by other resources.
.AddDatabase(databaseName);
builder
.AddProject<Project>("keyval-api")
.WithExternalHttpEndpoints()
.WithReference(databaseReference)
.WaitFor(databaseReference);
builder.Build().Run(); At first I saw this error in the terminal:
Regardless, the env deployed correctly. However, the initdb part did work - so app failed. I went back an ran
|
Thank you for trying and reporting this. |
Quick update. I couldn't reproduce using the mysql sample from aspire repo playground. When using a different drive, azd is using a temp folder in C:/ and fails to create the path to outside of C:/ Will try to repro using a non C:/ drive |
Hi @vhvb1989, beside the temp folder, there is also the fact then when I try to upload from the correct one, I get this error:
FYI, it is currently impossible to repro from the dev drive using WSL because of this: microsoft/WSL#12156. But the BadRequest thing happens on windows as well. |
Output from
azd version
azd version 1.10.1 (commit 31409a3)
Describe the bug
I have the following aspire container resource, using a BindMount:
This is what running azd infra synth with the
azd operations feature on
will generate on Windows:Running the same command on WSL will generate this:
On Windows,
azd up
will fail because the path for the file to be uploaded cannot be found. I think this might be cause by the fact that the path is formed as <TEMP_FOLDER>/<PATH_TO_FILE>/dab-config.json.On WSL,
azd up
will fail because it uses the PUT verb, which is not supported:To Reproduce
Expected behavior
I expect the azd provision step to be able to upload the file referenced in the BindMount.
Environment
Information on your environment:
* .NET Aspire 8.2.0
* IDE and version : VS Code
* OS: Windows and WSL (Ubuntu 22.04.4 LTS)
The text was updated successfully, but these errors were encountered: