Giter VIP home page Giter VIP logo

Comments (16)

SethTisue avatar SethTisue commented on July 4, 2024 2

I'm aware this doesn't directly address your question, but fyi and for anyone else interested:

Everything sbt-related on repo.typesafe.com is ancient. Recent versions of things are on Maven Central. So I expect that using current sbt and current plugin versions would resolve any performance problems.

from sbt.

mkurz avatar mkurz commented on July 4, 2024 2

Play project maintainer I think creates hosts file entry such that repo.typesafe.com or repo.scala-sbt.org won't resolve on their own or CI machine.

yes that's right

I also blocked those repos locally on my machine.
Now trying an empty sbt project with sbt 1.2.7 results in:

[warn]  Note: Unresolved dependencies path:
[warn]          org.scala-sbt:sbt:1.2.7
[warn]            +- org.scala-sbt:global-plugins:0.0 (scalaVersion=2.12, sbtVersion=1.0)
[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.scala-sbt#sbt;1.2.7: Resolution failed several times for dependency: org.scala-sbt#sbt;1.2.7 {provided=[default(compile)]}:: 
[error]         typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.7/ivys/ivy.xml: java.net.ConnectException: Failed to connect to repo.typesafe.com/0:0:0:0:0:0:0:1:443
[error]         sbt-plugin-releases: unable to get resource for org.scala-sbt#sbt;1.2.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt/1.2.7/ivys/ivy.xml: java.net.ConnectException: Failed to connect to repo.scala-sbt.org/0:0:0:0:0:0:0:1:443
[error]         typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.7/jars/sbt.jar: java.net.ConnectException: Failed to connect to repo.typesafe.com/0:0:0:0:0:0:0:1:443

So sbt 1.2.7 is still hosted on the deprecated repo.
Seems only sbt 1.3.0 and newer are hosted on maven central (just tested and worked).

@pgoranss So you need to upgrade to at least sbt 1.3.0 to avoid those deprecated repos. However this is not the full story. If you use sbt-plugins in your project/plugins.sbt it's very likely they are outdated and also still hosted on repo.scala-sbt.org.
Lots of work was done to migrate the most popular plugins to maven central, so I recommend to upgrade to latest sbt sbt version and also all your sbt plugins to the latest available versions and then you should not hit those old repos anymore.

from sbt.

mkurz avatar mkurz commented on July 4, 2024 1

I am unsure how long it would take these to fully resolve

@jacobcrell

https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.12_1.0/ -> BAD
https://repo1.maven.org/maven2/ch/epfl/scala/sbt-bloop_2.12_1.0/1.5.11/ -> GOOD
https://repo1.maven.org/maven2/org/scalameta/sbt-scalafmt_2.12_1.0/2.4.6/ -> GOOD
https://repo1.maven.org/maven2/ch/epfl/scala/sbt-scalafix_2.12_1.0/0.10.0/ -> GOOD
https://repo1.maven.org/maven2/com/beautiful-scala/scalastyle_2.13/1.5.1/ -> GOOD
https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly_2.12_1.0/2.1.1/ -> GOOD
https://repo1.maven.org/maven2/com/mintbeans -> BAD
https://repo1.maven.org/maven2/com/github/sbt/sbt-native-packager_2.12_1.0/1.9.13/ -> GOOD
https://repo1.maven.org/maven2/com/github/cb372/sbt-explicit-dependencies_2.12_1.0/ -> BAD, but can upgraded to 0.3.1
https://repo1.maven.org/maven2/com/github/reibitto/sbt-test-shards_2.12_1.0/0.1.0/ -> GOOD

  • Your main task will be upgrading Play to latest 2.9.3 or 3.0.3 which is fully hosted on Maven central.
  • For sbt-ecr see sjednac/sbt-ecr#45
  • For sbt-explicit-dependencies see comment above.

from sbt.

jacobcrell avatar jacobcrell commented on July 4, 2024 1

Thank you @mkurz for the advice!

For those looking for a bridge fix here, we were able to copy the method of the Play maintainers to block the public sbt plugin URLs from resolving with

          sudo echo "127.0.0.1 repo.scala-sbt.org" | sudo tee -a /etc/hosts
          sudo echo "127.0.0.1 repo.typesafe.com" | sudo tee -a /etc/hosts

We are then fortunate enough to have our own Artifactory instance where we setup a remote repository pointed at https://scala.jfrog.io/artifactory/sbt-plugin-releases/. This remote repository only needs to be able to resolve the plugin jars once, and will then cache them indefinitely for our use.

We then added this remote repo to our meta-project by editing project/build.sbt (Note: This is the meta-build not the build.sbt at the root of the project) to add our remote artifactory repo lilke so

resolvers ++= Seq( Resolver.url("Artifactory-sbt-plugins", url("https://<MY_JFROG>/artifactory/<MY_REMOTE_REPO_NAME>"))
  (Resolver.ivyStylePatterns)
)

Obviously, upgrading to a modern version of everything is the proper thing to do, but this will serve as a hold over for now.

from sbt.

djcristi avatar djcristi commented on July 4, 2024

now the repo is down :/

from sbt.

SethTisue avatar SethTisue commented on July 4, 2024

@djcristi can you be maximally specific, please, about what evidence you're seeing of that?

from sbt.

pgoranss avatar pgoranss commented on July 4, 2024

Not down but we are noticing it's even slower today. We will certainly take the recommendation to upgrade SBT as a long term solution, but short term there must be someone to contact to at least report the issue?

In terms of evidence, just make a simple curl http request to scala.jfrog.io:

curl -L -o /dev/null -w "Total time: %{time_total}\n" https://scala.jfrog.io/

The response time for these http requests should be on a factor of # of milliseconds, not # of seconds. These requests occur 1000s of times during SBT Project load so it is really adds up to causing unusable build times the past couple days.

from sbt.

djcristi avatar djcristi commented on July 4, 2024

that?

when i wrote was giving 502 bad gateway. now it's back but very slow

from sbt.

eed3si9n avatar eed3si9n commented on July 4, 2024

I'll repeat what I wrote in #7523 (comment)

expectation

SBT 0.x works

While the current parties involved will likely try to resolve this issue, I should note that I EOLed sbt 0.13.x on November 30, 2018 while I was at Lightbend (https://web.archive.org/web/20210918065807/https://www.lightbend.com/blog/scala-sbt-127-patchnotes):

I would like to annouce the end of sbt 0.13 public support effective today

In other words, please adjust your expectation that at some point sbt 0.13 distribution might go away, and migrate to sbt 1.x.

https://scala.jfrog.io/ instance is granted by JFrog for free of charge, but I don't think anyone (especially commercial users) should rely on its existence now or into the future. If it's super slow or unreliable that's actually great, because hopefully we will recognize that it should be proxied via Artifactory on our own and that we should migrate off of it ASAP.

from sbt.

eed3si9n avatar eed3si9n commented on July 4, 2024

As for how to detect the slowness, Play project maintainer I think creates hosts file entry such that repo.typesafe.com or repo.scala-sbt.org won't resolve on their own or CI machine.

from sbt.

pgoranss avatar pgoranss commented on July 4, 2024

We are on sbt 1.2.7 so how is the EOL of sbt 0.13.x comment related to the scala.jfrog.io slowness issues?

It sounds like the problem is a general reliance on scala.jfrog.io so is this an artifact of being on sbt 1.2.7 rather than something more recent?

from sbt.

eed3si9n avatar eed3si9n commented on July 4, 2024

As far as I know, repo.typesafe.com is useful mostly for the purpose of hosting sbt 0.13 artifacts.
repo.scala-sbt.org hosts a bunch of plugins, which has mostly moved out to Maven Central in the recent years.

from sbt.

jacobcrell avatar jacobcrell commented on July 4, 2024

Seeing a similar issue in our CI environments. I am unsure how long it would take these to fully resolve because I am seeing our sbt process fail out before completing.

Quick facts

  • Github Actions
  • Scala 2.12.15
  • sbt 2.4.9
  • Java 17

plugins in plugins.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.9")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.11")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0")
addSbtPlugin("com.beautiful-scala" %% "sbt-scalastyle" % "1.5.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1")
addSbtPlugin("com.mintbeans" % "sbt-ecr" % "0.16.0")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.13")
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16")
addSbtPlugin("com.github.reibitto" % "sbt-test-shards" % "0.1.0")

example errors

[error] lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/docs/sbt-web-javadoc.jar: download error: Caught java.net.SocketException: Connection reset (Connection reset) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/docs/sbt-web-javadoc.jar
[error] 
[error] 	at lmcoursier.internal.shaded.coursier.Artifacts$.$anonfun$fetchArtifacts$9(Artifacts.scala:3[46](https://github.com/ActionIQ/aiq/actions/runs/9190897613/job/25277206182?pr=52445#step:8:47))
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.$anonfun$flatMap$extension$1(Task.scala:14)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.$anonfun$flatMap$extension$1$adapted(Task.scala:14)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.wrap(Task.scala:84)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.$anonfun$flatMap$2(Task.scala:14)
[error] 	at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
[error] 	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
[error] 	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] 	at java.base/java.lang.Thread.run(Thread.java:840)
[error] sbt.librarymanagement.ResolveException: Error downloading com.mintbeans:sbt-ecr;sbtVersion=1.0;scalaVersion=2.12:0.16.0
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/mintbeans/sbt-ecr_2.12_1.0/0.16.0/sbt-ecr-0.16.0.pom
[error]   not found: /home/runner/.ivy2/localcom.mintbeans/sbt-ecr/scala_2.12/sbt_1.0/0.16.0/ivys/ivy.xml
[error]   not found: https://actioniq.jfrog.io/artifactory/aiq-sbt-local/com/mintbeans/sbt-ecr_2.12_1.0/0.16.0/sbt-ecr-0.16.0.pom
[error]   download error: Caught java.io.IOException: Server returned HTTP response code: [50](https://github.com/ActionIQ/aiq/actions/runs/9190897613/job/25276848694?pr=52445#step:6:51)2 for URL: https://scala.jfrog.io/artifactory/sbt-plugin-releases/com.mintbeans/sbt-ecr/scala_2.12/sbt_1.0/0.16.0/ivys/ivy.xml (Server returned HTTP response code: 502 for URL: https://scala.jfrog.io/artifactory/sbt-plugin-releases/com.mintbeans/sbt-ecr/scala_2.12/sbt_1.0/0.16.0/ivys/ivy.xml) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.mintbeans/sbt-ecr/scala_2.12/sbt_1.0/0.16.0/ivys/ivy.xml
[error]   download error: Caught java.io.IOException: Server returned HTTP response code: 504 for URL: https://scala.jfrog.io/artifactory/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.9/ivys/ivy.xml (Server returned HTTP response code: 504 for URL: https://scala.jfrog.io/artifactory/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.9/ivys/ivy.xml) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.9/ivys/ivy.xml

from sbt.

kkeinanen avatar kkeinanen commented on July 4, 2024

Thanks @mkurz for pointers!

Do you know if these modules will be in Maven as well? We run sbt 2.10.0 and run into this 502/504 issue now with them.

sbtPluginExtra("com.typesafe.sbt" % "sbt-git" % "1.0.0", sbtV = "1.0", scalaV = "2.12"), sbtPluginExtra("com.lightbend.sbt" % "sbt-javaagent" % "0.1.5", sbtV = "1.0", scalaV = "2.12"),

not found: https://repo1.maven.org/maven2/com/lightbend/sbt/sbt-javaagent_2.12_1.0/0.1.5/sbt-javaagent-0.1.5.pom

not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-git_2.12_1.0/1.0.0/sbt-git-1.0.0.pom

from sbt.

mkurz avatar mkurz commented on July 4, 2024

@kkeinanen Google helps. These artifacts changed groupId.

https://github.com/sbt/sbt-git
https://repo1.maven.org/maven2/com/github/sbt/sbt-git_2.12_1.0/

https://github.com/sbt/sbt-javaagent
https://repo1.maven.org/maven2/com/github/sbt/sbt-javaagent_2.12_1.0/

from sbt.

mattyo161 avatar mattyo161 commented on July 4, 2024

Is it possible to set a timeout for the resolver getting a response from the repo? We are using a local proxy for our builds now but sbt is still querying the old repos now pointing to jfrog. We are able to avoid the issue using the -Dsbt.override.build.repos=true option however some of our builds have custom resolvers and those settings get ignored when we use that option.

Thanks

from sbt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.