You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/03/19 10:24:00 UTC

[jira] [Work logged] (KNOX-3022) Possible NPE at CM cluster configuration monitor startup due to cluster configuration file issues

     [ https://issues.apache.org/jira/browse/KNOX-3022?focusedWorklogId=910495&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-910495 ]

ASF GitHub Bot logged work on KNOX-3022:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Mar/24 10:23
            Start Date: 19/Mar/24 10:23
    Worklog Time Spent: 10m 
      Work Description: smolnar82 opened a new pull request, #890:
URL: https://github.com/apache/knox/pull/890

   ## What changes were proposed in this pull request?
   
   As described in the corresponding KNOX-3022 JIRA, it might happen - due to various IO reasons - that the CM cluster configuration file is empty at Knox startup time. This could prevent the Knox Gateway from starting.
   In this PR we fix this issue.
   
   ## How was this patch tested?
   
   Added a new JUnit test case as well as ran manual testing on a real cluster using CM discovery. Once my patch was applied, the Knox Gateway started properly, and the empty file log entry appeared as expected:
   ```
   grep "is empty" /var/log/knox/gateway/gateway.log 
   2024-03-19 02:56:57,434 WARN  discovery.cm (ClusterConfigurationFileStore.java:get(107)) - Previously saved cluster configuration file /var/lib/knox/gateway/data/cm-clusters/https___CM-HOST_CM-PORT-Cluster_1.ver is empty.
   ```
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 910495)
    Remaining Estimate: 0h
            Time Spent: 10m

> Possible NPE at CM cluster configuration monitor startup due to cluster configuration file issues
> -------------------------------------------------------------------------------------------------
>
>                 Key: KNOX-3022
>                 URL: https://issues.apache.org/jira/browse/KNOX-3022
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: cm-discovery
>    Affects Versions: 2.0.0, 1.6.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Critical
>             Fix For: 2.1.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In KNOX-2869, we handled the case where {{$KNOX_DATA_DIR/cm-clusters/hCM_HOST_7183-Cluster_1.conf}} file was empty. However, it might be the same for the {{$KNOX_DATA_DIR/cm-clusters/hCM_HOST_7183-Cluster_1.ver}} file where previously persisted cluster configuration (with service/role details) is stored.
> If that file is empty, the following error is thrown:
> {noformat}
> 2024-03-18 19:01:34,840 ERROR discovery.cm (ClusterConfigurationFileStore.java:get(106)) - Failed to load persisted service configuration data for cluster monitor CM : com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
>  at [Source: (sun.nio.ch.ChannelInputStream); line: 1, column: 0]
> 2024-03-18 19:01:34,841 FATAL knox.gateway (GatewayServer.java:main(193)) - Failed to start gateway: java.lang.NullPointerException
> java.lang.NullPointerException
>         at org.apache.knox.gateway.topology.discovery.cm.monitor.ClouderaManagerClusterConfigurationMonitor.loadServiceConfiguration(ClouderaManagerClusterConfigurationMonitor.java:196)
>         at org.apache.knox.gateway.topology.discovery.cm.monitor.ClouderaManagerClusterConfigurationMonitor.<init>(ClouderaManagerClusterConfigurationMonitor.java:103)
>         at org.apache.knox.gateway.topology.discovery.cm.monitor.ClouderaManagerClusterConfigurationMonitorProvider.newInstance(ClouderaManagerClusterConfigurationMonitorProvider.java:35)
>         at org.apache.knox.gateway.services.topology.impl.DefaultClusterConfigurationMonitorService.init(DefaultClusterConfigurationMonitorService.java:44)
>         at org.apache.knox.gateway.services.DefaultGatewayServices.init(DefaultGatewayServices.java:137)
>         at org.apache.knox.gateway.GatewayServer.main(GatewayServer.java:184)
>         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}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)