Skip to content
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

flag provided but not defined: -app-id #147

Closed
tnsholding opened this issue Mar 21, 2021 · 6 comments
Closed

flag provided but not defined: -app-id #147

tnsholding opened this issue Mar 21, 2021 · 6 comments
Labels
need-more-info Needs more information from the submitter

Comments

@tnsholding
Copy link

tnsholding commented Mar 21, 2021

Trying out the extension (v.0,4.0) with a C# app based on the worker service template (dotnet new worker). Target framework net5.0.

I can successfully start app manually using dapr command, i.e.:
dapr run --app-id myApp -- dotnet run --dapr-http-port 3500

But trying to start a debug session in VSCode results in the following error:

> Executing task: daprd-debug <
> Executing command: daprd --app-id "myApp" --app-port "5000" --components-path "C:\Users\tnspr\.dapr\components" --placement-host-address "localhost:6050" <
flag provided but not defined: -app-id

I ran the task "Dapr: Scaffold Dapr Tasks" to create standard entries in launch.json and tasks.json.

Am I doing something wrong in setting up debugging in VSCode or is there an issue attaching to a worker service?

@philliphoff
Copy link
Collaborator

@tnsholding What version of dapr CLI/runtime are you using? What happens when you try to run that same command line (listed after Executing command:) on an actual terminal?

@philliphoff philliphoff added the need-more-info Needs more information from the submitter label Mar 22, 2021
@tnsholding
Copy link
Author

Running version 1.0.1 (both CLI and runtime).

When running the command in the terminal, I get the same error as inside VSCode.

@philliphoff
Copy link
Collaborator

@tnsholding That's really strange. If you run daprd --app-id "myApp" in a normal terminal window (i.e. not in VS Code), what happens? (This should be the minimal command required to start Dapr.). Are you running VS Code locally, or using a Dev Container, WSL, or SSH to connect to a remote "machine"?

@tnsholding
Copy link
Author

Sorry for the late reply...
When I run daprd --app-id "myApp" in a terminal window, I get the same error:
flag provided but not defined: -app-id

But noticed that running daprd --version gives
0.1.0

while dapr --version gives:

CLI version: 1.0.1
Runtime version: 1.0.1

Is daprd not updated correctly?

@philliphoff
Copy link
Collaborator

philliphoff commented Mar 30, 2021

@tnsholding Ah, I think I might know what's happening. Early on, the Dapr runtime installation would add daprd to the PATH (which is where the VS Code tooling expects it). Later, the installer stopped adding it to the PATH (which required you to add it yourself if using the VS Code tooling). I bet you have multiple versions of daprd installed, an earlier (and outdated) version that's in the PATH and 1.0.1, which is not. You might want to check for that and, if it's the case, remove the outdated one (and add the new one to the PATH).

There was a feature (#139) recently implemented which allows you to be explicit about where the VS Code tooling expects binaries (if not in the PATH). I don't know when it'll be released, but you are free to use the CI builds in the meantime.

@tnsholding
Copy link
Author

Yes - that was exactly it. Thanks!
Very old installation of Dapr was added in the PATH. Once removed, I can now debug in VSCode with daprd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-more-info Needs more information from the submitter
Projects
None yet
Development

No branches or pull requests

2 participants