Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Hive Metastore throws a null pointer exception

avatar
New Member

Hi, We are facing Hive Metastore issue.The metastore stops after few seconds and it throws a null pointer exception.Hive metastore service is running on Namenode machine and postgres DB is set on remote machine.The initialization script ran successfully and created all the required tables on the hive schema. Below are the logs for the reference.

2017-05-19 14:58:47,735 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:main(6279)) - Starting hive metastore on port 9083
2017-05-19 14:58:47,983 INFO  [main]: impl.MetricsConfig (MetricsConfig.java:loadFirst(112)) - loaded properties from hadoop-metrics2-hivemetastore.properties
2017-05-19 14:58:48,305 INFO  [main]: timeline.HadoopTimelineMetricsSink (HadoopTimelineMetricsSink.java:init(80)) - Initializing Timeline metrics sink.
2017-05-19 14:58:48,306 INFO  [main]: timeline.HadoopTimelineMetricsSink (HadoopTimelineMetricsSink.java:init(98)) - Identified hostname = <hostname>, serviceName = hivemetastore
2017-05-19 14:58:48,401 INFO  [main]: availability.MetricSinkWriteShardHostnameHashingStrategy (MetricSinkWriteShardHostnameHashingStrategy.java:findCollectorShard(42)) - Calculated collector shard <hostname> based on hostname: <hostname>
2017-05-19 14:58:48,401 INFO  [main]: timeline.HadoopTimelineMetricsSink (HadoopTimelineMetricsSink.java:init(121)) - Collector Uri: http://<hostname>:6188/ws/v1/timeline/metrics
2017-05-19 14:58:48,401 INFO  [main]: timeline.HadoopTimelineMetricsSink (HadoopTimelineMetricsSink.java:init(122)) - Container Metrics Uri: http://<hostname>:6188/ws/v1/timeline/containermetrics
2017-05-19 14:58:48,426 INFO  [main]: impl.MetricsSinkAdapter (MetricsSinkAdapter.java:start(206)) - Sink timeline started
2017-05-19 14:58:48,506 INFO  [main]: impl.MetricsSystemImpl (MetricsSystemImpl.java:startTimer(376)) - Scheduled snapshot period at 10 second(s).
2017-05-19 14:58:48,506 INFO  [main]: impl.MetricsSystemImpl (MetricsSystemImpl.java:start(192)) - hivemetastore metrics system started
2017-05-19 14:58:48,607 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:newRawStore(685)) - 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
2017-05-19 14:58:49,285 INFO  [main]: metastore.ObjectStore (ObjectStore.java:initializeHelper(377)) - ObjectStore, initialize called
2017-05-19 14:58:50,443 INFO  [main]: metastore.ObjectStore (ObjectStore.java:getPMF(481)) - Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,Database,Type,FieldSchema,Order"
2017-05-19 14:58:50,494 ERROR [main]: metastore.RetryingHMSHandler (RetryingHMSHandler.java:invokeInternal(203)) - java.lang.NullPointerException: tuples must be non-null
        at org.postgresql.jdbc.PgResultSet.<init>(PgResultSet.java:144)
        at org.postgresql.jdbc.PgStatement.createResultSet(PgStatement.java:160)
        at org.postgresql.jdbc.PgStatement$StatementResultHandler.handleResultRows(PgStatement.java:210)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2034)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
        at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
        at org.postgresql.jdbc.PgConnection.execSQLUpdate(PgConnection.java:477)
        at org.postgresql.jdbc.PgConnection.getTransactionIsolation(PgConnection.java:847)
        at com.jolbox.bonecp.ConnectionHandle.getTransactionIsolation(ConnectionHandle.java:825)
        at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:427)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.getNucleusConnection(RDBMSStoreManager.java:1357)
        at org.datanucleus.api.jdo.JDOPersistenceManager.getDataStoreConnection(JDOPersistenceManager.java:2263)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.getProductName(MetaStoreDirectSql.java:168)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.determineDbType(MetaStoreDirectSql.java:151)
        at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.<init>(MetaStoreDirectSql.java:121)
        at org.apache.hadoop.hive.metastore.ObjectStore.initializeHelper(ObjectStore.java:383)
        at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:316)
        at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:277)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.<init>(RawStoreProxy.java:60)
        at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:69)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:689)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:667)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:716)


1 ACCEPTED SOLUTION

avatar

I suspect you are hitting a Postgres bug, see https://github.com/pgjdbc/pgjdbc/issues/667. Can you try changing the Postgres JDBC driver to a newer version?

View solution in original post

2 REPLIES 2

avatar

I suspect you are hitting a Postgres bug, see https://github.com/pgjdbc/pgjdbc/issues/667. Can you try changing the Postgres JDBC driver to a newer version?

avatar
New Member

Thanks Deepesh. It was the Postgres jar version issue. This got resolved adding new Postgres jar 42.1.1 version ambari-server setup. Hive metastore is running now