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

Logging improvement during the Upgrade when there is invalid Alert definition

    XMLWordPrintableJSON

Details

    Description

      If there is invalid definition/json in alert definition then Upgrade would fail with below exception. there is no way to determine which alert is causing the issue here.

      its not clear how this alert definition gets corrupted but we have seen this with 3 to 4 customers already - printing the alert definition name would he helpful in support point of view to determine the root cause.. other wise it is very difficult to find it out - had a give a dev patch to customers to find it out.

      29 Jan 2018 19:58:50,173 ERROR [main] AlertDefinitionFactory:199 - Unable to deserialize the alert definition source during coercion
      com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
      	at com.google.gson.Gson.fromJson(Gson.java:795)
      	at com.google.gson.Gson.fromJson(Gson.java:859)
      	at com.google.gson.Gson$2.deserialize(Gson.java:131)
      	at org.apache.ambari.server.state.alert.AlertDefinitionFactory$AlertDefinitionSourceAdapter.deserialize(AlertDefinitionFactory.java:373)
      	at org.apache.ambari.server.state.alert.AlertDefinitionFactory$AlertDefinitionSourceAdapter.deserialize(AlertDefinitionFactory.java:313)
      	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58)
      	at com.google.gson.Gson.fromJson(Gson.java:795)
      	at com.google.gson.Gson.fromJson(Gson.java:761)
      	at com.google.gson.Gson.fromJson(Gson.java:710)
      	at com.google.gson.Gson.fromJson(Gson.java:682)
      	at org.apache.ambari.server.state.alert.AlertDefinitionFactory.coerce(AlertDefinitionFactory.java:196)
      	at org.apache.ambari.server.api.services.AmbariMetaInfo.reconcileAlertDefinitions(AmbariMetaInfo.java:1150)
      	at org.apache.ambari.server.upgrade.UpdateAlertScriptPaths.executeDMLUpdates(UpdateAlertScriptPaths.java:46)
      	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:946)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:237)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:450)
      Caused by: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT
      	at com.google.gson.internal.bind.JsonTreeReader.nextString(JsonTreeReader.java:154)
      	at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:349)
      	at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:337)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
      	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
      	... 16 more
      29 Jan 2018 19:58:50,176 ERROR [main] SchemaUpgradeHelper:239 - Upgrade failed. 
      java.lang.NullPointerException
      	at org.apache.ambari.server.api.services.AmbariMetaInfo.reconcileAlertDefinitions(AmbariMetaInfo.java:1163)
      	at org.apache.ambari.server.upgrade.UpdateAlertScriptPaths.executeDMLUpdates(UpdateAlertScriptPaths.java:46)
      	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:946)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:237)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:450)
      29 Jan 2018 19:58:50,177 ERROR [main] SchemaUpgradeHelper:464 - Exception occurred during upgrade, failed
      org.apache.ambari.server.AmbariException
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:240)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:450)
      Caused by: java.lang.NullPointerException
      	at org.apache.ambari.server.api.services.AmbariMetaInfo.reconcileAlertDefinitions(AmbariMetaInfo.java:1163)
      	at org.apache.ambari.server.upgrade.UpdateAlertScriptPaths.executeDMLUpdates(UpdateAlertScriptPaths.java:46)
      	at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeData(AbstractUpgradeCatalog.java:946)
      	at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeDMLUpdates(SchemaUpgradeHelper.java:237)
      	... 1 more
      

      Attachments

        1. AMBARI-22891.txt
          0.9 kB
          amarnath reddy pappu

        Activity

          People

            apappu@hortonworks.com amarnath reddy pappu
            apappu@hortonworks.com amarnath reddy pappu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m