graal
graal copied to clipboard
"gu" unable to download from www.graalvm.org when running behind a proxy.
Description of the issue When behind a proxy, running any "gu" command that requires downloading from www.graalvm.org fails.
Steps to reproduce the issue
- Run
gu install native-image
orgu --jvm install native-image
. The following output is seen:
Downloading: Component catalog from www.graalvm.org
Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/v2/graal-updater-component-catalog-java11.properties: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
Please check your connection and proxy settings. If your machine is behind a proxy, you must set your environment variables (http_proxy, https_proxy, ...) appropriately.
-
Set the environment variables http_proxy and https_proxy.
-
Run
gu --jvm install native-image
. The following output is seen (it is similar to the output mentioned in the step 1 but not exactly the same):
Downloading: Component catalog from www.graalvm.org
Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/v2/graal-updater-component-catalog-java11.properties: www.graalvm.org.
Please check your connection and proxy settings. If your machine is behind a proxy, you must set your environment variables (http_proxy, https_proxy, ...) appropriately.
- Run
gu install native-image
. Loads of output is seen (including output from NTLMAuthSequence.java and a segfault error):
Downloading: Component catalog from www.graalvm.org
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x0000018c3dab03c0 ] ]
siginfo: ExceptionCode: -1073741819, reading address 0x000000000061f6b0
Current timestamp: 1657890152524
General purpose register values:
RAX 0x00000054f06fed48 points into the stack for thread 0x0000018c3dab03c0
RBX 0x0000018c3da9db60 is an unknown value
RCX 0x0000018c3da9db60 is an unknown value
RDX 0x000000000061f6a8 is an unknown value
RBP 0x00000054f06febf1 points into the stack for thread 0x0000018c3dab03c0
RSI 0x000000000061f6a8 is an unknown value
RDI 0x0000000000000000
RSP 0x00000054f06feb00 points into the stack for thread 0x0000018c3dab03c0
R8 0x0000000000000000
R9 0x0000000000000000
R10 0x0000000000000000
R11 0x00000054f06fedb0 points into the stack for thread 0x0000018c3dab03c0
R12 0x0000000000000000
R13 0x0000000000000000
R14 0x000000000061f6a8 is an unknown value
R15 0x0000000000000000
EFL 0x0000000000010202 is an unknown value
RIP 0x00007ffcede61651 is an unknown value
Printing Instructions (ip=0x00007ffcede61651):
0x00007ffcede61631: 0x48 0x85 0xdb 0x0f 0x84 0x00 0xd2 0x00 0x00 0x45 0x33 0xe4 0x48 0xc7 0x45 0xb7
0x00007ffcede61641: 0xff 0xff 0xff 0xff 0x4c 0x89 0x65 0x87 0x41 0x8b 0xfc 0x4d 0x85 0xf6 0x74 0x08
0x00007ffcede61651: 0x49 0x8b 0x46 0x08 0x48 0x89 0x45 0xbf 0x48 0x85 0xf6 0x0f 0x84 0xb0 0x01 0x00
0x00007ffcede61661: 0x00 0x4c 0x8d 0x45 0xc7 0x48 0x8b 0xd6 0xb9 0x01 0x00 0x00 0x00 0xe8 0xad 0x06
Top of stack (sp=0x00000054f06feb00):
0x00000054f06feb00: 0x00000054f06fec80 0x0000000000000000
0x00000054f06feb10: 0x00000054f06fedc0 0x00007ffcf086192d
0x00000054f06feb20: 0x0000000000000008 0x0000242495c65efc
0x00000054f06feb30: 0x0000000000000000 0x0000018c3da23e12
0x00000054f06feb40: 0x00000054f06ff150 0x00007ffcf0882228
0x00000054f06feb50: 0x00000054f06ff150 0x0000018c3d980cc0
0x00000054f06feb60: 0x0000000000000000 0x0000000000000000
0x00000054f06feb70: 0x0000000000000000 0x0000000000000000
0x00000054f06feb80: 0x0000000000000000 0x00000054f06fed48
0x00000054f06feb90: 0x00000054f06fed38 0x00000054f06fed28
0x00000054f06feba0: 0x000000000061f6a8 0xffffffffffffffff
0x00000054f06febb0: 0x0000018c3dab03c0 0x0000000000000000
0x00000054f06febc0: 0x0000018c3dab03c0 0x0000000000000009
0x00000054f06febd0: 0x0000000000000000 0x00009527b773f800
0x00000054f06febe0: 0x0000000000000002 0x0000018c3da9db60
0x00000054f06febf0: 0x000000000061f6a8 0x0000000000000000
0x00000054f06fec00: 0x000000000061f6a8 0x0000000000000002
0x00000054f06fec10: 0x0000000000000000 0x0000018c3dab03c0
0x00000054f06fec20: 0x00000054f06fedb0 0x00007ffcede612c0
0x00000054f06fec30: 0x0000000000000000 0x0000000000000000
0x00000054f06fec40: 0x0000000000000000 0x0000000000000000
0x00000054f06fec50: 0x0000000000000000 0x0000000000000010
0x00000054f06fec60: 0x0000000000000000 0x0000000000000000
0x00000054f06fec70: 0x000000000061f6a8 0x00000054f06fed28
0x00000054f06fec80: 0x00000054f06fed38 0x00000054f06fed48
0x00000054f06fec90: 0x0000000000000000 0x0000000000000000
0x00000054f06feca0: 0x0000000000000001 0x00007ff74e68572c
0x00000054f06fecb0: 0x0000000000000000 0x0000018c3dab94e0
0x00000054f06fecc0: 0x00000054f06fee40 0x00000054f06fef20
0x00000054f06fecd0: 0x0000005400000000 0x0000000000000010
0x00000054f06fece0: 0x0000000000000000 0x0000005400000000
0x00000054f06fecf0: 0x000000000061f6a8 0x00000054f06fed28
Top frame info:
Does not look like a Java Frame. Use JavaFrameAnchors to find LastJavaSP:
Found matching Anchor:0x00000054f06ff210
LastJavaSP 0x00000054f06ff1d0
LastJavaIP 0x00007ff74e201c43
Threads:
0x0000018c3dab8dc0 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "pool-2-thread-2" - 0x0000018c4059dee0, stack(0x00000054f0700000,0x00000054f0800000)
0x0000018c3dab03c0 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "pool-2-thread-1" - 0x0000018c4059c170, stack(0x00000054f0600000,0x00000054f0700000)
0x0000018c3daa4600 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Signal Dispatcher" - 0x0000018c3fbb02f8, daemon, stack(0x00000054f0500000,0x00000054f0600000)
0x0000018c3da99f80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x0000018c3fbb0250, daemon, stack(0x00000054f0400000,0x00000054f0500000)
0x0000018c3da89640 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "main" - 0x0000018c3fbb01a8, stack(0x00000054f0000000,0x00000054f0100000)
VM thread locals for the failing thread 0x0000018c3dab03c0:
0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
0x0000018c3dab03c0: 0x0000018c3f945010
8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
16 (4 bytes): Safepoint.safepointRequested = (int) 2147292946 (0x7ffd1712)
20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
0x0000018c3dab03d8: 0x0000018c40e00000 0x0000018c40f00000
0x0000018c3dab03e8: 0x0000018c40ea03a8 0x0000018c3da40000
56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x0000018c4059c170)
64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 364811121168 (0x00000054f06ff210)
72 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x0000018c408013b0)
80 (8 bytes): ExceptionUnwind.currentException = (Object) null
88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x0000018c40e92338)
96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x0000018c408024f8)
120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
144 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
152 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
160 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
0x0000018c3dab0460: 0x0000000000000000
168 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 1175528 (0x000000000011efe8)
176 (8 bytes): VMThreads.IsolateTL = (Word) 1701868208128 (0x0000018c3f400000)
184 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 324 (0x0000000000000144)
192 (8 bytes): VMThreads.OSThreadIdTL = (Word) 17936 (0x0000000000004610)
200 (8 bytes): VMThreads.StackBase = (Word) 364811124736 (0x00000054f0700000)
208 (8 bytes): VMThreads.StackEnd = (Word) 364810076160 (0x00000054f0600000)
216 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
0x0000018c3dab0498: 0x0000000000000001
224 (8 bytes): VMThreads.nextTL = (Word) 1701841618432 (0x0000018c3daa4600)
232 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 1701841666976 (0x0000018c3dab03a0)
240 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
244 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
248 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
252 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
256 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
260 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)
No VMOperation in progress
The 15 most recent VM operation status changes (oldest first):
Counters:
Java frame anchors for the failing thread 0x0000018c3dab03c0:
Anchor 0x00000054f06ff210 LastJavaSP 0x00000054f06ff1d0 LastJavaIP 0x00007ff74e201c43
Stacktrace for the failing thread 0x0000018c3dab03c0:
SP 0x00000054f06feb00 IP 0x00007ffcede61651 IP is not within Java code. Trying frame anchor of last Java frame instead.
SP 0x00000054f06ff1d0 IP 0x00007ff74e201c43 [image code] sun.net.www.protocol.http.ntlm.NTLMAuthSequence.getNextToken(NTLMAuthSequence.java)
SP 0x00000054f06ff250 IP 0x00007ff74e2017ff [image code] sun.net.www.protocol.http.ntlm.NTLMAuthSequence.getAuthHeader(NTLMAuthSequence.java:80)
SP 0x00000054f06ff270 IP 0x00007ff74e202993 [image code] sun.net.www.protocol.http.ntlm.NTLMAuthentication.setHeaders(NTLMAuthentication.java:255)
SP 0x00000054f06ff2b0 IP 0x00007ff74e1efc47 [image code] sun.net.www.protocol.http.HttpURLConnection.getHttpProxyAuthentication(HttpURLConnection.java:2413)
SP 0x00000054f06ff340 IP 0x00007ff74e1fb8f0 [image code] sun.net.www.protocol.http.HttpURLConnection.resetProxyAuthentication(HttpURLConnection.java:2029)
SP 0x00000054f06ff370 IP 0x00007ff74e1ebb54 [image code] sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2134)
SP 0x00000054f06ff440 IP 0x00007ff74e203c50 [image code] sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:195)
SP 0x00000054f06ff470 IP 0x00007ff74e207a64 [image code] sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:168)
SP 0x00000054f06ff480 IP 0x00007ff74e13974a [image code] org.graalvm.component.installer.remote.ProxyConnectionFactory$Connector.runWithContext(ProxyConnectionFactory.java:369)
SP 0x00000054f06ff4d0 IP 0x00007ff74e1395de [image code] org.graalvm.component.installer.remote.ProxyConnectionFactory$Connector.run(ProxyConnectionFactory.java:351)
SP 0x00000054f06ff4f0 IP 0x00007ff74df2771f [image code] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
SP 0x00000054f06ff510 IP 0x00007ff74df338ab [image code] java.util.concurrent.FutureTask.run(FutureTask.java:264)
SP 0x00000054f06ff570 IP 0x00007ff74df482bf [image code] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
SP 0x00000054f06ff5c0 IP 0x00007ff74df4535a [image code] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
SP 0x00000054f06ff5d0 IP 0x00007ff74dcb8094 [image code] java.lang.Thread.run(Thread.java:829)
SP 0x00000054f06ff5e0 IP 0x00007ff74da5df62 [image code] com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
SP 0x00000054f06ff610 IP 0x00007ff74da67e30 [image code] com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
SP 0x00000054f06ff640 IP 0x00007ff74d9cd910 [image code] com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(IsolateEnterStub.java:0)
VM mutexes:
mutex "referencePendingList" is unlocked.
mutex "thread" is unlocked.
mutex "mainVMOperationControlWorkQueue" is unlocked.
Heap settings and statistics:
Supports isolates: true
Heap base: 0x0000018c3f400000
Object reference size: 8
Aligned chunk size: 1048576
Incremental collections: 0
Complete collections: 0
Native image heap boundaries:
ReadOnly Primitives: 0x0000018c3f501028 - 0x0000018c3f734710
ReadOnly References: 0x0000018c3f734710 - 0x0000018c3f9446c8
ReadOnly Relocatables: 0x0000018c3f945000 - 0x0000018c3fa50ac8
Writable Primitives: 0x0000018c3fa51000 - 0x0000018c3fb54d78
Writable References: 0x0000018c3fb54d78 - 0x0000018c3febf8a8
Writable Huge: 0x0000018c3ff00030 - 0x0000018c3ff3abb8
ReadOnly Huge: 0x0000018c3ff3b030 - 0x0000018c4021bb68
Heap:
Young generation:
Eden:
edenSpace:
aligned: 0/0 unaligned: 0/0
Survivors:
Survivor-1 From:
aligned: 0/0 unaligned: 0/0
Survivor-1 To:
aligned: 0/0 unaligned: 0/0
Survivor-2 From:
aligned: 0/0 unaligned: 0/0
Survivor-2 To:
aligned: 0/0 unaligned: 0/0
Survivor-3 From:
aligned: 0/0 unaligned: 0/0
Survivor-3 To:
aligned: 0/0 unaligned: 0/0
Survivor-4 From:
aligned: 0/0 unaligned: 0/0
Survivor-4 To:
aligned: 0/0 unaligned: 0/0
Survivor-5 From:
aligned: 0/0 unaligned: 0/0
Survivor-5 To:
aligned: 0/0 unaligned: 0/0
Survivor-6 From:
aligned: 0/0 unaligned: 0/0
Survivor-6 To:
aligned: 0/0 unaligned: 0/0
Survivor-7 From:
aligned: 0/0 unaligned: 0/0
Survivor-7 To:
aligned: 0/0 unaligned: 0/0
Survivor-8 From:
aligned: 0/0 unaligned: 0/0
Survivor-8 To:
aligned: 0/0 unaligned: 0/0
Survivor-9 From:
aligned: 0/0 unaligned: 0/0
Survivor-9 To:
aligned: 0/0 unaligned: 0/0
Survivor-10 From:
aligned: 0/0 unaligned: 0/0
Survivor-10 To:
aligned: 0/0 unaligned: 0/0
Survivor-11 From:
aligned: 0/0 unaligned: 0/0
Survivor-11 To:
aligned: 0/0 unaligned: 0/0
Survivor-12 From:
aligned: 0/0 unaligned: 0/0
Survivor-12 To:
aligned: 0/0 unaligned: 0/0
Survivor-13 From:
aligned: 0/0 unaligned: 0/0
Survivor-13 To:
aligned: 0/0 unaligned: 0/0
Survivor-14 From:
aligned: 0/0 unaligned: 0/0
Survivor-14 To:
aligned: 0/0 unaligned: 0/0
Survivor-15 From:
aligned: 0/0 unaligned: 0/0
Survivor-15 To:
aligned: 0/0 unaligned: 0/0
Old generation:
oldFromSpace:
aligned: 0/0 unaligned: 0/0
oldToSpace:
aligned: 0/0 unaligned: 0/0
Unused:
aligned: 0/0
Segfault detected, aborting process. Use runtime option -R:-InstallSegfaultHandler if you don't want to use SubstrateSegfaultHandler.
Environment: OS -- Windows 10 VMware Virtual Desktop
System Type -- x64-based PC
GraalVM (installed using https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.1.0/graalvm-ce-java11-windows-amd64-22.1.0.zip): openjdk 11.0.15 2022-04-19 OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 11.0.15+10-jvmci-22.1-b06) OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 11.0.15+10-jvmci-22.1-b06, mixed mode, sharing)
Hi, Thank you for reporting this, we will take a look into it and get back to you
While working further, I found that on my virtual desktop I was not even able to ping any website from the command prompt even after setting the proxy environment variables and as such "gu" was not able to download the component from the net. So, the only issue with "gu" might just be that it doesn't handle that situation gracefully and throws lot of output including a segfault error (as described in the step 4 in the bug description above).
I was able to install "native-image" component in offline mode (https://www.graalvm.org/22.1/reference-manual/graalvm-updater/#install-components-manually).
Similar issue here on Mac behind a corporate firewall. I'm going to go down the path of requesting the JAR to download directly per @sanjeevsachdev .
~ î‚° java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 11.0.17+8-jvmci-22.3-b08)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 11.0.17+8-jvmci-22.3-b08, mixed mode, sharing)
~ î‚° gu install native-image
Downloading: Component catalog from www.graalvm.org
Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/v2/graal-updater-component-catalog-java11.properties: Connection reset.
Please check your connection and proxy settings. If your machine is behind a proxy, you must set your environment variables (http_proxy, https_proxy, ...) appropriately.
✘  ~  env | grep -i proxy
HTTP_PROXY=http://127.0.0.1:9000/
https_proxy=http://127.0.0.1:9000/
http_proxy=http://127.0.0.1:9000/
HTTPS_PROXY=http://127.0.0.1:9000/
NO_PROXY=127.0.0.1, localhost, 10.*, 172.24.*, 172.25.*, 172.26.*, 172.27.*
MacOS Ventura. Using zScaler. cURL of that file completes successfully, albeit a bit slowly.
https://www.graalvm.org/22.1/reference-manual/graalvm-updater/#install-components-manually
Same here. Corporations tend to use valid certificates from custom Trust Authorities. They are valid just not on the standard list. It would be great to add an option to skip SSL verification.
Similar issue here on Mac behind a corporate firewall. I'm going to go down the path of requesting the JAR to download directly per @sanjeevsachdev .
~  java -version openjdk version "11.0.17" 2022-10-18 OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 11.0.17+8-jvmci-22.3-b08) OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 11.0.17+8-jvmci-22.3-b08, mixed mode, sharing) ~  gu install native-image Downloading: Component catalog from www.graalvm.org Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/v2/graal-updater-component-catalog-java11.properties: Connection reset. Please check your connection and proxy settings. If your machine is behind a proxy, you must set your environment variables (http_proxy, https_proxy, ...) appropriately. ✘  ~  env | grep -i proxy HTTP_PROXY=http://127.0.0.1:9000/ https_proxy=http://127.0.0.1:9000/ http_proxy=http://127.0.0.1:9000/ HTTPS_PROXY=http://127.0.0.1:9000/ NO_PROXY=127.0.0.1, localhost, 10.*, 172.24.*, 172.25.*, 172.26.*, 172.27.*
MacOS Ventura. Using zScaler. cURL of that file completes successfully, albeit a bit slowly.
any workaround to overcome this problem ?
Still an issue behind corporate firewalls...
This issue is tracked internally on GR 46418
We hit this issue recently and made some observations regarding it. With the proxy configured, gu available
seems to actually work fine, while gu install native-image
doesn't.
Is it possible that "gu install" does not follow redirects?
We used the following workaround for now (requires jq and wget to be installed):
export NATIVE_IMAGE_URL=$(gu available --json | jq -r '.components | .[] | select(.id=="native-image") | .origin')
export NATIVE_IMAGE_TAR=$(basename $NATIVE_IMAGE_URL)
wget -O /tmp/${NATIVE_IMAGE_TAR} ${NATIVE_IMAGE_URL}
gu install --file /tmp/${NATIVE_IMAGE_TAR}
This issue should be fixed