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

[2.6.5] Eviction warnings appeared after update from 2.6.3 #7832

Closed
PromanSEW opened this issue Sep 15, 2017 · 13 comments
Closed

[2.6.5] Eviction warnings appeared after update from 2.6.3 #7832

PromanSEW opened this issue Sep 15, 2017 · 13 comments

Comments

@PromanSEW
Copy link
Contributor

PromanSEW commented Sep 15, 2017

Play Version (2.5.x / etc)

2.6.5

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

macOS 10.12.6

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Upgrade changes

// project/plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.5") // was 2.6.3
// project/build.properties
sbt.version=0.13.16 // was 0.13.15

Behavior after upgrade

I see these warnings in IntelliJ IDEA console every time while loading the project

[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn] 
[warn] 	* com.google.guava:guava:22.0 is selected over {15.0, 19.0, 20.0}
[warn] 	    +- com.typesafe.play:play_2.12:2.6.5                  (depends on 22.0)
[warn] 	    +- org.reflections:reflections:0.9.11                 (depends on 20.0)
[warn] 	    +- com.google.inject:guice:4.1.0                      (depends on 19.0)
[warn] 	    +- com.jolbox:bonecp:0.8.0.RELEASE                    (depends on 15.0)
[warn] 
[warn] 	* com.typesafe.akka:akka-stream_2.12:2.5.4 is selected over 2.4.19
[warn] 	    +- com.typesafe.play:play-streams_2.12:2.6.5          (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-http-core_2.12:10.0.10      (depends on 2.4.19)
[warn] 
[warn] 	* com.typesafe.akka:akka-actor_2.12:2.5.4 is selected over 2.4.19
[warn] 	    +- com.typesafe.akka:akka-slf4j_2.12:2.5.4            (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-stream_2.12:2.5.4           (depends on 2.5.4)
[warn] 	    +- com.typesafe.play:play_2.12:2.6.5                  (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-parsing_2.12:10.0.10        (depends on 2.4.19)
[warn] 
[warn] 	* org.slf4j:slf4j-api:1.7.25 is selected over {1.5.10, 1.7.2, 1.7.23, [1.7,1.8), 1.7.12}
[warn] 	    +- com.zaxxer:HikariCP:2.7.1                          (depends on 1.7.25)
[warn] 	    +- ch.qos.logback:logback-classic:1.2.3               (depends on 1.7.25)
[warn] 	    +- org.slf4j:jul-to-slf4j:1.7.25                      (depends on 1.7.25)
[warn] 	    +- com.typesafe.play:play_2.12:2.6.5                  (depends on 1.7.25)
[warn] 	    +- com.typesafe.play:play-netty-utils:2.6.5           (depends on 1.7.25)
[warn] 	    +- org.slf4j:jcl-over-slf4j:1.7.25                    (depends on 1.7.25)
[warn] 	    +- org.avaje:avaje-datasource-api:1.1                 (depends on 1.7.12)
[warn] 	    +- io.ebean:ebean:10.3.1                              (depends on 1.7.12)
[warn] 	    +- org.avaje:avaje-classpath-scanner:2.2.2            (depends on [1.7,1.8))
[warn] 	    +- com.typesafe.akka:akka-slf4j_2.12:2.5.4            (depends on 1.7.23)
[warn] 	    +- com.jolbox:bonecp:0.8.0.RELEASE                    (depends on 1.7.2)
[warn] 	    +- com.googlecode.usc:jdbcdslog:1.0.6.2               (depends on 1.5.10)
[warn] 
[warn] Run 'evicted' to see detailed eviction warnings

How to disable these annoyning lines from console output?
Do you have to fix them yourself in Play dependencies?

Temporary fix

#7832 (comment)

@marcospereira
Copy link
Member

Hi @PromanSEW,

This is how sbt shows evictions now:

http://developers.lightbend.com/blog/2017-06-15-sbt-1-0-beta2/index.html#eviction-warning-presentation

These warnings were presented before too, but with a different (and more compact) format. You can change the log level to log only error messages if you want. Just add the following configuration:

logLevel := Level.Error

We don't plan to manually exclude the transitive dependencies, but you can submit a PR.

@PromanSEW
Copy link
Contributor Author

PromanSEW commented Sep 15, 2017

@marcospereira Thanks.
I have already found needed option and set

evictionWarningOptions in update := EvictionWarningOptions.default
  .withWarnTransitiveEvictions(false)
  .withWarnDirectEvictions(false)

I found this option here: sbt/sbt#1636 (comment)

And about excluding: I think Akka dependencies should be fixed at least.
WDYT?

@agebhar1
Copy link

agebhar1 commented Oct 4, 2017

Eviction warnings for Akka

[warn] 	* com.typesafe.akka:akka-stream_2.12:2.5.4 is selected over 2.4.19
[warn] 	    +- com.typesafe.play:play-streams_2.12:2.6.5          (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-http-core_2.12:10.0.10      (depends on 2.4.19)
[warn] 
[warn] 	* com.typesafe.akka:akka-actor_2.12:2.5.4 is selected over 2.4.19
[warn] 	    +- com.typesafe.akka:akka-slf4j_2.12:2.5.4            (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-stream_2.12:2.5.4           (depends on 2.5.4)
[warn] 	    +- com.typesafe.play:play_2.12:2.6.5                  (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-parsing_2.12:10.0.10        (depends on 2.4.19)

should be resolved by following Akka's compatibility guideline »Akka HTTP 10.0.x with Akka 2.5.x« as mentioned at akka/akka-http/issues/1452.

@hayd
Copy link

hayd commented Oct 7, 2017

@agebhar1 perhaps I am missing something but inserting the suggested to build.sbt e.g. in the scala starter example seems to make the eviction warning even worse:

[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]
[warn] 	* com.typesafe.akka:akka-stream_2.12:2.5.4 is selected over 2.4.19
[warn] 	    +- play-scala-starter-example:play-scala-starter-example_2.12:1.0-SNAPSHOT (depends on 2.5.4)
[warn] 	    +- com.typesafe.play:play-streams_2.12:2.6.6          (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-http-core_2.12:10.0.10      (depends on 2.4.19)
[warn]
[warn] 	* com.typesafe.akka:akka-actor_2.12:2.5.4 is selected over 2.4.19
[warn] 	    +- play-scala-starter-example:play-scala-starter-example_2.12:1.0-SNAPSHOT (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-slf4j_2.12:2.5.4            (depends on 2.5.4)
[warn] 	    +- com.typesafe.play:play_2.12:2.6.6                  (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-stream_2.12:2.5.4           (depends on 2.5.4)
[warn] 	    +- com.typesafe.akka:akka-parsing_2.12:10.0.10        (depends on 2.4.19)
[warn]
[warn] 	* com.google.guava:guava:22.0 is selected over 19.0
[warn] 	    +- com.typesafe.play:play_2.12:2.6.6                  (depends on 22.0)
[warn] 	    +- com.google.inject:guice:4.1.0                      (depends on 19.0)
[warn]
[warn] Run 'evicted' to see detailed eviction warnings

@almothafar
Copy link
Contributor

almothafar commented Oct 8, 2017

With sbt 0.13.15 no warnings shown, with sbt 0.13.16 and 1.0.2 getting this:

[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * com.google.code.findbugs:jsr305:3.0.0 is selected over 1.3.9
[warn]      +- com.google.api:api-common:1.1.0                    (depends on 3.0.0)
[warn]      +- com.google.api:gax:1.4.1                           (depends on 3.0.0)
[warn]      +- com.google.http-client:google-http-client:1.22.0   (depends on 1.3.9)
[warn]      +- com.google.guava:guava:22.0                        (depends on 1.3.9)
[warn]      +- com.google.oauth-client:google-oauth-client:1.22.0 (depends on 1.3.9)
[warn]  * com.google.guava:guava:22.0 is selected over {19.0, 20.0}
[warn]      +- com.typesafe.play:play_2.12:2.6.6                  (depends on 22.0)
[warn]      +- com.google.cloud:google-cloud-core:1.2.1           (depends on 20.0)
[warn]      +- com.google.cloud:google-cloud-core-http:1.2.1      (depends on 20.0)
[warn]      +- org.reflections:reflections:0.9.11                 (depends on 20.0)
[warn]      +- com.google.protobuf:protobuf-java-util:3.3.0       (depends on 20.0)
[warn]      +- com.google.api:gax:1.4.1                           (depends on 20.0)
[warn]      +- com.google.firebase:firebase-admin:5.3.1           (depends on 20.0)
[warn]      +- com.google.api:api-common:1.1.0                    (depends on 19.0)
[warn]      +- com.google.inject:guice:4.1.0                      (depends on 19.0)
[warn]      +- com.google.auth:google-auth-library-oauth2-http:0.7.0 (depends on 19.0)
[warn]  * com.typesafe.akka:akka-stream_2.12:2.5.4 is selected over {2.5.3, 2.4.19}
[warn]      +- com.typesafe.play:play-streams_2.12:2.6.6          (depends on 2.5.4)
[warn]      +- com.typesafe.akka:akka-http-core_2.12:10.0.10      (depends on 2.4.19)
[warn]      +- com.typesafe.play:play-ws-standalone_2.12:1.1.2    (depends on 2.5.3)
[warn]  * com.typesafe.akka:akka-actor_2.12:2.5.4 is selected over 2.4.19
[warn]      +- com.typesafe.akka:akka-slf4j_2.12:2.5.4            (depends on 2.5.4)
[warn]      +- com.typesafe.play:play_2.12:2.6.6                  (depends on 2.5.4)
[warn]      +- com.typesafe.akka:akka-stream_2.12:2.5.4           (depends on 2.5.4)
[warn]      +- com.typesafe.akka:akka-parsing_2.12:10.0.10        (depends on 2.4.19)
[warn] Run 'evicted' to see detailed eviction warnings

Using play 2.6.6 no plugins and this is my build:

lazy val root = (project in file(".")).enablePlugins(PlayJava)

scalaVersion := "2.12.3"

libraryDependencies ++= Seq(
  guice,
  javaWs,
  filters,
  "org.apache.commons" % "commons-text" % "1.1",
  "com.typesafe.play" %% "play-json" % "2.6.6",
  "com.typesafe.play" %% "play-ahc-ws-standalone" % "1.1.2",
  "com.typesafe.play" %% "play-ws-standalone-json" % "1.1.2",
  "com.typesafe.play" %% "play-mailer" % "6.0.1",
  "com.typesafe.play" %% "play-mailer-guice" % "6.0.1",
  "com.google.firebase" % "firebase-admin" % "5.3.1",
  "com.auth0" % "java-jwt" % "3.2.0"
)

added the following line in build.sbt removed the warnings:

evictionWarningOptions in update := EvictionWarningOptions.default.withWarnTransitiveEvictions(false)

But I'm getting this INFO too, what does it mean?

[INFO] [10/08/2017 10:37:28.770] [Thread-2] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook

@agebhar1
Copy link

agebhar1 commented Oct 8, 2017

@hayd you didn't miss something. I was to optimistic about Akka's compatibility guideline »Akka HTTP 10.0.x with Akka 2.5.x«.

The warning from sbt regarding to »akka-actor« and »akka-stream« is okay since

Akka HTTP 10.0.x is (binary) compatible with both Akka 2.4.x as well as Akka 2.5.x, however in order to facilitate this the build (and thus released artifacts) depend on the 2.4 series.

To not disable all eviction warnings you can override a version by

dependencyOverrides ++= Set(
  "com.typesafe.akka" %% "akka-stream" % "2.5.4",
  "com.typesafe.akka" %% "akka-actor" % "2.5.4"
)

The warning from guava's eviction should be taken seriously since guice depends on 19.0 which is not binary (source) compatible with 22.0 per se.

guava-19vs22

@almothafar
Copy link
Contributor

@hayd what is the problem with my comment to thumb down?

@hayd
Copy link

hayd commented Oct 8, 2017

@almothafar your post is 1. essentially the same error as first message (and withWarnTransitiveEvictions(false) is known workaround*), 2. CoordinatedShutdown is different issue to evictions, though actually I think that is expected output now.
Hence the 👎 , but please don't take offense to it.

*imo workaround not solution

@almothafar
Copy link
Contributor

@hayd did not take it as offense, I just was wonder why is this 😄
I posted it as support for the issue, follow up, just more details, and not said it is a solution either a workaround, it is just a confirm for what @PromanSEW posted.

Anyways, I'm looking for solution for this, for now removing warnings helpful for me as a temp solution so DevOps do not get confused :)

@PromanSEW
Copy link
Contributor Author

PromanSEW commented Oct 12, 2017

Here are final settings for my project to resolve all eviction warnings.
Add to build.sbt:

// https://github.com/playframework/playframework/blob/2.6.x/framework/project/Dependencies.scala#L11
val akkaVersion = "2.5.6"
dependencyOverrides ++= Set( // Seq for SBT 1.0.x
  "com.typesafe.akka" %% "akka-actor" % akkaVersion,
  "com.typesafe.akka" %% "akka-stream" % akkaVersion,
  "com.google.guava" % "guava" % "22.0",
  "org.slf4j" % "slf4j-api" % "1.7.25"
)

Thanks @agebhar1 a lot!

@backboardo2
Copy link

@PromanSEW @agebhar1 Hi guys. Thank you. Props.

++= Set( would not compile using sbt run BUT maybe because I'm using sbt version 1.0.2
used ++= Seq( and now dependency warnings are re mediated properly, mostly. So all good for now.

@PromanSEW
Copy link
Contributor Author

@backboardo2 I added a note about Set, thanks

@agebhar1
Copy link

Thank you both @PromanSEW and @backboardo2 for your feedback 😃

octonato pushed a commit to lagom/lagom that referenced this issue Jun 25, 2018
## Purpose

Lagom already has a whitelist which dependencies are added, so the evictions warnings are just adding noise to the build.

## References

1. playframework/playframework#7832
2. sbt/sbt#1636
octonato pushed a commit to lagom/lagom that referenced this issue Jun 25, 2018
## Purpose

Lagom already has a whitelist which dependencies are added, so the evictions warnings are just adding noise to the build.

## References

1. playframework/playframework#7832
2. sbt/sbt#1636
denis554 added a commit to denis554/lagom that referenced this issue Apr 9, 2019
## Purpose

Lagom already has a whitelist which dependencies are added, so the evictions warnings are just adding noise to the build.

## References

1. playframework/playframework#7832
2. sbt/sbt#1636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants