Closed taijitao closed 4 years ago
I cannot reproduce this error. If I set mix hex.config http_proxy
hex will use the config for me. Can you show how you build the rabbitmq plugin?
You do not have to clone hex, mix local.hex
will download and install the latest release.
Hi, I think it's not related to the rabbitmq plugin. I use
# git clone https://github.com/rabbitmq/rabbitmq-auth-backend-oauth2.git
# cd rabbitmq-auth-backend-oauth2
# make
I tried to install hex as you said(I'm new to elixir, hex)
[root@localhost vagrant]# export https_proxy=135.245.48.34:8000
[root@localhost vagrant]# mix hex.config http_proxy http://135.245.48.34:8000
[root@localhost vagrant]# mix local.hex
** (Mix) request timed out after 60000ms
Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.
[root@localhost vagrant]# curl -s https://repo.hex.pm/installs/hex-1.x.csv
0.14.0,b8a849be7e731f8d844229c029107e281364b55fe257d0f6d6ea9f7224d8c414d2ec2f0dee4bcdd9bc7672cab6c9d19e7e6bbb0539c740678fb6047821ce363d,1.0.0
From tshark, it only captures the package between localhost and hex.pm
[root@localhost rabbitmq_mqtt]# tshark -n -i any host 10.0.2.15
Running as user "root" and group "root". This could be dangerous.
Capturing on 'any'
1 0.000000000 10.0.2.15 -> 135.1.1.111 DNS 73 Standard query 0xc1da A repo.hex.pm
2 0.357233861 135.1.1.111 -> 10.0.2.15 DNS 140 Standard query response 0xc1da CNAME dualstack.f2.shared.global.fastly.net A 151.101.58.2
3 0.357931459 10.0.2.15 -> 151.101.58.2 TCP 76 37635 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=66370864 TSecr=0 WS=64
4 1.359419151 10.0.2.15 -> 151.101.58.2 TCP 76 [TCP Retransmission] 37635 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=66371866 TSecr=0 WS=64
5 3.365748390 10.0.2.15 -> 151.101.58.2 TCP 76 [TCP Retransmission] 37635 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=66373872 TSecr=0 WS=64
but for curl:
42 52.895244026 10.0.2.15 -> 135.245.48.34 TCP 56 41846 > 8000 [ACK] Seq=523 Ack=23766 Win=65320 Len=0
43 52.895622712 135.245.48.34 -> 10.0.2.15 TLSv1.2 1288 Application Data
44 52.895640413 10.0.2.15 -> 135.245.48.34 TCP 56 41846 > 8000 [ACK] Seq=523 Ack=24998 Win=65320 Len=0
45 53.094629558 135.245.48.34 -> 10.0.2.15 TLSv1.2 953 Application Data
46 53.094668659 10.0.2.15 -> 135.245.48.34 TCP 56 41846 > 8000 [ACK] Seq=523 Ack=25895 Win=65320 Len=0
47 53.095269185 10.0.2.15 -> 135.245.48.34 TLSv1.2 87 Encrypted Alert
So i can't figure out what's wrong. Thanks for your reply.
This is a different error than what you showed first. mix local.hex
installs hex and since you use mix hex.config
without error it assumes you already have hex installed. Make sure you don't have multiple versions installed and somehow configure the wrong version.
mix local.hex
does not use the configuration mix hex.config
(since it is used for installing hex it cannot use configuration for hex). Try also setting export http_proxy=135.245.48.34:8000
.
Hi, Got it. [root@localhost vagrant]# mix local.hex ** (Mix) request timed out after 60000ms
Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv. [root@localhost vagrant]# curl https://repo.hex.pm/installs/hex-1.x.csv 0.14.0,b8a849be7e731f8d844229c029107e281364b55fe257d0f6d6ea9f7224d8c414d2ec2f0dee4bcdd9bc7672cab6c9d19e7e6bbb0539c740678fb6047821ce363d,1.0.0 so mix also doesn't work even there is the proxy shared with the curl. Let' back to the first error:
[root@localhost rabbitmq-auth-backend-oauth2]# mix hex.config
api_key: nil (default)
api_url: "https://hex.pm/api" (default)
diff_command: "git diff --no-index __PATH1__ __PATH2__" (default)
home: "/root/.hex" (default)
http_concurrency: 8 (default)
http_proxy: "135.245.48.34:8000" (using `http_proxy`)
http_timeout: nil (default)
https_proxy: "135.245.48.34:8000" (using `https_proxy`)
mirror_url: "http://hexpm.upyun.com" (using `/root/.hex/hex.config`)
no_verify_repo_origin: false (default)
offline: false (default)
repos_key: nil (default)
resolve_verbose: false (default)
unsafe_https: false (default)
unsafe_registry: false (default)
[root@localhost rabbitmq-auth-backend-oauth2]# cd deps/rabbitmq_cli/
[root@localhost rabbitmq_cli]# mix deps.get
Failed to check for new Hex version
Failed to fetch record for 'hexpm/amqp' from registry (using cache instead)
:timeout
:timeout
tshark output shown that hex didn't send package to proxy
77 334.354206177 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42500 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64
78 334.354306663 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 37289 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64
79 334.354336978 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 40318 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64
80 334.354362505 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 36112 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64
81 334.354386560 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42085 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64
82 334.370666840 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 46249 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616800 TSecr=0 WS=64
83 334.370765347 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42670 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616800 TSecr=0 WS=64
84 334.370798651 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42161 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616800 TSecr=0 WS=64
85 334.882726128 10.0.2.15 -> 151.101.122.2 TCP 76 [TCP Retransmission] 43930 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170617312 TSecr=0 WS=64
Is it possbile mix/hex use the same library? any debug info or log?
B.R, Tao
Is it possbile mix/hex use the same library?
They use the same underlying HTTP library but the configuration for proxies happen separately.
Does Hex not use any of http_proxy
, https_proxy
, nor mirror_url
for you? If that's the case I think it's an issue with how you have installed Hex or maybe your PATHs. It's unlikely that you are hitting two separate bugs I cannot reproduce and we haven't had any other reported issues about.
Closing this for now, please let us know if you have any updates, thanks!
Hi, Got it. [root@localhost vagrant]# mix local.hex ** (Mix) request timed out after 60000ms
Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv. [root@localhost vagrant]# curl https://repo.hex.pm/installs/hex-1.x.csv 0.14.0,b8a849be7e731f8d844229c029107e281364b55fe257d0f6d6ea9f7224d8c414d2ec2f0dee4bcdd9bc7672cab6c9d19e7e6bbb0539c740678fb6047821ce363d,1.0.0 so mix also doesn't work even there is the proxy shared with the curl. Let' back to the first error:
[root@localhost rabbitmq-auth-backend-oauth2]# mix hex.config api_key: nil (default) api_url: "https://hex.pm/api" (default) diff_command: "git diff --no-index __PATH1__ __PATH2__" (default) home: "/root/.hex" (default) http_concurrency: 8 (default) http_proxy: "135.245.48.34:8000" (using `http_proxy`) http_timeout: nil (default) https_proxy: "135.245.48.34:8000" (using `https_proxy`) mirror_url: "http://hexpm.upyun.com" (using `/root/.hex/hex.config`) no_verify_repo_origin: false (default) offline: false (default) repos_key: nil (default) resolve_verbose: false (default) unsafe_https: false (default) unsafe_registry: false (default)
[root@localhost rabbitmq-auth-backend-oauth2]# cd deps/rabbitmq_cli/ [root@localhost rabbitmq_cli]# mix deps.get Failed to check for new Hex version Failed to fetch record for 'hexpm/amqp' from registry (using cache instead) :timeout :timeout
tshark output shown that hex didn't send package to proxy
77 334.354206177 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42500 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64 78 334.354306663 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 37289 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64 79 334.354336978 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 40318 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64 80 334.354362505 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 36112 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64 81 334.354386560 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42085 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616784 TSecr=0 WS=64 82 334.370666840 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 46249 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616800 TSecr=0 WS=64 83 334.370765347 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42670 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616800 TSecr=0 WS=64 84 334.370798651 10.0.2.15 -> 69.28.62.187 TCP 76 [TCP Retransmission] 42161 > 80 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170616800 TSecr=0 WS=64 85 334.882726128 10.0.2.15 -> 151.101.122.2 TCP 76 [TCP Retransmission] 43930 > 443 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=170617312 TSecr=0 WS=64
Is it possbile mix/hex use the same library? any debug info or log?
B.R, Tao
Hello, did you solve your problem, i encountered a similar problem
i have same problem,obviously, proxy config does't work!
mix hex.config
configures Hex, but mix local.hex
installs Hex so the configuration cannot be used before it's installed.
mix local.hex
is part of Mix (not Hex), to configure a proxy for it you can set the environment variable HTTPS_PROXY
.
mix hex.config
configures Hex, butmix local.hex
installs Hex so the configuration cannot be used before it's installed.
mix local.hex
is part of Mix (not Hex), to configure a proxy for it you can set the environment variableHTTPS_PROXY
.
Thank you sir, this work on my localhost!
Hi,
Built with: Elixir 1.9.1 and OTP 21.3.8.6
Failed to fetch record for 'hexpm/recon' from registry (using cache instead) :timeout ** (Mix) No package with name recon (from: mix.exs) in registry
mix hex.config
api_key: nil (default) api_url: "https://hex.pm/api" (default) diff_command: "git diff --no-index PATH1 PATH2" (default) home: "/root/.hex" (default) http_concurrency: 8 (default) http_proxy: "87.254.212.120:8080" (using
http_proxy
) http_timeout: nil (default) https_proxy: "87.254.212.120:8080" (usinghttps_proxy
) mirror_url: "http://hexpm.upyun.com/" (using/root/.hex/hex.config
) no_verify_repo_origin: false (default) offline: false (default) repos_key: nil (default) resolve_verbose: false (default) unsafe_https: false (default) unsafe_registry: false (default) and use tshark to capture the package.