-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Milestone
Description
RPCs will just hang because ProxyDetectorImpl tries to use ProxySelector, resulting in this error:
Caused by: java.lang.NoClassDefFoundError: java.net.ProxySelector is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.apphosting.runtime.security.shared.stub.java.net.ProxySelector.<clinit>(ProxySelector.java)
at io.grpc.internal.ProxyDetectorImpl$2.get(ProxyDetectorImpl.java:69)
at io.grpc.internal.ProxyDetectorImpl$2.get(ProxyDetectorImpl.java:65)
at io.grpc.internal.ProxyDetectorImpl.detectProxy(ProxyDetectorImpl.java:140)
at io.grpc.internal.ProxyDetectorImpl.proxyFor(ProxyDetectorImpl.java:118)
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:202)
at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:183)
at io.grpc.internal.ManagedChannelImpl$SubchannelImpl.requestConnection(ManagedChannelImpl.java:928)
at io.grpc.PickFirstBalancerFactory$PickFirstBalancer.handleResolvedAddressGroups(PickFirstBalancerFactory.java:79)
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl$1.run(ManagedChannelImpl.java:834)
at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:72)
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:800)
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:826)
at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:173)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1168)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:605)
at com.google.apphosting.runtime.ApiProxyImpl$CurrentRequestThreadFactory$1$1.run(ApiProxyImpl.java:1249)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.apphosting.runtime.ApiProxyImpl$CurrentRequestThreadFactory$1.run(ApiProxyImpl.java:1243)
at java.lang.Thread.run(Thread.java:745)
at com.google.apphosting.runtime.ApiProxyImpl$CurrentRequestThread.run(ApiProxyImpl.java:1210)
java.net.Authenticator also has security restrictions and will likely have this problem. The solution is probably to check with the java.security.AccessController before performing the action, and falling back to no proxy if we fail. Since app engine is a highly restricted environment, do we even need to come up with an alternate way to configure a proxy here? @ejona86