New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run pyadam, SQLException: Failed to start database 'metastore_db' #1666

Closed
heuermh opened this Issue Aug 15, 2017 · 5 comments

Comments

3 participants
@heuermh
Member

heuermh commented Aug 15, 2017

Ran into this when testing #1651, need to confirm if it is a broader issue

$ ./bin/pyadam 
...
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 2.2.0
      /_/

Using Python version 2.7.13 (default, Dec 20 2016 23:05:08)
SparkSession available as 'spark'.
>>> from bdgenomics.adam.adamContext import ADAMContext
>>> ac = ADAMContext(sc)
>>> reads = ac.loadAlignments("adam-core/src/test/resources/small.sam")
>>> df = reads.toDF()
2017-08-15 13:48:10 ERROR Schema:125 - Failed initialising database.
Unable to open a test connection to the given database. JDBC url = jdbc:derby:;databaseName=metastore_db;create=true, username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@21afd1a0, see the next exception for details.
...
Caused by: ERROR XJ040: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@21afd1a0, see the next exception for details.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
	... 115 more
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /Users/heuermh/working/adam/metastore_db.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
	... 112 more
------

	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 com.jolbox.bonecp.PoolUtil.generateSQLException(PoolUtil.java:192)
	at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:422)
	at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
	at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:501)
	at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:298)
	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.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:631)
	at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
	at org.datanucleus.NucleusContext.createStoreManagerForProperties(NucleusContext.java:1187)
	at org.datanucleus.NucleusContext.initialise(NucleusContext.java:356)
	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:775)
	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:333)
	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:202)
	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 javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
	at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
	at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
	at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
	at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:365)
	at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:394)
	at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:291)
	at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:258)
	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:57)
	at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:66)
	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:593)
	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:571)
	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:624)
	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:461)
	at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:66)
	at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
	at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5762)
	at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:199)
	at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.<init>(SessionHiveMetaStoreClient.java:74)
	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:1521)
	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:86)
	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:132)
	at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
	at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3005)
	at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3024)
	at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:503)
	at org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scala:191)
	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.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:264)
	at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:362)
	at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:266)
	at org.apache.spark.sql.hive.HiveExternalCatalog.client$lzycompute(HiveExternalCatalog.scala:66)
	at org.apache.spark.sql.hive.HiveExternalCatalog.client(HiveExternalCatalog.scala:65)
	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply$mcZ$sp(HiveExternalCatalog.scala:194)
	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply(HiveExternalCatalog.scala:194)
	at org.apache.spark.sql.hive.HiveExternalCatalog$$anonfun$databaseExists$1.apply(HiveExternalCatalog.scala:194)
	at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:97)
	at org.apache.spark.sql.hive.HiveExternalCatalog.databaseExists(HiveExternalCatalog.scala:193)
	at org.apache.spark.sql.internal.SharedState.externalCatalog$lzycompute(SharedState.scala:105)
	at org.apache.spark.sql.internal.SharedState.externalCatalog(SharedState.scala:93)
	at org.apache.spark.sql.hive.HiveSessionStateBuilder.externalCatalog(HiveSessionStateBuilder.scala:39)
	at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog$lzycompute(HiveSessionStateBuilder.scala:54)
	at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:52)
	at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:35)
	at org.apache.spark.sql.internal.BaseSessionStateBuilder.build(BaseSessionStateBuilder.scala:289)
	at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$instantiateSessionState(SparkSession.scala:1050)
	at org.apache.spark.sql.SparkSession$$anonfun$sessionState$2.apply(SparkSession.scala:130)
	at org.apache.spark.sql.SparkSession$$anonfun$sessionState$2.apply(SparkSession.scala:130)
	at scala.Option.getOrElse(Option.scala:121)
	at org.apache.spark.sql.SparkSession.sessionState$lzycompute(SparkSession.scala:129)
	at org.apache.spark.sql.SparkSession.sessionState(SparkSession.scala:126)
	at org.apache.spark.sql.Dataset.<init>(Dataset.scala:170)
	at org.apache.spark.sql.Dataset$.apply(Dataset.scala:61)
	at org.apache.spark.sql.SparkSession.createDataset(SparkSession.scala:472)
	at org.apache.spark.sql.SQLContext.createDataset(SQLContext.scala:392)
	at org.bdgenomics.adam.rdd.read.RDDBoundAlignmentRecordRDD.dataset$lzycompute(AlignmentRecordRDD.scala:284)
	at org.bdgenomics.adam.rdd.read.RDDBoundAlignmentRecordRDD.dataset(AlignmentRecordRDD.scala:281)
	at org.bdgenomics.adam.rdd.GenomicDataset$class.toDF(GenomicRDD.scala:1484)
	at org.bdgenomics.adam.rdd.AvroGenomicRDD.toDF(GenomicRDD.scala:1653)
	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 py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
	at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
	at py4j.Gateway.invoke(Gateway.java:280)
	at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
	at py4j.commands.CallCommand.execute(CallCommand.java:79)
	at py4j.GatewayConnection.run(GatewayConnection.java:214)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@21afd1a0, see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:208)
	at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361)
	at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416)
	... 99 more
Caused by: ERROR XJ040: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@21afd1a0, see the next exception for details.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
	... 115 more
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /Users/heuermh/working/adam/metastore_db.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLockOnDB(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOnDB(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore$6.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.store.raw.RawStore.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.access.RAMAccessManager$5.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source)
	at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
	at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
	at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
	at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown Source)
	... 112 more
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.7-x86_64/egg/bdgenomics/adam/rdd.py", line 152, in toDF
  File "/usr/local/Cellar/apache-spark/2.2.0/libexec/python/lib/py4j-0.10.4-src.zip/py4j/java_gateway.py", line 1133, in __call__
  File "/usr/local/Cellar/apache-spark/2.2.0/libexec/python/pyspark/sql/utils.py", line 79, in deco
    raise IllegalArgumentException(s.split(': ', 1)[1], stackTrace)
pyspark.sql.utils.IllegalArgumentException: u"Error while instantiating 'org.apache.spark.sql.hive.HiveSessionStateBuilder':"
@pbashyal-nmdp

This comment has been minimized.

Contributor

pbashyal-nmdp commented Aug 16, 2017

I'm having trouble building with -Ppython profile on MacOS. It's failing on tests.

(venv) $ git branch -vv
* frank-radam 9d4ba78a Run pyspark test after removing conda environment.
  master      6c8f8d7c [origin/master: ahead 8] [ADAM-1663] Enable read groups with repeated names when unioning.

(venv) $ python --version
Python 2.7.13

(venv) $ mvn clean package -Ppython -DskipTests

.....

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ADAM_2.11: Python APIs 0.23.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ adam-python-spark2_2.11 ---
[INFO] Deleting /Users/pbashyal/bioinformatics/adam/adam-python/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-versions) @ adam-python-spark2_2.11 ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ adam-python-spark2_2.11 ---
[INFO]
[INFO] --- scalariform-maven-plugin:0.1.4:format (default-cli) @ adam-python-spark2_2.11 ---
[INFO] Modified 0 of 0 .scala files
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ adam-python-spark2_2.11 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/pbashyal/bioinformatics/adam/adam-python/src/main/resources
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (scala-compile-first) @ adam-python-spark2_2.11 ---
[INFO] No sources to compile
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (dev-python) @ adam-python-spark2_2.11 ---
pip install -e .
Obtaining file:///Users/pbashyal/bioinformatics/adam/adam-python
Installing collected packages: bdgenomics.adam
  Found existing installation: bdgenomics.adam 0.23.0-SNAPSHOT
    Uninstalling bdgenomics.adam-0.23.0-SNAPSHOT:
      Successfully uninstalled bdgenomics.adam-0.23.0-SNAPSHOT
  Running setup.py develop for bdgenomics.adam
Successfully installed bdgenomics.adam
python2.7 setup.py bdist_egg
/Users/pbashyal/bioinformatics/adam/adam-python/venv/lib/python2.7/site-packages/setuptools/dist.py:350: UserWarning: The version specified ('0.23.0-SNAPSHOT') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running bdist_egg
running egg_info
writing src/bdgenomics.adam.egg-info/PKG-INFO
writing top-level names to src/bdgenomics.adam.egg-info/top_level.txt
writing dependency_links to src/bdgenomics.adam.egg-info/dependency_links.txt
reading manifest file 'src/bdgenomics.adam.egg-info/SOURCES.txt'
writing manifest file 'src/bdgenomics.adam.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.10-x86_64/egg
creating build/bdist.macosx-10.10-x86_64/egg/bdgenomics
copying build/lib/bdgenomics/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics
creating build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam
copying build/lib/bdgenomics/adam/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam
copying build/lib/bdgenomics/adam/adamContext.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam
copying build/lib/bdgenomics/adam/rdd.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam
copying build/lib/bdgenomics/adam/stringency.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam
creating build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
copying build/lib/bdgenomics/adam/test/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
copying build/lib/bdgenomics/adam/test/adamContext_test.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
copying build/lib/bdgenomics/adam/test/alignmentRecordRdd_test.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
copying build/lib/bdgenomics/adam/test/featureRdd_test.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
copying build/lib/bdgenomics/adam/test/genotypeRdd_test.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
copying build/lib/bdgenomics/adam/test/variantRdd_test.py -> build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/adamContext.py to adamContext.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/rdd.py to rdd.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/stringency.py to stringency.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test/adamContext_test.py to adamContext_test.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test/alignmentRecordRdd_test.py to alignmentRecordRdd_test.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test/featureRdd_test.py to featureRdd_test.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test/genotypeRdd_test.py to genotypeRdd_test.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/bdgenomics/adam/test/variantRdd_test.py to variantRdd_test.pyc
creating build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying src/bdgenomics.adam.egg-info/PKG-INFO -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying src/bdgenomics.adam.egg-info/SOURCES.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying src/bdgenomics.adam.egg-info/dependency_links.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying src/bdgenomics.adam.egg-info/top_level.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/bdgenomics.adam-0.23.0_SNAPSHOT-py2.7.egg' and adding 'build/bdist.macosx-10.10-x86_64/egg' to it
removing 'build/bdist.macosx-10.10-x86_64/egg' (and everything under it)
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ adam-python-spark2_2.11 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ adam-python-spark2_2.11 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/pbashyal/bioinformatics/adam/adam-python/src/test/resources
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:testCompile (scala-test-compile-first) @ adam-python-spark2_2.11 ---
[INFO] No sources to compile
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (test-python) @ adam-python-spark2_2.11 ---
mkdir -p target
python2.7 -m pytest -vv --junitxml target/pytest-reports/tests.xml src
============================= test session starts ==============================
platform darwin -- Python 2.7.13, pytest-2.8.3, py-1.4.34, pluggy-0.3.1 -- /Users/pbashyal/bioinformatics/adam/adam-python/venv/bin/python2.7
cachedir: .cache
rootdir: /Users/pbashyal/bioinformatics/adam/adam-python, inifile:
collecting ... collected 0 items / 5 errors

==================================== ERRORS ====================================
________ ERROR collecting src/bdgenomics/adam/test/adamContext_test.py _________
venv/lib/python2.7/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
src/bdgenomics/adam/test/__init__.py:26: in <module>
    from pyspark.context import SparkContext
E   ImportError: No module named pyspark.context
_____ ERROR collecting src/bdgenomics/adam/test/alignmentRecordRdd_test.py _____
venv/lib/python2.7/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
src/bdgenomics/adam/test/__init__.py:26: in <module>
    from pyspark.context import SparkContext
E   ImportError: No module named pyspark.context
_________ ERROR collecting src/bdgenomics/adam/test/featureRdd_test.py _________
venv/lib/python2.7/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
src/bdgenomics/adam/test/__init__.py:26: in <module>
    from pyspark.context import SparkContext
E   ImportError: No module named pyspark.context
________ ERROR collecting src/bdgenomics/adam/test/genotypeRdd_test.py _________
venv/lib/python2.7/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
src/bdgenomics/adam/test/__init__.py:26: in <module>
    from pyspark.context import SparkContext
E   ImportError: No module named pyspark.context
_________ ERROR collecting src/bdgenomics/adam/test/variantRdd_test.py _________
venv/lib/python2.7/site-packages/py/_path/local.py:662: in pyimport
    __import__(modname)
src/bdgenomics/adam/test/__init__.py:26: in <module>
    from pyspark.context import SparkContext
E   ImportError: No module named pyspark.context
 generated xml file: /Users/pbashyal/bioinformatics/adam/adam-python/target/pytest-reports/tests.xml
=========================== 5 error in 0.14 seconds ============================
make: *** [test] Error 1
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
	at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
	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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ADAM_2.11 .......................................... SUCCESS [  5.750 s]
[INFO] ADAM_2.11: Avro-to-Dataset codegen utils ........... SUCCESS [  5.178 s]
[INFO] ADAM_2.11: Core .................................... SUCCESS [01:31 min]
[INFO] ADAM_2.11: APIs for Java ........................... SUCCESS [ 13.297 s]
[INFO] ADAM_2.11: CLI ..................................... SUCCESS [ 20.225 s]
[INFO] ADAM_2.11: Assembly ................................ SUCCESS [ 10.394 s]
[INFO] ADAM_2.11: Python APIs ............................. FAILURE [  2.208 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:28 min
[INFO] Finished at: 2017-08-16T10:56:40-05:00
[INFO] Final Memory: 75M/313M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (test-python) on project adam-python-spark2_2.11: Command execution failed.: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :adam-python-spark2_2.11
@fnothaft

This comment has been minimized.

Member

fnothaft commented Aug 16, 2017

Hi @pbashyal-nmdp! Apologies if I missed it in the debug trace, but can you echo $SPARK_HOME and $PYTHONPATH?

@heuermh

This comment has been minimized.

Member

heuermh commented Aug 16, 2017

The docs here set up the environment variables

# add pyspark to the python path
PY4J_ZIP="$(ls -1 "${SPARK_HOME}/python/lib" | grep py4j)"
export PYTHONPATH=${SPARK_HOME}/python:${SPARK_HOME}/python/lib/${PY4J_ZIP}:${PYTHONPATH}

# put adam jar on the pyspark path
ASSEMBLY_DIR="${ADAM_HOME}/adam-assembly/target"
ASSEMBLY_JAR="$(ls -1 "$ASSEMBLY_DIR" | grep "^adam[0-9A-Za-z\.\_-]*\.jar$" | grep -v -e javadoc -e sources || true)"
export PYSPARK_SUBMIT_ARGS="--jars ${ASSEMBLY_DIR}/${ASSEMBLY_JAR} --driver-class-path ${ASSEMBLY_DIR}/${ASSEMBLY_JAR} pyspark-shell"
@pbashyal-nmdp

This comment has been minimized.

Contributor

pbashyal-nmdp commented Aug 16, 2017

Thanks @heuermh and @fnothaft . Missed the environment variables settings. I didn't have PYTHONPATH set.

I had to set ADAM_HOME as well.

@heuermh

This comment has been minimized.

Member

heuermh commented Jan 9, 2018

Closing as not an issue.

@heuermh heuermh closed this Jan 9, 2018

@heuermh heuermh moved this from Triage to Completed in Release 0.24.0 Jan 9, 2018

fnothaft added a commit that referenced this issue Jan 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment