dapr / cli

Command-line tools for Dapr.
Apache License 2.0
317 stars 202 forks source link

ON executing sudo dapr init in Linux, getting below error #1268

Closed aditfield closed 1 year ago

aditfield commented 1 year ago

Expected Behavior

Dapr runs as a sidecar alongside your application. In self-hosted mode, this means it is a process on your local machine. By initializing Dapr, you:

Fetch and install the Dapr sidecar binaries locally. Create a development environment that streamlines application development with Dapr. Dapr initialization includes:

Running a Redis container instance to be used as a local state store and message broker. Running a Zipkin container instance for observability. Creating a default components folder with component definitions for the above. Running a Dapr placement service container instance for local actor support.

Actual Behavior

⌛ Making the jump to hyperspace... ℹ️ Container images will be pulled from Docker Hub ℹ️ Installing runtime version 1.10.4 ❌ Downloading binaries and setting up components... ❌ docker: Error response from daemon: driver failed programming external connectivity on endpoint dapr_redis (701042885ff90ea7fb115e1a88a06f2d201e70d45ae37c853dd5f44a4d1dbf04): Error starting userland proxy: listen tcp4 0.0.0.0:6379: bind: address already in use.

Steps to Reproduce the Problem

I have setup Ubuntu 22.0.4 LTS WSL env.

  1. Installed docker
  2. Tested Hello-world docker images, working fine.
  3. Installed DAPR
  4. sudo dapr -h working fine.
  5. when executing sudo dapr init getting above mentioned error. redis:6 image is pulled but dapr is not able to start it. Also dapr_placement and dapr_zipkin images neither pulled.

Screenshot

image

yaron2 commented 1 year ago

It's failing because you already have Redis running on port 6379. Kill the existing container (if you don't need it for something else) and run the init command again.

aditfield commented 1 year ago

HI after trying multiple times, able to successfully run dapr init. Now it worked.

But it removed containers multiple times still it was showing same error. somehow at last it got working.