-
Notifications
You must be signed in to change notification settings - Fork 700
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I'm trying to use aspire exec
to run a command inside the docker container corresponding to a database resource.
The command I need to run has a parameter value that can contain spaces and must be escaped with double quotes: tool --arg "foo bar"
. When using aspire exec
to run this command, the tool fails as if it was called with tool --arg foo bar
instead (no double quotes), and complains that bar
is not a valid option.
It looks like the argument parsing done in the aspire CLI somehow drops the double-quotes at some point, or forgets to emit them when running the command inside the docker container? Or maybe there is a specific escaping that must be applied to flow through two "layers" of command lines?
Steps To Reproduce
Example:
- I have a docker resource called
fdb
that runs a linux-based image inside a docker container. - Using Docker Desktop, I can execute
fdbcli --exec "status details"
inside the running container. This command instructs the FoundationDB cli tool to run thestatus details
command - which contains a space - hence why it must be escaped. - From the host, when I run
aspire exec -s fdb -- fdbcli --exec "status details"
, the tool starts but exits with an error message complaining about thedetails
argument not being valid. - If, from the docker container itself, I run
fdbcli --exec status details
(without double quotes) I get the same error message as viaaspire exec
(with double quotes). This makes me believe that aspire is not emitting the"..."
correctly - When I call the same tool but with any other combination of arguments that do not require escaping a space via double quotes, I get the expected output.
I tried various escaping variants, none of them worked:
aspire exec -s fdb -- fdbcli --exec 'status details'
(single quotes)aspire exec -s fdb -- fdbcli --exec \"status details\"
(escaping the double quotes)aspire exec -s fdb -- fdbcli --exec status\ details
(escaping only the space)
Things that worked as intended:
aspire exec -s fdb -- fdbcli
(no arguments, runs a shell that exits immediatly, probably because stdin is not proxied)aspire exec -s fdb -- fdbcli --version
(single argument, outputs the version of the tool)aspire exec -s fdb -- fdbcli --exec "status"
(argument value without spaces)
Exceptions (if any)
No exceptions visible from aspire cli or the apphost itself.
.NET Version info
Aspire 9.5.0, windows 11, .NET 10 RC1.
.NET SDK:
Version: 10.0.100-rc.1.25451.107
Commit: 2db1f5ee2b
Workload version: 10.0.100-manifests.a6e8bec0
MSBuild version: 17.15.0-preview-25451-107+2db1f5ee2
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 10.0.0-rc.1.25451.107
Architecture: x64
Commit: 2db1f5ee2b