getting 'internet not reachable' with sdkman
Asked Answered
B

9

20

Internet is working fine, but I'm getting this error from sdkman:

    06:47 $ sdk version
==== INTERNET NOT REACHABLE! ===============================

 Some functionality is disabled or only partially available.
 If this persists, please enable the offline mode:

   $ sdk offline

============================================================

SDKMAN 4.0.35

My DNS does seem to be resolving very slowly. I can ping, but the resolution takes ~7 seconds. Could that be causing sdkman to time out?

Any thoughts? what's the next step towards debugging? Thanks!

Bergin answered 12/5, 2016 at 13:51 Comment(0)
B
33

you need to set the curl connect timeout and curl max time in the config file which is allocated in the following path :

 $YOUR_HOME/.sdkman/etc/config

to the following :

sdkman_curl_connect_timeout=20
sdkman_curl_max_time=0

i hope this will help you

Batholith answered 20/7, 2016 at 0:37 Comment(2)
It is such weirdRaynaraynah
@Raynaraynah It is not weird. It just adjust the timeout config to support sdkman update in weak network.Puente
G
5

Well, I had to struggle to get SDKMAN let me download packages. I am behind a Corporate proxy and use CNTLM to work around it on my local machine.

I had to edit a file of sdkman on my local machine after downloading it.

Downloading was a thing too. For me adding the -x http://localhost:3128 to the curl command worked. Steps i took to get gradle installed:

  • I downloaded the install script and stored it in a /tmp folder.
  • Adjusted the installscript and added the extra parameter to the curl command. Now I could see the tool getting downloaded and installed in the $HOME/.sdkman dir.
  • After that I had to run sdkman-init.sh
  • Then I had to edit the .sdkman/src/sdkman-utils.sh and added the -x option to every line where curl was called.

That did the trick. Remember to close the terminal and open a new one after each step.

Gigantopithecus answered 4/7, 2019 at 13:47 Comment(0)
I
4

Try

sdkman_insecure_ssl=true in .sdkman/etc/config
Isaacson answered 5/2, 2022 at 8:29 Comment(1)
Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, can you edit your answer to include an explanation of what you're doing and why you believe it is the best approach?Breadboard
C
3

Fix was a two-step process for me:

  1. Set the executable bit on sdkman-init.sh (chmod +x .sdkman/bin/sdkman-init.sh)
  2. Modify ~/sdkman/etc/config, set
sdkman_curl_connect_timeout=30
sdkman_curl_max_time=50

And don't forget to restart the terminal.

Cease answered 4/5, 2019 at 4:10 Comment(1)
adding the executable bit did the trick for me... thanks!Feeble
C
2

Different applications use different settings to establish network connection.

In my case(I access the internet through a proxy using Macbook Pro), although I had set http and https proxy in System Preferences->Network->Advanced->Proxies. It did take effect for browser(Safari), but not for sdkman command line tool.

I have to set environment variables http_proxy and https_proxy manually.

Below is what I set on my Macbook Pro.

export http_proxy=http://proxy.abc.com:2500
export https_proxy=https://proxy.abc.com:2500

Then sdkman works fine.

Chesser answered 16/3, 2017 at 9:2 Comment(0)
G
1

I got the same issue (being behind a corporate proxy). In my case, http_proxy as well as https_proxy environment variable was set.

Interestingly, most distros don't compile openssl with (rather uncommon) https_proxy support and therefore curl fails:

curl https://www.google.com
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to proxy.company.com:3128 

Solution for my problem:

unset https_proxy

After unsetting https_proxy, curl and sdkman (because they seem to use openssl) both worked out of the box.

Godparent answered 28/4, 2021 at 12:4 Comment(0)
F
1

Or 6 years later, you get hit by a curl bug and the issue is resolved by updating curl.

Steps to analyze:

# Find the SDK website URL:
cat ~/.sdkman/bin/sdkman-init.sh | grep -i api
# Run curl
curl -vvv https://api.sdkman.io/2

If this shows something like Internal SSL engine error encountered during the SSL handshake you need to update curl, e.g. on MacOS using brew: brew upgrade curl

Fairing answered 2/3, 2023 at 14:3 Comment(1)
My issue was #54938526 - behind a corporate proxy. I configured curl to use ssl-revoke-best-effort by adding that my .curlrcJeffrey
V
1

FWIW, my similar troubles stemmed from running sdkman in a Docker Desktop container that had DNS problems: https://github.com/docker/for-win/issues/10247#issuecomment-1919627110

Vang answered 31/1 at 18:1 Comment(0)
B
0

Looks like it's working now ... maybe an issue on the server side? Or maybe an intermittent networking issue on my side. Anyhow, next crisis ... :)

Bergin answered 15/5, 2016 at 5:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.