title: Hive server not coming up
body: <p>Hive server is not coming up with following error. I cannot re-initialize hive-metastore because i do not want to lose data which is already there in cluster. Cluster settings are fine because we have been using the same cluster for more than a year without this issue. Thanks in advance!</p>
  
  <pre><code>exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
      at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:578)
      at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:518)
      at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:705)
      at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)
      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.hadoop.util.RunJar.run(RunJar.java:226)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:141)
  Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
      at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:226)
      at org.apache.hadoop.hive.ql.metadata.Hive.&lt;init&gt;(Hive.java:366)
      at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:310)
      at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:290)
      at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:266)
      at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:545)
      ... 9 more
  Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
      at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1627)
      at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.&lt;init&gt;(RetryingMetaStoreClient.java:80)
      at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:130)
      at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:101)
      at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3317)
      at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3356)
      at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3336)
      at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3590)
      at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:236)
      at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:221)
      ... 14 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1625)
      ... 23 more
  Caused by: javax.jdo.JDOUserException: The query returned more than one instance BUT either unique is set to true or only aggregates are to be returned, so should have returned one result maximum
  NestedThrowables:
  org.datanucleus.store.query.QueryNotUniqueException: The query returned more than one instance BUT either unique is set to true or only aggregates are to be returned, so should have returned one result maximum
      at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:636)
      at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:388)
      at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:225)
      at org.apache.hadoop.hive.metastore.ObjectStore.getMRole(ObjectStore.java:4091)
      at org.apache.hadoop.hive.metastore.ObjectStore.addRole(ObjectStore.java:3731)
      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.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)
      at com.sun.proxy.$Proxy21.addRole(Unknown Source)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles_core(HiveMetaStore.java:644)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultRoles(HiveMetaStore.java:636)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:399)
      at org.apache.hadoop.hive.metastore.RetryingHMSHandler.&lt;init&gt;(RetryingHMSHandler.java:78)
      at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:84)
      at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6396)
      at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.&lt;init&gt;(HiveMetaStoreClient.java:236)
      at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.&lt;init&gt;(SessionHiveMetaStoreClient.java:70)
      ... 28 more
  Caused by: org.datanucleus.store.query.QueryNotUniqueException: The query returned more than one instance BUT either unique is set to true or only aggregates are to be returned, so should have returned one result maximum
      at org.datanucleus.store.query.Query.executeQuery(Query.java:1879)
      at org.datanucleus.store.query.Query.executeWithArray(Query.java:1733)
      at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:365)
      ... 45 more
  </code></pre>