You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Hari Sekhon (JIRA)" <ji...@apache.org> on 2016/09/28 21:29:20 UTC

[jira] [Created] (HIVE-14853) Hive SchemaTool "No current connection", HiveMetaException: Upgrade FAILED! Metastore state would be inconsistent !!

Hari Sekhon created HIVE-14853:
----------------------------------

             Summary: Hive SchemaTool "No current connection", HiveMetaException: Upgrade FAILED! Metastore state would be inconsistent !! 
                 Key: HIVE-14853
                 URL: https://issues.apache.org/jira/browse/HIVE-14853
             Project: Hive
          Issue Type: Bug
          Components: Metastore
    Affects Versions: 1.2.1
         Environment: HDP 2.3.2 => HDP 2.5.0 upgrade
            Reporter: Hari Sekhon


When upgrading from HDP 2.3.2 to HDP 2.5.0 I've encountered an issue with hive schematool failing to upgrade the schema with a "No current connection" error and some out of place "og" printed strings. Ambari encounters the following issue which I've also reproduced on the command line using the same call Ambari was trying to make:

{code}
HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server /usr/hdp/2.5.0.0-1245/hive2/bin/schematool -dbType mysql -upgradeSchema --verbose 
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 
Metastore connection URL: jdbc:mysql://<fqdn>/hive?createDatabaseIfNotExist=true 
Metastore Connection Driver : com.mysql.jdbc.Driver 
Metastore connection User: hive 
Starting upgrade metastore schema from version 1.2.0 to 1.2.1000 
Upgrade script upgrade-1.2.0-to-1.2.1000.mysql.sql 
Connecting to jdbc:mysql://<fqdn>/hive?createDatabaseIfNotExist=true 
og 
0: jdbc:mysql://<fqdn>/hive (closed)> !autocommit on 
og 
No current connection 

og 
Connection is already closed. 
org.apache.hadoop.hive.metastore.HiveMetaException: Upgrade FAILED! Metastore state would be inconsistent !! 
Underlying cause: java.io.IOException : Schema script failed, errorcode 2 
org.apache.hadoop.hive.metastore.HiveMetaException: Upgrade FAILED! Metastore state would be inconsistent !! 
at org.apache.hive.beeline.HiveSchemaTool.doUpgrade(HiveSchemaTool.java:244) 
at org.apache.hive.beeline.HiveSchemaTool.doUpgrade(HiveSchemaTool.java:212) 
at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:502) 
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:497) 
at org.apache.hadoop.util.RunJar.run(RunJar.java:233) 
at org.apache.hadoop.util.RunJar.main(RunJar.java:148) 
Caused by: java.io.IOException: Schema script failed, errorcode 2 
at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:391) 
at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:348) 
at org.apache.hive.beeline.HiveSchemaTool.doUpgrade(HiveSchemaTool.java:239) 
... 8 more 
*** schemaTool failed ***
{code}

Trying with -dryrun didn't complain so I ran the upgrade scripts against mysql manually and was able to proceed past this.

It appears to be a bug in schematool's JDBC connection because I double checked the jdo credentials in the hive-site.xml and was able to connect manually to the mysql database with the exact same credentials to run the schema upgrade by hand using the scripts that schematool was going to run if not for the "no current connection" error that prevented it from proceeding.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)