How to fix sbt reporting "Error wrapping InputStream in GZIPInputStream: java.io.EOFException"?

Solution 1:

It appears that the exception has been due to some problems with the local repo. After cleanup, e.g. removing target directories from ~/.sbt directory it's now working fine.

jacek:~/.sbt
$ find . -name target | xargs rm -rf

jacek:~/sandbox/stackoverflow/testaaa
$ sbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Updating {file:/Users/jacek/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to testaaa (in build file:/Users/jacek/sandbox/stackoverflow/testaaa/)
[testaaa]>

I found the solution in the thread [2.1.1] SBT: InputStream in GZIPInputStream: java.io.EOFException in the play-framework forum.


I was also told that the issue goes away after removing all target directories in the project's home directory, e.g. target, project/target.

jacek:my-project-path
$ find . -name target | xargs rm -rf

Solution 2:

go to the project directory

$ cd my-spark-app
$ rm -rf target
$ cd project 
$ rm -rf target project

now start sbt

$sbt 

Solution 3:

You could run sbt clean on your directory (to remove the target and any files in /src that might have been created earlier) and now try running sbt. Had this issue when trying to create an Akka HTTP seed project by running sbt -Dsbt.version=0.13.15 new https://github.com/akka/akka-http-scala-seed.g8. My mistake was that I was not inside an empty directory while running the command. More info about the error can be found here