Dmitry Lysnichenko created AMBARI-23403:
-------------------------------------------

             Summary: Upgrade throws NullPointerException when configuration 
type is not selected
                 Key: AMBARI-23403
                 URL: https://issues.apache.org/jira/browse/AMBARI-23403
             Project: Ambari
          Issue Type: Bug
            Reporter: Dmitry Lysnichenko
            Assignee: Dmitry Lysnichenko



{code}
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)
{code}

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 {code}UpgradeHelper{code} class, 
and returning a more useful error message.  Perhaps the customer should get a 
message indicating the problem with the config types.






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to