cli: Installing Dapr runtime via dapr init not working

The same or similar issue was already reported here: https://github.com/dapr/docs/issues/2674 (Maybe wrong repo - therefore creating this new bug report here)

Expected Behavior

Due to Dapr documentation is should be possible to install the Dapr runtime with either dapr init or dapr init --runtime-version 1.8.1.

Actual Behavior

Trying this with Dapr cli v1.8.0 is resulting in an error message:

someuser@somehost > ~ > dapr --version
CLI version: 1.8.0
Runtime version: n/a
someuser@somehost > ~ > dapr init
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Docker Hub
ℹ️  Installing runtime version 1.8.3
❌  Downloading binaries and setting up components...
❌  error downloading dashboard binary: Get "https://github.com/dapr/dashboard/releases/download/v0.10.0/dashboard_linux_amd64.tar.gz": dial tcp: lookup github.com on 127.0.0.53:53: no such host

Workaround

Download is working with dapr cli v1.7.1 in the same environment/setup (see below):

someuser@somehost > ~ > dapr --version
CLI version: 1.7.1 
Runtime version: n/a
someuser@somehost > ~ > dapr init
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Docker Hub
ℹ️  Installing runtime version 1.8.3
↗  Downloading binaries and setting up components... 
Dapr runtime installed to /home/someuser/.dapr/bin, you may run the following to add it to your path if you want to run daprd directly:
    export PATH=$PATH:/home/someuser/.dapr/bin
✅  Downloading binaries and setting up components...
✅  Downloaded binaries and completed components set up.
ℹ️  daprd binary has been installed to /home/someuser/.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

Steps to Reproduce the Problem

See above.

Environment/setup

Ubuntu 18.04.6 LTS running in Oracle VirtualBox 6.1, Version 6.1.34 r150636 (Qt5.6.2) running on Windows 10 Enterprise, Version 21H2

Corporate network with proxy Local authentication proxy is up and running Proxy-config in Ubuntu:

FTP_PROXY=http://10.0.2.2:3128
HTTPS_PROXY=http://10.0.2.2:3128
HTTP_PROXY=http://10.0.2.2:3128
NO_PROXY=localhost,127.0.0.1,.local,/var/run/docker.sock
ftp_proxy=http://10.0.2.2:3128
http_proxy=http://10.0.2.2:3128
https_proxy=http://10.0.2.2:3128
no_proxy=localhost,127.0.0.1,.local,/var/run/docker.sock

Release Note

RELEASE NOTE: FIX dapr init issue in an environment where proxy is needed.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 18 (7 by maintainers)

Commits related to this issue

Most upvoted comments

still found in dapr 1.10 image

https://pkg.go.dev/net/http#ProxyFromEnvironment

http.ProxyFromEnvironment can fix this issue. And it’s worked successfully in my corporate network with proxy. So I send this PR. Please check it. 😄

I think this PR broke dapr init via proxy.

The above PR replaced the default net/http client with an explicit client, but the explicit client doesn’t setup http.Transport.Proxy.

The default net/http client honors the typical proxy environment variables such as HTTP_PROXY.