Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-12450

Incorrect exception thrown when we cannot get the correct url for the ranger-conf file

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Security
    • Labels:
    • Rank:
      1|i0070f:

      Description

      When the ranger authorizer cannot find the url for the ranger-conf file, we get following exception with the stack trace:

      2017-08-23 21:40:35,542 - ERROR [leader-election-election-master.services:o.a.r.p.u.PolicyRefresher@282] - PolicyRefresher(serviceName=cdapdev): failed to refresh policies. Will continue to use last known version of policies (-1)
      com.sun.jersey.api.client.ClientHandlerException: java.net.MalformedURLException: For input string: "port"
              at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151) ~[jersey-bundle-1.17.1.jar:1.17.1]
              at com.sun.jersey.api.client.Client.handle(Client.java:648) ~[jersey-bundle-1.17.1.jar:1.17.1]
              at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680) ~[jersey-bundle-1.17.1.jar:1.17.1]
              at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) ~[jersey-bundle-1.17.1.jar:1.17.1]
              at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507) ~[jersey-bundle-1.17.1.jar:1.17.1]
              at org.apache.ranger.admin.client.RangerAdminRESTClient$3.run(RangerAdminRESTClient.java:111) ~[ranger-plugins-common-0.7.0.jar:0.7.0]
              at org.apache.ranger.admin.client.RangerAdminRESTClient$3.run(RangerAdminRESTClient.java:105) ~[ranger-plugins-common-0.7.0.jar:0.7.0]
              at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_112]
              at javax.security.auth.Subject.doAs(Subject.java:360) ~[na:1.8.0_112]
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1846) ~[hadoop-common-2.7.3.2.6.1.0-129.jar:na]
              at org.apache.ranger.admin.client.RangerAdminRESTClient.getServicePoliciesIfUpdated(RangerAdminRESTClient.java:114) ~[ranger-plugins-common-0.7.0.jar:0.7.0]
              at org.apache.ranger.plugin.util.PolicyRefresher.loadPolicyfromPolicyAdmin(PolicyRefresher.java:258) [ranger-plugins-common-0.7.0.jar:0.7.0]
              at org.apache.ranger.plugin.util.PolicyRefresher.loadPolicy(PolicyRefresher.java:202) [ranger-plugins-common-0.7.0.jar:0.7.0]
              at org.apache.ranger.plugin.util.PolicyRefresher.startRefresher(PolicyRefresher.java:149) [ranger-plugins-common-0.7.0.jar:0.7.0]
              at org.apache.ranger.plugin.service.RangerBasePlugin.init(RangerBasePlugin.java:142) [ranger-plugins-common-0.7.0.jar:0.7.0]
              at co.cask.cdap.security.authorization.ranger.binding.RangerAuthorizer.initialize(RangerAuthorizer.java:89) [1503524433334-0/:na]
              at co.cask.cdap.security.authorization.AuthorizerInstantiator.createAndInitializeAuthorizerInstance(AuthorizerInstantiator.java:172) [na:na]
              at co.cask.cdap.security.authorization.AuthorizerInstantiator.get(AuthorizerInstantiator.java:141) [na:na]
              at co.cask.cdap.security.authorization.DelegatingPrivilegeManager.<init>(DelegatingPrivilegeManager.java:40) [na:na]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.8.0_112]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [na:1.8.0_112]
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_112]
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [na:1.8.0_112]
              at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:85) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ExposedKeyFactory.get(ExposedKeyFactory.java:54) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:326) [com.google.inject.extensions.guice-multibindings-3.0.jar:na]
              at com.google.inject.multibindings.Multibinder$RealMultibinder.get(Multibinder.java:220) [com.google.inject.extensions.guice-multibindings-3.0.jar:na]
      at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974) [com.google.inject.guice-3.0.jar:na]
              at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013) [com.google.inject.guice-3.0.jar:na]
              at co.cask.cdap.data.runtime.main.MasterServiceMain$MasterLeaderElectionHandler.leader(MasterServiceMain.java:651) [na:na]
              at org.apache.twill.internal.zookeeper.LeaderElection.becomeLeader(LeaderElection.java:234) [org.apache.twill.twill-zookeeper-0.12.0-SNAPSHOT.jar:0.12.0-SNAPSHOT]
              at org.apache.twill.internal.zookeeper.LeaderElection.access$1900(LeaderElection.java:54) [org.apache.twill.twill-zookeeper-0.12.0-SNAPSHOT.jar:0.12.0-SNAPSHOT]
              at org.apache.twill.internal.zookeeper.LeaderElection$5.onSuccess(LeaderElection.java:212) [org.apache.twill.twill-zookeeper-0.12.0-SNAPSHOT.jar:0.12.0-SNAPSHOT]
              at org.apache.twill.internal.zookeeper.LeaderElection$5.onSuccess(LeaderElection.java:191) [org.apache.twill.twill-zookeeper-0.12.0-SNAPSHOT.jar:0.12.0-SNAPSHOT]
              at com.google.common.util.concurrent.Futures$6.run(Futures.java:799) [com.google.guava.guava-13.0.1.jar:na]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
      Caused by: java.net.MalformedURLException: For input string: "port"
              at java.net.URL.<init>(URL.java:627) ~[na:1.8.0_112]
              at java.net.URL.<init>(URL.java:490) ~[na:1.8.0_112]
              at java.net.URL.<init>(URL.java:439) ~[na:1.8.0_112]
              at java.net.URI.toURL(URI.java:1089) ~[na:1.8.0_112]
              at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:159) ~[jersey-bundle-1.17.1.jar:1.17.1]
              at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149) ~[jersey-bundle-1.17.1.jar:1.17.1]
              ... 55 common frames omitted
      Caused by: java.lang.NumberFormatException: For input string: "port"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_112]
              at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_112]
              at java.lang.Integer.parseInt(Integer.java:615) ~[na:1.8.0_112]
              at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:216) ~[na:1.8.0_112]
              at java.net.URL.<init>(URL.java:622) ~[na:1.8.0_112]
              ... 60 common frames omitted
      

        Attachments

          Activity

            People

            • Assignee:
              rsinha Rohit Sinha
              Reporter:
              yaojie Yaojie Feng
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: