-
Notifications
You must be signed in to change notification settings - Fork 16
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
Dapr Extension fails to start sidecar when in Dev Container spawn /bin/sh ENOENT
#247
Comments
Here is my workaround until this is fixed. Below, you can find a working example for a Launch Configuration and the accordings Tasks for starting the Dapr Sidecar, building a .NET Web Application and attach the Debugger to it. It will also kill the Dapr sidecar afterwards. {
"version": "0.2.0",
"configurations": [
{
"name": "Launch Main",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "daprd-main-debug",
"program": "${workspaceFolder}/src/webservices/main/Wemogy.Subscriptions.Webservices.Main.Api/bin/Debug/net6.0/Wemogy.Subscriptions.Webservices.Main.Api.dll",
"args": [],
"cwd": "${workspaceFolder}/src/webservices/main/Wemogy.Subscriptions.Webservices.Main.Api",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(http?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
},
"postDebugTask": "daprd-main-down"
}
]
} {
"version": "2.0.0",
"tasks": [
{
"label": "build-main",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/webservices/main/Wemogy.Subscriptions.Webservices.Main.Api/Wemogy.Subscriptions.Webservices.Main.Api.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
// As the official daprd Tasks don't work in Visual Studio Code Dev Containers currently, we manually create
// shell tasks. GitHub Issue: https://github.com/microsoft/vscode-dapr/issues/247
{
"label": "daprd-main-debug",
"type": "shell",
"dependsOn": "build-main",
"command": "daprd",
"args": [
"--app-id",
"main",
"--app-port",
"60200",
"--components-path",
"env/dapr/components",
"--placement-host-address",
"",
"--log-level",
"debug"
],
"isBackground": true,
"problemMatcher": {
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"beginsPattern": "^.*starting Dapr Runtime.*",
"endsPattern": "^.*(waiting on port|dapr initialized)"
}
}
},
{
"label": "daprd-main-down",
"type": "shell",
"command": "pkill",
"args": ["-9", "-f", "daprd --app-id main"],
"presentation": {
"clear": true,
"close": true,
"reveal": "never"
}
}
]
} |
@robinmanuelthiel I can reproduce this, but have no idea yet what path it's complaining about. I get the same error even when I explicitly specify the path to |
@robinmanuelthiel So it appears to be this: the Dapr extension is running locally instead of in the container, and hence why it can't find what it's looking for. If I add the extension to the For some reason, I have to also go into the extensions tab, locate the Dapr extension, and then press the "reload required" button (which then seems to switch between local and remote). I'm not sure why this is necessary; perhaps because it was already being used locally prior to opening the workspace in the Dev Container? I'll have to look into that further. |
Facing this issue too. Any resolution? |
A solution for this problem would be awesome. The reload solution works fine but this problem makes it difficult to rollout to this to the rest of our IT departement. |
Adding |
I am trying to use Dapr within a Visual Studio Dev Container. Whenever I want to start the Dapr sidecar using the official
daprd
Visual Studio Code Task, thespawn /bin/sh ENOENT
error appears. When I enter the same command manually to the command line, it works fine.This is my
tasks.json
file:Does this occur consistently? Yes
Repro steps:
daprd
taskspawn /bin/sh ENOENT
errorDetails
Find some details about the Dev Container config here.
Dev Container Configuration details
Dockerfile
:devcontainer.json
:Action: vscode-dapr.tasks.daprd
Error type: ENOENT
Error Message: spawn /bin/sh ENOENT
Version: 0.6.0
OS: darwin
OS Release: 21.5.0
Product: Visual Studio Code
Product Version: 1.69.0
Language: en
The text was updated successfully, but these errors were encountered: