[
https://issues.apache.org/jira/browse/KNOX-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17746297#comment-17746297
]
ASF subversion and git services commented on KNOX-2943:
-------------------------------------------------------
Commit 1111d04ad7f15627b9d034d3460cd7698e88e72f in knox's branch
refs/heads/master from Sandor Molnar
[ https://gitbox.apache.org/repos/asf?p=knox.git;h=1111d04ad ]
KNOX-2943 - Handling CORE-SETTINGS service properly (#780)
> NPE is thrown when discovering CORE-SETTINGS for the first time
> ---------------------------------------------------------------
>
> Key: KNOX-2943
> URL: https://issues.apache.org/jira/browse/KNOX-2943
> Project: Apache Knox
> Issue Type: Bug
> Components: cm-discovery
> Affects Versions: 2.0.0
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Critical
> Fix For: 2.1.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> While doing RCA in one of my CM discovery task, I found that an NPE is thrown
> when discovering CORE-SETTINGS' roles and trying to save them in the
> in-memory registry:
> {noformat}
> 2023-07-19 10:27:38,803 INFO discovery.cm
> (ClouderaManagerServiceDiscovery.java:discoverCluster(273)) - Discovering
> service: core_settings (CORE_SETTINGS) ...
> 2023-07-19 10:27:38,803 DEBUG discovery.cm
> (ClouderaManagerServiceDiscovery.java:getRoles(377)) - Looking up roles from
> service discovery repository...
> 2023-07-19 10:27:38,803 DEBUG discovery.cm
> (ClouderaManagerServiceDiscovery.java:getRoles(384)) - Looking up roles from
> the configured Cloudera Manager discovery endpoint...
> 2023-07-19 10:27:38,804 ERROR knox.gateway
> (DefaultTopologyService.java:onFileChange(881)) - An error occurred while
> processing cdp-proxy-api.json : java.lang.NullPointerException
> java.lang.NullPointerException
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscoveryRepository$ServiceDetails.addRoles(ClouderaManagerServiceDiscoveryRepository.java:179)
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscoveryRepository.addRoles(ClouderaManagerServiceDiscoveryRepository.java:100)
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscovery.getRoles(ClouderaManagerServiceDiscovery.java:397)
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscovery.discoverCluster(ClouderaManagerServiceDiscovery.java:279)
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscovery.discover(ClouderaManagerServiceDiscovery.java:203)
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscovery.discover(ClouderaManagerServiceDiscovery.java:188)
> at
> org.apache.knox.gateway.topology.discovery.cm.ClouderaManagerServiceDiscovery.discover(ClouderaManagerServiceDiscovery.java:58)
> at
> org.apache.knox.gateway.topology.simple.SimpleDescriptorHandler.performDiscovery(SimpleDescriptorHandler.java:253)
> at
> org.apache.knox.gateway.topology.simple.SimpleDescriptorHandler.handle(SimpleDescriptorHandler.java:114)
> at
> org.apache.knox.gateway.topology.simple.SimpleDescriptorHandler.handle(SimpleDescriptorHandler.java:97)
> at
> org.apache.knox.gateway.services.topology.impl.DefaultTopologyService$DescriptorsMonitor.onFileChange(DefaultTopologyService.java:846)
> at
> org.apache.knox.gateway.services.topology.impl.DefaultTopologyService.reloadDescriptors(DefaultTopologyService.java:573)
> at org.apache.knox.gateway.GatewayServer.start(GatewayServer.java:655)
> at org.apache.knox.gateway.GatewayServer.startGateway(GatewayServer.java:417)
> at org.apache.knox.gateway.GatewayServer.main(GatewayServer.java:186)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.knox.gateway.launcher.Invoker.invokeMainMethod(Invoker.java:68)
> at org.apache.knox.gateway.launcher.Invoker.invoke(Invoker.java:39)
> at org.apache.knox.gateway.launcher.Command.run(Command.java:99)
> at org.apache.knox.gateway.launcher.Launcher.run(Launcher.java:75)
> at org.apache.knox.gateway.launcher.Launcher.main(Launcher.java:52)
> {noformat}
> CM's CORE-SETTINGS service has no roles, thus, it does not make sense to
> discover roles for this service. In theory, I fixed that issue a couple of
> weeks ago (in KNOX{-}2909), but there is a missing null check in the code
> (I'm not sure how my tests succeeded before).
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)