Cmak: Failing download on "sbt clean dist"

Created on 9 Aug 2018  路  2Comments  路  Source: yahoo/CMAK

Hi,

I've been trying to install kafka-manager on a docker machine with a minimal ubuntu image (https://github.com/phusion/baseimage-docker)

I've installed the oracle-java8-installer with it, set the JAVA_HOME variable, installed sbt on that image with the following commands:

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install -y sbt=0.13.9

and I'm running sbt like this:

PATH=$JAVA_HOME/bin:$PATH JAVA_HOME=$JAVA_HOME sbt -java-home $JAVA_HOME -batch clean dist

However I'm always getting the following error, when sbt is trying to download the dependencies:

...
[info]  [SUCCESSFUL ] org.eclipse.sisu#org.eclipse.sisu.plexus;0.3.0!org.eclipse.sisu.plexus.jar(eclipse-plugin) (279ms)
[warn]  [NOT FOUND  ] org.codehaus.plexus#plexus-utils;3.0.20!plexus-utils.jar (0ms)
[warn] ==== jcenter: tried
[warn]   https://jcenter.bintray.com/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[info] downloading https://jcenter.bintray.com/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[info]  [SUCCESSFUL ] javax.enterprise#cdi-api;1.0!cdi-api.jar (233ms)
...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.codehaus.plexus#plexus-utils;3.0.20!plexus-utils.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: download failed: org.codehaus.plexus#plexus-utils;3.0.20!plexus-utils.jar
        at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:294)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
        at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
        at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
        at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
        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:65)
        at sbt.IvySbt.withIvy(Ivy.scala:127)
        at sbt.IvySbt.withIvy(Ivy.scala:124)
        at sbt.IvySbt$Module.withModule(Ivy.scala:155)
        at sbt.IvyActions$.updateEither(IvyActions.scala:168)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1392)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1388)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1422)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1420)
        at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1425)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1419)
        at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
        at sbt.Classpaths$.cachedUpdate(Defaults.scala:1442)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1371)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1325)
        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:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
[error] (*:update) sbt.ResolveException: download failed: org.codehaus.plexus#plexus-utils;3.0.20!plexus-utils.jar
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? The command '/bin/sh -c PATH=$JAVA_HOME/bin:$PATH JAVA_HOME=$JAVA_HOME sbt -java-home $JAVA_HOME -batch clean dist' returned a non-zero code: 1

If I try to download https://jcenter.bintray.com/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar from a browser it works fine

Can someone advice?

Most helpful comment

Oh cool! Either way I think I will close this, the problem that I was having was to due to the dependencies download connection being flaky for some reason, I've used a retry mechanism to try download again:

...
ENV KAFKA_MANAGER_DIST_FILE=$KAFKA_MANAGER_SRC_DIR/target/universal/kafka-manager-$KAFKA_MANAGER_VERSION.zip
...
RUN ( ./sbt clean dist ; exit 0) # even though it fails, if we return the exit code 0 we can try to proceed again
RUN (ls $KAFKA_MANAGER_DIST_FILE && exit 0) || ( ./sbt clean dist ; exit 0) # as the result of of sbt build is a file, I'm just checking if it exists, it does proceed as normal, or else try to build again
RUN (ls $KAFKA_MANAGER_DIST_FILE && exit 0) || ( ./sbt clean dist ; exit 0)
...

All 2 comments

Hi, this guy has done this already here -> https://hub.docker.com/r/hlebalbau/kafka-manager/

Oh cool! Either way I think I will close this, the problem that I was having was to due to the dependencies download connection being flaky for some reason, I've used a retry mechanism to try download again:

...
ENV KAFKA_MANAGER_DIST_FILE=$KAFKA_MANAGER_SRC_DIR/target/universal/kafka-manager-$KAFKA_MANAGER_VERSION.zip
...
RUN ( ./sbt clean dist ; exit 0) # even though it fails, if we return the exit code 0 we can try to proceed again
RUN (ls $KAFKA_MANAGER_DIST_FILE && exit 0) || ( ./sbt clean dist ; exit 0) # as the result of of sbt build is a file, I'm just checking if it exists, it does proceed as normal, or else try to build again
RUN (ls $KAFKA_MANAGER_DIST_FILE && exit 0) || ( ./sbt clean dist ; exit 0)
...
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rudrasharma picture rudrasharma  路  6Comments

tanuj83 picture tanuj83  路  5Comments

isharakaru picture isharakaru  路  3Comments

josephfrancis picture josephfrancis  路  5Comments

Angryrou picture Angryrou  路  4Comments