dapr / cli

Command-line tools for Dapr.
Apache License 2.0
315 stars 200 forks source link

Default components not being installed #1291

Closed NiloDrumond closed 1 year ago

NiloDrumond commented 1 year ago

CLI: 1.10.0 Runtime: 1.10.7

Expected Behavior

As step 5 of the getting started tutorial describes, a folder .dapr should be in my Home directory with the default components.

Actual Behavior

The default components folder is not being created when I run sudo dapr init:

➜ ~ ls $HOME/.dapr
ls: cannot access '/home/nilo/.dapr': No such file or directory

When I run sudo dapr run --app-id myapp --dapr-http-port 3500 (which is the next step on the getting started tutorial) I get the following output:

INFO[0000] loading components                            app_id=myapp instance=nilo-eesd scope=dapr.runtime type=log ver=1.10.7
WARN[0005] error processing component, daprd process will exit gracefully  app_id=myapp instance=nilo-eesd scope=dapr.runtime type=log ver=1.10.7
FATA[0005] process component pubsub error: [INIT_COMPONENT_FAILURE]: initialization error occurred for pubsub (pubsub.redis/v1): init timeout for component pubsub exceeded after 5s  app_id=myapp instance=nilo-eesd scope=dapr.runtime type=log ver=1.10.7
❌  The daprd process exited with error code: exit status 1

Which may or may not be related.

If I run run without sudo I get:

WARNING: no application command found.
❌  error validating resources path "/home/nilo/.dapr/components" : stat /home/nilo/.dapr/components: no such file or directory

It's also important to notice that running sudo dapr init gave no errors. Output:

➜ ~ sudo dapr init
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Docker Hub
ℹ️  Installing runtime version 1.10.7
←  Downloading binaries and setting up components...
Dapr runtime installed to /root/.dapr/bin, you may run the following to add it to your path if you want to run daprd directly:
    export PATH=$PATH:/root/.dapr/bin
✅  Downloading binaries and setting up components...
✅  Downloaded binaries and completed components set up.
ℹ️  daprd binary has been installed to /root/.dapr/bin.
ℹ️  dapr_placement container is running.
ℹ️  dapr_redis container is running.
ℹ️  dapr_zipkin container is running.
ℹ️  Use `docker ps` to check running containers.
✅  Success! Dapr is up and running. To get started, go here: https://aka.ms/dapr-getting-started

Running sudo docker ps also successfully listed the expected containers.

Steps to Reproduce the Problem

Environment:

All I did was follow the getting started tutorial for local development:

Release Note

RELEASE NOTE:

shubham1172 commented 1 year ago

sudo dapr init

Since you are running the command as sudo, your user's $HOME directory won't have .dapr.

I would recommend

Then try running the same commands. It is clear that in case of dapr run, it cannot find the .dapr directory (as expected).

dapr-bot commented 1 year ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

dapr-bot commented 1 year ago

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.