Code Monkey home page Code Monkey logo

Comments (9)

jsuereth avatar jsuereth commented on July 30, 2024

Yeah. If something was touching files in the directory where we were zipping, that might happen....

Any ideas on what was going on the same time this task was running?

from sbt-native-packager.

jroper avatar jroper commented on July 30, 2024

As far as I'm aware, nothing.

from sbt-native-packager.

gmjabs avatar gmjabs commented on July 30, 2024

Maybe I'm doing something wrong, but I'm reliably having this problem when trying to use the universal packager in a subproject. Minimal repro has the following directory structure,

./foo
./foo/conf
./foo/conf/foo.conf
./project
./project/Build.scala
./project/plugins.sbt

with this Build.scala file:

import sbt._
import Keys._
import com.typesafe.sbt.SbtNativePackager
import com.typesafe.sbt.SbtNativePackager._

object Foo extends Build {

  val buildSettings = Defaults.defaultSettings ++ Seq (
    organization := "foo",
    scalaVersion := "2.10.2"
  )

  lazy val foo = Project(
    base = file("foo"),
    id = "foo",
    settings = buildSettings ++ 
      SbtNativePackager.packagerSettings ++
      Seq( mappings in Universal := Seq(file("conf/foo.conf") -> "conf/foo.conf")
    )
  )
}

running universal:packageBin in the subproject fails:

[eus-loaner-22] [02:17 PM] [sb] > sbt
[info] Loading global plugins from /Users/gregj/.sbt/0.13/plugins
[info] Loading project definition from /Users/gregj/scratch/sb/project
[info] Compiling 1 Scala source to /Users/gregj/scratch/sb/project/target/scala-2.10/sbt-0.13/classes...
[info] Set current project to sb (in build file:/Users/gregj/scratch/sb/)
> project foo
[info] Set current project to foo (in build file:/Users/gregj/scratch/sb/)
> universal:packageBin
[trace] Stack trace suppressed: run 'last foo/universal:packageBin' for the full output.
[error] (foo/universal:packageBin) java.io.IOException: This archives contains unclosed entries.
[error] Total time: 0 s, completed Nov 6, 2013 2:17:59 PM
> last foo/universal:packageBin
java.io.IOException: This archives contains unclosed entries.
        at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:413)
        at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:806)
        at com.typesafe.sbt.packager.universal.ZipHelper$.withZipOutput(ZipHelper.scala:107)
        at com.typesafe.sbt.packager.universal.ZipHelper$.archive(ZipHelper.scala:87)
        at com.typesafe.sbt.packager.universal.ZipHelper$.zip(ZipHelper.scala:53)
        at com.typesafe.sbt.packager.universal.Archives$.makeZip(Archives.scala:15)
        at com.typesafe.sbt.packager.universal.UniversalPlugin$$anonfun$com$typesafe$sbt$packager$universal$UniversalPlugin$$makePackageSettingsForConfig$1.apply(UniversalPlugin.scala:31)
        at com.typesafe.sbt.packager.universal.UniversalPlugin$$anonfun$com$typesafe$sbt$packager$universal$UniversalPlugin$$makePackageSettingsForConfig$1.apply(UniversalPlugin.scala:31)
        at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
        at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
        at sbt.std.Transform$$anon$4.work(System.scala:64)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
        at sbt.Execute.work(Execute.scala:244)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
[error] (foo/universal:packageBin) java.io.IOException: This archives contains unclosed entries.

from sbt-native-packager.

jsuereth avatar jsuereth commented on July 30, 2024

What OS are you using? I'll have to try it on something non-ubuntu....

from sbt-native-packager.

gmjabs avatar gmjabs commented on July 30, 2024

I'm on OSX 10.9
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

from sbt-native-packager.

dbarashev avatar dbarashev commented on July 30, 2024

FWIW, I suffered from the same problem with "This archives contains unclosed entries." when running play dist. It turned out that it happened because of broken symlink in my dist directory.

from sbt-native-packager.

gmjabs avatar gmjabs commented on July 30, 2024

I eventually figured this out, that the mappings aren't being resolved against the base directory of the subproject, rather against the base directory of the containing project, so where

Seq( mappings in Universal := Seq(file("conf/foo.conf") -> "conf/foo.conf")

was generating this error,

Seq( mappings in Universal := Seq(baseDirectory.value / "conf/foo.conf" -> "conf/foo.conf")

works. Seems in general that the packager errors out this way if the mapped input file doesn't exist. Which is logical, but the failure isn't informative of that.

from sbt-native-packager.

jsuereth avatar jsuereth commented on July 30, 2024

Wow, great find! Ill see if I can improve the erroring there.

from sbt-native-packager.

muuki88 avatar muuki88 commented on July 30, 2024

Closing this one as resolved with #83

from sbt-native-packager.

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.