question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SBT does not work behind proxy java.util.NoSuchElementException

See original GitHub issue

So when I’m not behind a proxy sbt works fine, not matter what combination of proxy settings I use for SBT_OPTS or http_proxy I cannot get sbt to work. I think this is the case for basic authentication, ntlm and kerberos proxies. I can get brew, curl and wget to work behind proxies, and my collegues can get maven to work behind the proxies. I’ve reached the conclusion that the proxy support for sbt is lacking. Please put in better proxy support to sbt.

Here is one of the kind of problems I get (I also see messages like “credentials not found” and “you are behind a poorly configured proxy”).

[warn]  [FAILED     ] org.scalaz#scalaz-core_2.11;7.1.0!scalaz-core_2.11.jar(bundle): java.util.NoSuchElementException (74ms)
[warn]  [FAILED     ] org.scalaz#scalaz-core_2.11;7.1.0!scalaz-core_2.11.jar(bundle): java.util.NoSuchElementException (58ms)
[warn]  [FAILED     ] org.scalaz#scalaz-core_2.11;7.1.0!scalaz-core_2.11.jar(bundle):  (0ms)
[warn] ==== local: tried
[warn]   /Users/g04508966/.ivy2/local/org.scalaz/scalaz-core_2.11/7.1.0/bundles/scalaz-core_2.11.jar
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalaz/scalaz-core_2.11/7.1.0/scalaz-core_2.11-7.1.0.jar
[warn] ==== mvnrepository: tried
[warn]   https://repository.cloudera.com/artifactory/cloudera-repos/org/scalaz/scalaz-core_2.11/7.1.0/scalaz-core_2.11-7.1.0.jar
[warn] ==== spray repo: tried
[warn]   http://repo.spray.io/org/scalaz/scalaz-core_2.11/7.1.0/scalaz-core_2.11-7.1.0.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalaz#scalaz-core_2.11;7.0.5: java.util.NoSuchElementException
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalaz#scalaz-core_2.11;7.1.0!scalaz-core_2.11.jar(bundle)
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.scalaz:scalaz-core_2.11:7.0.5 (.../assembly.sbt#L21-59)
[warn]        +- io.openmaths:openmaths_2.11:0.1.0
sbt.ResolveException: unresolved dependency: org.scalaz#scalaz-core_2.11;7.0.5: java.util.NoSuchElementException
download failed: org.scalaz#scalaz-core_2.11;7.1.0!scalaz-core_2.11.jar(bundle)
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:243)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:158)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:156)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:147)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:147)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:124)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:56)
    at sbt.IvySbt$$anon$3.call(Ivy.scala:64)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:64)
    at sbt.IvySbt.withIvy(Ivy.scala:119)
    at sbt.IvySbt.withIvy(Ivy.scala:116)
    at sbt.IvySbt$Module.withModule(Ivy.scala:147)
    at sbt.IvyActions$.updateEither(IvyActions.scala:156)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1282)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1279)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$84.apply(Defaults.scala:1309)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$84.apply(Defaults.scala:1307)
    at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1312)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1306)
    at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:1324)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1264)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1242)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scalaz#scalaz-core_2.11;7.0.5: java.util.NoSuchElementException

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wendersonferreiracommented, Jun 16, 2017

Try this

in my ubuntu change ~/.profile at end of file

export SBT_OPTS=“$SBT_OPTS -Dhttp.proxyHost=host -Dhttp.proxyPort=port -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -Dhttps.proxyHost=host -Dhttps.proxyPort=port -Dhttps.proxyUser=username -Dhttps.proxyPassword=password”

enjoy it

0reactions
Nimi42commented, May 29, 2018

Did anything solve the problem. I’m having similar problems. I can get pip and conda to work, but -Dhttp.proxyHost=host -Dhttp.proxyPort=port -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -Dhttps.proxyHost=host -Dhttps.proxyPort=port -Dhttps.proxyUser=username -Dhttps.proxyPassword=password don’t fix the problem for sbt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

using SBT for first time - issue retrieving dependencies behind ...
Initially, I had proxy issues that I fixed when I found I needed to specify only the https config, and not the http...
Read more >
sbt/sbt - Gitter
I created a custom repositories file to use local nexus to pull project dependencies but now I can't seem to fetch the sbt...
Read more >
Using the project template - Kalix Documentation
A Maven archetype giter8 template that generates the recommended project structure, a simple Counter service containing a Value Entity, and unit tests.
Read more >
Problem with proxy settings for SBT - Cloudera Community
I am trying to use Scala/Spark from IntelliJ in Windows 7, but it IntelliJ (and SBT command line) fails to download files. I...
Read more >
intro to Scala 3 macros - eed3si9n
While it's true, it might not immediately make sense since Scala ... scala> assert(person.say(word1, word2) == "pong pong") java.lang.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found