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

Installing Dapr runtime via dapr init not working #1043

Closed
BjoernAtBosch opened this issue Aug 11, 2022 · 18 comments · Fixed by #1048
Closed

Installing Dapr runtime via dapr init not working #1043

BjoernAtBosch opened this issue Aug 11, 2022 · 18 comments · Fixed by #1048
Labels
area/cli kind/bug Something isn't working
Milestone

Comments

@BjoernAtBosch
Copy link

BjoernAtBosch commented Aug 11, 2022

The same or similar issue was already reported here: dapr/docs#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.

@BjoernAtBosch BjoernAtBosch added the kind/bug Something isn't working label Aug 11, 2022
@TilmannBach
Copy link

same problem here with corporate proxy (proxy without authentication). it is working in dapr cli 1.7.1 but not in 1.8.0/1.8.1

@TilmannBach
Copy link

there is a similar closed issue from the past: #454

@pravinpushkar
Copy link
Contributor

pravinpushkar commented Aug 12, 2022

@BjoernAtBosch Could you please check if doing wget or direct download of binaries works for 1.8.1. for example wget of below url -
❌ 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

  1. If it does work then could you please set export DAPR_DEFAULT_IMAGE_REGISTRY=GHCR then do dapr init --runtime-version 1.8.1

@Lichmaker
Copy link
Contributor

Lichmaker commented Aug 15, 2022

I have the same issue with my corporate proxy.

➜  ~ dapr version
CLI version: 1.8.1 
Runtime version: n/a
➜  ~ dapr init
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Docker Hub
ℹ️  Installing runtime version 1.8.4
❌  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": read tcp 10.8.3.95:32946->20.205.243.166:443: read: connection reset by peer
➜  ~ env | grep https_proxy
https_proxy=http://10.8.3.67:8080
➜  ~ wget https://github.com/dapr/dashboard/releases/download/v0.10.0/dashboard_linux_amd64.tar.gz
--2022-08-15 10:30:52--  https://github.com/dapr/dashboard/releases/download/v0.10.0/dashboard_linux_amd64.tar.gz
Connecting to 10.8.3.67:8080... connected.
Proxy request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/226946009/cffc22ab-5b36-4358-ab3b-96a1ca9b8729?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220815%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220815T023049Z&X-Amz-Expires=300&X-Amz-Signature=a1464832126bd3d4af92af0cc016ffcb304ae19fe529c7f70042567b52f7318b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=226946009&response-content-disposition=attachment%3B%20filename%3Ddashboard_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream [following]
--2022-08-15 10:30:53--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/226946009/cffc22ab-5b36-4358-ab3b-96a1ca9b8729?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220815%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220815T023049Z&X-Amz-Expires=300&X-Amz-Signature=a1464832126bd3d4af92af0cc016ffcb304ae19fe529c7f70042567b52f7318b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=226946009&response-content-disposition=attachment%3B%20filename%3Ddashboard_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream
Connecting to 10.8.3.67:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 15650596 (15M) [application/octet-stream]
Saving to: ‘dashboard_linux_amd64.tar.gz.1’

dashboard_linux_amd64.tar.gz.1                      10%[==========>                                                                                                      ]   1.54M   551KB/s               ^C
➜  ~ export DAPR_DEFAULT_IMAGE_REGISTRY=GHCR
➜  ~ dapr init --runtime-version 1.8.1
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Dapr GitHub container registry
ℹ️  Installing runtime version 1.8.1
❌  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": read tcp 10.8.3.95:32950->20.205.243.166:443: read: connection reset by peer

@BjoernAtBosch
Copy link
Author

@pravinpushkar:
Download with wget is working:

