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

Upgrade throws NullPointerException when configuration type is not selected

    XMLWordPrintableJSON

Details

    Description

      java.lang.NullPointerException
      at org.apache.ambari.server.state.UpgradeHelper.processConfigurationsIfRequired(UpgradeHelper.java:1032)
      at org.apache.ambari.server.state.UpgradeHelper.updateDesiredRepositoriesAndConfigs(UpgradeHelper.java:849)
      at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:118)
      at org.apache.ambari.server.serveraction.upgrades.UpdateDesiredRepositoryAction.updateDesiredRepositoryVersion(UpdateDesiredRepositoryAction.java:166)
      at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:128)
      at org.apache.ambari.server.serveraction.upgrades.UpdateDesiredRepositoryAction.execute(UpdateDesiredRepositoryAction.java:104)
      at org.apache.ambari.server.serveraction.ServerActionExecutor$Worker.execute(ServerActionExecutor.java:550)
      at org.apache.ambari.server.serveraction.ServerActionExecutor$Worker.run(ServerActionExecutor.java:466)
      at java.lang.Thread.run(Thread.java:745)
      

      The main issue here is that if any configuration types in the "clusterconfig" table (in the ambari-server DB) happen to not be selected (no versions of that config type have "selected"= "1", then this NullPointerException is thrown.
      The Ambari Server Upgrade code should probably handle this exception case more gracefully, by adding a check for null in the

      UpgradeHelper

      class, and returning a more useful error message. Perhaps the customer should get a message indicating the problem with the config types.

      Attachments

        Issue Links

          Activity

            People

              dmitriusan Dmitry Lysnichenko
              dmitriusan Dmitry Lysnichenko
              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 - 1.5h
                  1.5h