Skip to content
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

Dependency conflict between guava versions of spark and google storage api #4414

Closed
lanastazia opened this issue Jan 28, 2019 · 6 comments
Closed
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: question Request for information or clarification. Not an issue.

Comments

@lanastazia
Copy link

Hello,

I’m deploying a Spark application, that has a dependency on the google storage java client, to list files in the bucket, and treat them one after another with Spark.

It seems that adding this dependency along with Spark causes a conflict with guava, and all my attempts to exclude certain guava (like here https://stackoverflow.com/questions/44935550/gae-cloud-storage-guava-nosuchmethoderror-on-appspot), try different guava versions and spark versions don’t succeed.

The error is only triggered in “assembly” mode (required to run the spark application on Dataproc), not when the application is run in local.

Do you know if there is a way to make these two libraries compatible?

Here is an example to reproduce this error https://github.com/lanastazia/spark-guava-issue

Here is the whole trace of this error :

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
	at com.google.api.gax.retrying.BasicRetryingFuture.<init>(BasicRetryingFuture.java:82)
	at com.google.api.gax.retrying.DirectRetryingExecutor.createFuture(DirectRetryingExecutor.java:88)
	at com.google.api.gax.retrying.DirectRetryingExecutor.createFuture(DirectRetryingExecutor.java:74)
	at com.google.cloud.RetryHelper.run(RetryHelper.java:75)
	at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
	at com.google.cloud.storage.StorageImpl.listBlobs(StorageImpl.java:334)
	at com.google.cloud.storage.StorageImpl.list(StorageImpl.java:290)
	at Main$.main(Main.scala:20)
	at Main.main(Main.scala)
	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.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
	at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
	at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
	at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

Thanks !

@ajaaym
Copy link
Contributor

ajaaym commented Jan 28, 2019

@lanastazia did you try excluding the older version of Guava?

@kolea2 kolea2 added type: question Request for information or clarification. Not an issue. api: storage Issues related to the Cloud Storage API. labels Jan 28, 2019
@lanastazia
Copy link
Author

lanastazia commented Jan 28, 2019

@ajaaym yes, I tried to exclude the older version of Guava evicted by the latest one, but it doesn't work.

@ajaaym
Copy link
Contributor

ajaaym commented Jan 29, 2019

@lanastazia please add spark.executor.userClassPathFirst=true and spark.driver.userClassPathFirst=true in properties as below.

image

@lanastazia
Copy link
Author

It works, thanks a lot !

@ajaaym
Copy link
Contributor

ajaaym commented Feb 1, 2019

@elharo @saturnism FYI, another diamond dependency related to guava.

@ejona86
Copy link

ejona86 commented Apr 17, 2019

@ajaaym, I don't think this very related to Guava. I think I root-caused this in grpc/grpc-java#5592 (comment) . I think that Guava is just what failed first. I believe Protobuf also would have failed.

This is not the standard diamond dependency issue, either. It relates to class loaders, not package managers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants