Hive
  1. Hive
  2. HIVE-2473

Hive throws an NPE when $HADOOP_HOME points to a tarball install directory that contains a build/ subdirectory.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      hadoop-0.20.204.0

      Issue Links

        Activity

        Carl Steinbach created issue -
        Hide
        Carl Steinbach added a comment -

        Steps to reproduce:

        % tar -xvzf hadoop-0.20.204.0.tar.gz 
        % cd hadoop-0.20.204.0.tar.gz
        % ant
        % export HADOOP_HOME=`pwd`
        % export PATH=$HADOOP_HOME/bin:$PATH
        % cd ..
        % hive -e 'show tables' -hiveconf hive.root.logger=INFO,console
        WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
        Logging initialized using configuration in jar:file:/home/carl/Work/repos/hive2/build/dist/lib/hive-common-0.9.0-SNAPSHOT.jar!/hive-log4j.properties
        11/09/30 17:21:09 INFO SessionState: Logging initialized using configuration in jar:file:/home/carl/Work/repos/hive2/build/dist/lib/hive-common-0.9.0-SNAPSHOT.jar!/hive-log4j.properties
        Hive history file=/tmp/carl/hive_job_log_carl_201109301721_961941092.txt
        11/09/30 17:21:09 INFO exec.HiveHistory: Hive history file=/tmp/carl/hive_job_log_carl_201109301721_961941092.txt
        show tables;
        11/09/30 17:21:12 INFO ql.Driver: <PERFLOG method=compile>
        11/09/30 17:21:12 INFO parse.ParseDriver: Parsing command: show tables
        11/09/30 17:21:12 INFO parse.ParseDriver: Parse Completed
        11/09/30 17:21:12 INFO ql.Driver: Semantic Analysis Completed
        11/09/30 17:21:12 INFO ql.Driver: Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
        11/09/30 17:21:12 INFO ql.Driver: </PERFLOG method=compile start=1317428472621 end=1317428472868 duration=247>
        11/09/30 17:21:12 INFO ql.Driver: <PERFLOG method=Driver.execute>
        11/09/30 17:21:12 INFO ql.Driver: Starting command: show tables
        11/09/30 17:21:12 INFO metastore.HiveMetaStore: 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
        11/09/30 17:21:12 INFO metastore.ObjectStore: ObjectStore, initialize called
        11/09/30 17:21:13 ERROR metastore.HiveMetaStore: JDO datastore error. Retrying metastore command after 1000 ms (attempt 1 of 1)
        11/09/30 17:21:14 INFO metastore.HiveMetaStore: 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
        11/09/30 17:21:14 INFO metastore.ObjectStore: ObjectStore, initialize called
        FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
        NestedThrowables:
        java.lang.reflect.InvocationTargetException
        11/09/30 17:21:14 ERROR exec.Task: FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
        NestedThrowables:
        java.lang.reflect.InvocationTargetException
        org.apache.hadoop.hive.ql.metadata.HiveException: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
        NestedThrowables:
        java.lang.reflect.InvocationTargetException
        	at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1045)
        	at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1030)
        	at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:1825)
        	at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:299)
        	at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:132)
        	at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
        	at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1327)
        	at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1118)
        	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:926)
        	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:253)
        	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:210)
        	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:401)
        	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:669)
        	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:552)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
        Caused by: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
        NestedThrowables:
        java.lang.reflect.InvocationTargetException
        	at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1186)
        	at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
        	at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
        	at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:246)
        	at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:275)
        	at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:208)
        	at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:183)
        	at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
        	at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
        	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:396)
        	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:348)
        	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:493)
        	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:261)
        	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:224)
        	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:109)
        	at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2027)
        	at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2037)
        	at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1041)
        	... 18 more
        Caused by: java.lang.reflect.InvocationTargetException
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at javax.jdo.JDOHelper$16.run(JDOHelper.java:1958)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at javax.jdo.JDOHelper.invoke(JDOHelper.java:1953)
        	at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
        	... 35 more
        Caused by: java.lang.NullPointerException
        	at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:443)
        	at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:355)
        	at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(NonManagedPluginRegistry.java:215)
        	at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(NonManagedPluginRegistry.java:156)
        	at org.datanucleus.plugin.PluginManager.registerExtensionPoints(PluginManager.java:82)
        	at org.datanucleus.OMFContext.<init>(OMFContext.java:156)
        	at org.datanucleus.OMFContext.<init>(OMFContext.java:137)
        	at org.datanucleus.ObjectManagerFactoryImpl.initialiseOMFContext(ObjectManagerFactoryImpl.java:132)
        	at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:363)
        	at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:307)
        	at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:255)
        	at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
        	... 43 more
        
        FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
        11/09/30 17:21:14 ERROR ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
        11/09/30 17:21:14 INFO ql.Driver: </PERFLOG method=Driver.execute start=1317428472868 end=1317428474321 duration=1453>
        11/09/30 17:21:14 INFO ql.Driver: <PERFLOG method=releaseLocks>
        11/09/30 17:21:14 INFO ql.Driver: </PERFLOG method=releaseLocks start=1317428474321 end=1317428474321 duration=0>
        hive> 
        
        Show
        Carl Steinbach added a comment - Steps to reproduce: % tar -xvzf hadoop-0.20.204.0.tar.gz % cd hadoop-0.20.204.0.tar.gz % ant % export HADOOP_HOME=`pwd` % export PATH=$HADOOP_HOME/bin:$PATH % cd .. % hive -e 'show tables' -hiveconf hive.root.logger=INFO,console WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files. Logging initialized using configuration in jar:file:/home/carl/Work/repos/hive2/build/dist/lib/hive-common-0.9.0-SNAPSHOT.jar!/hive-log4j.properties 11/09/30 17:21:09 INFO SessionState: Logging initialized using configuration in jar:file:/home/carl/Work/repos/hive2/build/dist/lib/hive-common-0.9.0-SNAPSHOT.jar!/hive-log4j.properties Hive history file=/tmp/carl/hive_job_log_carl_201109301721_961941092.txt 11/09/30 17:21:09 INFO exec.HiveHistory: Hive history file=/tmp/carl/hive_job_log_carl_201109301721_961941092.txt show tables; 11/09/30 17:21:12 INFO ql.Driver: <PERFLOG method=compile> 11/09/30 17:21:12 INFO parse.ParseDriver: Parsing command: show tables 11/09/30 17:21:12 INFO parse.ParseDriver: Parse Completed 11/09/30 17:21:12 INFO ql.Driver: Semantic Analysis Completed 11/09/30 17:21:12 INFO ql.Driver: Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null) 11/09/30 17:21:12 INFO ql.Driver: </PERFLOG method=compile start=1317428472621 end=1317428472868 duration=247> 11/09/30 17:21:12 INFO ql.Driver: <PERFLOG method=Driver.execute> 11/09/30 17:21:12 INFO ql.Driver: Starting command: show tables 11/09/30 17:21:12 INFO metastore.HiveMetaStore: 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore 11/09/30 17:21:12 INFO metastore.ObjectStore: ObjectStore, initialize called 11/09/30 17:21:13 ERROR metastore.HiveMetaStore: JDO datastore error. Retrying metastore command after 1000 ms (attempt 1 of 1) 11/09/30 17:21:14 INFO metastore.HiveMetaStore: 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore 11/09/30 17:21:14 INFO metastore.ObjectStore: ObjectStore, initialize called FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught. NestedThrowables: java.lang.reflect.InvocationTargetException 11/09/30 17:21:14 ERROR exec.Task: FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught. NestedThrowables: java.lang.reflect.InvocationTargetException org.apache.hadoop.hive.ql.metadata.HiveException: javax.jdo.JDOFatalInternalException: Unexpected exception caught. NestedThrowables: java.lang.reflect.InvocationTargetException at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1045) at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1030) at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:1825) at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:299) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:132) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57) at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1327) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1118) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:926) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:253) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:210) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:401) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:669) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.RunJar.main(RunJar.java:156) Caused by: javax.jdo.JDOFatalInternalException: Unexpected exception caught. NestedThrowables: java.lang.reflect.InvocationTargetException at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1186) at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803) at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698) at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:246) at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:275) at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:208) at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:183) at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62) at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117) at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:396) at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:348) at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:493) at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:261) at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:224) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:109) at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2027) at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2037) at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1041) ... 18 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.jdo.JDOHelper$16.run(JDOHelper.java:1958) at java.security.AccessController.doPrivileged(Native Method) at javax.jdo.JDOHelper.invoke(JDOHelper.java:1953) at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159) ... 35 more Caused by: java.lang.NullPointerException at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:443) at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:355) at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(NonManagedPluginRegistry.java:215) at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(NonManagedPluginRegistry.java:156) at org.datanucleus.plugin.PluginManager.registerExtensionPoints(PluginManager.java:82) at org.datanucleus.OMFContext.<init>(OMFContext.java:156) at org.datanucleus.OMFContext.<init>(OMFContext.java:137) at org.datanucleus.ObjectManagerFactoryImpl.initialiseOMFContext(ObjectManagerFactoryImpl.java:132) at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:363) at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:307) at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:255) at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182) ... 43 more FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask 11/09/30 17:21:14 ERROR ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask 11/09/30 17:21:14 INFO ql.Driver: </PERFLOG method=Driver.execute start=1317428472868 end=1317428474321 duration=1453> 11/09/30 17:21:14 INFO ql.Driver: <PERFLOG method=releaseLocks> 11/09/30 17:21:14 INFO ql.Driver: </PERFLOG method=releaseLocks start=1317428474321 end=1317428474321 duration=0> hive>
        Hide
        Carl Steinbach added a comment -

        Workaround: either remove the $HADOOP_HOME/build directory (which was created when ant was run), or else set $HADOOP_HOME to point to the build subdirectory.

        Cause: The root cause of the bug is that the aspectjtools-1.6.5.jar appears twice on the CLASSPATH when the build subdirectory is present, and when this happens DataNucleus throws an NPE.

        Show
        Carl Steinbach added a comment - Workaround: either remove the $HADOOP_HOME/build directory (which was created when ant was run), or else set $HADOOP_HOME to point to the build subdirectory. Cause: The root cause of the bug is that the aspectjtools-1.6.5.jar appears twice on the CLASSPATH when the build subdirectory is present, and when this happens DataNucleus throws an NPE.
        Hide
        Benoy Antony added a comment -

        The issue is more pronounced when trying to use Hive 0.7 with Hadoop 0.22. Hadoop 0.22 has aspectj in the libs of common, hdfs and mapreduce. All the jars in these 3 libs are included in Hive's classpath. So the aspectj*.jar appears thrice in the Hive's classpath and hive throws the above exception.

        Show
        Benoy Antony added a comment - The issue is more pronounced when trying to use Hive 0.7 with Hadoop 0.22. Hadoop 0.22 has aspectj in the libs of common, hdfs and mapreduce. All the jars in these 3 libs are included in Hive's classpath. So the aspectj*.jar appears thrice in the Hive's classpath and hive throws the above exception.
        Ashutosh Chauhan made changes -
        Field Original Value New Value
        Link This issue is blocked by HIVE-2084 [ HIVE-2084 ]
        Hide
        Carl Steinbach added a comment -

        It looks like the underlying bug has been resolved in DN 3.0.0: http://www.datanucleus.org/servlet/jira/browse/NUCCORE-689

        Show
        Carl Steinbach added a comment - It looks like the underlying bug has been resolved in DN 3.0.0: http://www.datanucleus.org/servlet/jira/browse/NUCCORE-689
        Hide
        Ashutosh Chauhan added a comment -

        This should have been fixed via HIVE-3632 If you can still reproduce, feel free to reopen.

        Show
        Ashutosh Chauhan added a comment - This should have been fixed via HIVE-3632 If you can still reproduce, feel free to reopen.
        Ashutosh Chauhan made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.12.0 [ 12324312 ]
        Resolution Fixed [ 1 ]
        Hide
        Ashutosh Chauhan added a comment -

        This issue has been fixed and released as part of 0.12 release. If you find further issues, please create a new jira and link it to this one.

        Show
        Ashutosh Chauhan added a comment - This issue has been fixed and released as part of 0.12 release. If you find further issues, please create a new jira and link it to this one.
        Ashutosh Chauhan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Carl Steinbach
            Reporter:
            Carl Steinbach
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development