someuser@somehost > ~ > wget https://github.com/dapr/dashboard/releases/download/v0.10./dashboard_linux_amd64.tar.gz
--2022-08-15 13:26:03--  https://github.com/dapr/dashboard/releases/download/v0.10.0/dashboard_linux_amd64.tar.gz
Connecting to 10.0.2.2:3128... connected.
Proxy request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/226946009/cffc22ab-5b36-4358-ab3b-96a1ca9b8729?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220815%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220815T112603Z&X-Amz-Expires=300&X-Amz-Signature=a2042dc92a496ccefc96040b18ac96df5d1c79599e0dd4946bad9b24e58cbcbe&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=226946009&response-content-disposition=attachment%3B%20filename%3Ddashboard_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream [following]
--2022-08-15 13:26:03--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/226946009/cffc22ab-5b36-4358-ab3b-96a1ca9b8729?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220815%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220815T112603Z&X-Amz-Expires=300&X-Amz-Signature=a2042dc92a496ccefc96040b18ac96df5d1c79599e0dd4946bad9b24e58cbcbe&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=226946009&response-content-disposition=attachment%3B%20filename%3Ddashboard_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream
Connecting to 10.0.2.2:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 15650596 (15M) [application/octet-stream]
Saving to: ‘dashboard_linux_amd64.tar.gz’

dashboard_linux_amd64.tar.gz                                 100%[=============================================================================================================================================>]  14.92M  3.88MB/s    in 3.9s    

2022-08-15 13:26:08 (3.86 MB/s) - ‘dashboard_linux_amd64.tar.gz’ saved [15650596/15650596]

Setting the env variable doesn't help:

someuser@somehost > ~ > export | grep DAPR
DAPR_DEFAULT_IMAGE_REGISTRY=GHCR
someuser@somehost > ~ > dapr --version
CLI version: 1.8.0 
Runtime version: n/a
someuser@somehost > ~ > dapr init --runtime-version 1.8.1
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Dapr GitHub container registry
ℹ️  Installing runtime version 1.8.1
❌  Downloading binaries and setting up components...
❌  error downloading daprd binary: Get "https://github.com/dapr/dapr/releases/download/v1.8.1/daprd_linux_amd64.tar.gz": dial tcp: lookup github.com on 127.0.0.53:53: no such host

(same for latest CLI 1.8.1)

@sjwl
Copy link

sjwl commented Aug 15, 2022

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.

@Lichmaker
Copy link
Contributor

Lichmaker commented Aug 16, 2022

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.

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

type Transport struct {

	// Proxy specifies a function to return a proxy for a given
	// Request. If the function returns a non-nil error, the
	// request is aborted with the provided error.
	//
	// The proxy type is determined by the URL scheme. "http",
	// "https", and "socks5" are supported. If the scheme is empty,
	// "http" is assumed.
	//
	// If Proxy is nil or returns a nil *URL, no proxy is used.
	Proxy func(*Request) (*url.URL, error)

       ......
}

Transport.Proxy default value is nil. May the problem here?

@pravinpushkar
Copy link
Contributor

@BjoernAtBosch @Lichmaker Thanks for checking this out with GHCR and wget. I do not have any proxy setup in my machine. Would you be able to verify by reverting this PR locally and send a PR for the fix needed ?

FYI @hueifeng @mukundansundar

@Lichmaker
Copy link
Contributor

Lichmaker commented Aug 16, 2022

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. 😄

@BjoernAtBosch
Copy link
Author

Thx @Lichmaker for providing this fix!

@hueifeng
Copy link
Member

I found it and maybe setting up Proxy is a better option.
https://cs.opensource.google/go/go/+/refs/tags/go1.18.2:src/net/http/transport.go;l=43

@pravinpushkar
Copy link
Contributor

@BjoernAtBosch Could you please edit the issue description to add RELEASE NOTE section
Something like -
RELEASE NOTE: FIXED dapr init issue in an environment where proxy is needed.

Release Note

RELEASE NOTE:

@BjoernAtBosch
Copy link
Author

@pravinpushkar Done

@HackToday
Copy link

It seems 1.8.1 still have that issue, dapr init would fail with same error

@HackToday
Copy link

Try to build from source can work, so it means a new release for dapr cli is needed

@xyfy
Copy link

xyfy commented Mar 1, 2023

still found in dapr 1.10
image

@mashirali
Copy link

image

@mashirali
Copy link

image

What this means?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants