Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-13075

Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.2
    • Component/s: None
    • Labels:
      None

      Description

      This was reported by a customer. Customer accidentally added a config of type
      `hivesite` to a config group.

      *Call*

      curl 'http://ambhost:8080/api/v1/clusters/TSGHDP/config_groups/3' -X PUT -H "X-Requested-By: ambari" --user admin:admin --data '[{"ConfigGroup":{"id":3,"cluster_name":"HDP","group_name":"Hive_custom_group","tag":"HIVE","description":"","hosts":[

      {"host_name":"abc.local"}

      ],"service_config_version_note":"hive custom group tx timeout
      property change","desired_configs":[{"type":"hivesite","tag":"newversionforjdbcurl","properties":{"hive.txn.timeout":"310","javax.jdo.option.ConnectionURL":"jdbc:mysql://abc.local/hive2?createDatabaseIfNotExist=true"}}]}}]' --compressed

      This resulted in ambari-server failing to process agent heartbeat and throwing
      NPE.

      13 Aug 2015 10:36:28,961 WARN [ambari-hearbeat-monitor] HeartbeatMonitor:129 - Exception received
      java.lang.NullPointerException
      at org.apache.ambari.server.state.host.HostImpl.getDesiredHostConfigs(HostImpl.java:1349)
      at org.apache.ambari.server.state.ConfigHelper.getEffectiveDesiredTags(ConfigHelper.java:109)
      at org.apache.ambari.server.agent.HeartbeatMonitor.createStatusCommand(HeartbeatMonitor.java:253)
      at org.apache.ambari.server.agent.HeartbeatMonitor.generateStatusCommands(HeartbeatMonitor.java:218)
      at org.apache.ambari.server.agent.HeartbeatMonitor.doWork(HeartbeatMonitor.java:190)
      at org.apache.ambari.server.agent.HeartbeatMonitor.run(HeartbeatMonitor.java:121)
      at java.lang.Thread.run(Thread.java:745)

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Ambari-branch-2.1 #519 (See https://builds.apache.org/job/Ambari-branch-2.1/519/)
          AMBARI-13075. Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=28689a80be836d4242867af3c9ff61ab76a0a311)

          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Ambari-branch-2.1 #519 (See https://builds.apache.org/job/Ambari-branch-2.1/519/ ) AMBARI-13075 . Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=28689a80be836d4242867af3c9ff61ab76a0a311 ) ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Ambari-branch-2.1 #518 (See https://builds.apache.org/job/Ambari-branch-2.1/518/)
          AMBARI-13075. Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=0293d4cf03fef6155168f98714b33bea4bc276c8)

          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Ambari-branch-2.1 #518 (See https://builds.apache.org/job/Ambari-branch-2.1/518/ ) AMBARI-13075 . Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=0293d4cf03fef6155168f98714b33bea4bc276c8 ) ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Ambari-trunk-Commit #3427 (See https://builds.apache.org/job/Ambari-trunk-Commit/3427/)
          AMBARI-13075. Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=7c2dd39448643c428e9deb9decc47bec73937484)

          • ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Ambari-trunk-Commit #3427 (See https://builds.apache.org/job/Ambari-trunk-Commit/3427/ ) AMBARI-13075 . Make ambari-server robust/debuggable if user accidentally adds a config type to a config groups when it does not exist as base type (aonishuk) (aonishuk: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=7c2dd39448643c428e9deb9decc47bec73937484 ) ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
          Hide
          aonishuk Andrew Onischuk added a comment -

          Committed to trunk and branch-2.1

          Show
          aonishuk Andrew Onischuk added a comment - Committed to trunk and branch-2.1

            People

            • Assignee:
              aonishuk Andrew Onischuk
              Reporter:
              aonishuk Andrew Onischuk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development