Error during sbt execution: java.io.IOException: Permission denied

3,511 views
Skip to first unread message

tenaciousjzh

unread,
Sep 5, 2011, 11:05:38 PM9/5/11
to simple-build-tool
Hi!
I just downloaded sbt to try it out. I'm running on OS X Snow Leopard
with Java 1.6_26 and Scala 2.9.0.1. I've attempted to install sbt two
different ways with the same outcome.

The first was to follow the unix directions on the set up wiki page by
placing the latest version of the sbt-launch.jar in my ~/bin folder
and creating a shell script to launch it. After setting the
permissions on the script to be executable, I run the sbt command and
get the following output:

Macintosh-5:~ jared$ sbt
java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)
at xsbt.boot.Locks$.apply0(Locks.scala:34)
at xsbt.boot.Locks$.apply(Locks.scala:27)
at xsbt.boot.Update.apply(Pre.scala:78)
at xsbt.boot.Provider$initialize.call(Provider.scala:34)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:47)
at xsbt.boot.Locks$.apply0(Locks.scala:30)
at xsbt.boot.Locks$.apply(Locks.scala:27)
at scala.collection.Iterable$class.$init$(Proxy.scala:32)
at xsbt.boot.Launch$JNAProvider.<init>(Launch.scala:93)
at xsbt.boot.Launch.topLoader(Launch.scala:87)
at xsbt.boot.Launch$ScalaProvider.parentLoader(Launch.scala:110)
at xsbt.boot.Provider$initialize.createLoader(Provider.scala:57)
at xsbt.boot.Provider$initialize.call(Provider.scala:34)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:69)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock
$1.apply(Locks.scala:73)
at xsbt.boot.Using$.withResource(Using.scala:11)
at xsbt.boot.Using$.apply(Using.scala:10)
at xsbt.boot.Locks$GlobalLock.liftedTree1$1(Locks.scala:51)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:51)
at xsbt.boot.Locks$.apply0(Locks.scala:30)
at xsbt.boot.Locks$.apply(Locks.scala:27)
at scala.collection.Iterable$class.$init$(Proxy.scala:32)
at xsbt.boot.Launch$ScalaProvider.<init>(Launch.scala:107)
at xsbt.boot.Launch$$anonfun$1.apply(Launch.scala:83)
at
org.apache.ivy.plugins.namespace.NamespaceRule.newEntry(Cache.scala:
17)
at
org.apache.ivy.plugins.namespace.NamespaceRule.apply(Cache.scala:12)
at xsbt.boot.Launch.getScala(Launch.scala:85)
at xsbt.boot.Launch$.run(Launch.scala:49)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.IOException: Permission denied


I have attempted to change permissions to be writable in the directory
where I attempt to run sbt but that doesn't seem to make a difference.
I have also deleted the installation in ~/bin and installed sbt using
homebrew but got the same exception. I was wondering if you have run
into this before. If so, what can I do to get past this?

Thanks!
-Jared

Frédérick Dubois

unread,
Sep 6, 2011, 9:08:03 PM9/6/11
to simple-b...@googlegroups.com
Hi Jared,

I've never had this happen myself but I've got a couple of questions for you:

- where do you run the script from?
- can you please show us the content of your sbt script?

Thanks,

-Fred

> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>
>

tenaciousjzh

unread,
Sep 6, 2011, 11:22:13 PM9/6/11
to simple-build-tool
Hi Fred,
Thanks for getting back to me.
1. I'm running the script from ~/bin. I've exported bin from my path
so I can run it from anywhere on my filesystem.
2. Here are the contents of the script:

java -Xmx512M -jar `dirname $0`/sbt-launch.jar "$@"

And for additional detail, here is the listing from the ~/bin
directory:

Macintosh-5:bin jared$ ls -la
total 1856
drwxr-xr-x 5 jared jared 170 Sep 6 21:21 .
drwxr-xr-x+ 98 jared jared 3332 Sep 5 12:31 ..
-rw-r--r--@ 1 jared jared 6148 Sep 5 11:27 .DS_Store
-rwxr-xr-x@ 1 jared jared 51 Sep 5 11:28 sbt
-rw-r--r--@ 1 jared jared 937683 Sep 5 11:27 sbt-launch.jar


Thanks again for your help!
-Jared

Greg Price

unread,
Sep 7, 2011, 12:12:43 AM9/7/11
to simple-b...@googlegroups.com
Hi Jared,

It looks from the stack trace like the permissions issue is coming up
when trying to create a file to serve as a lock. Someone more familiar
with SBT internals may have an idea of where that file is already, but
you can find out for yourself directly with a command like this (I
think):

$ dtruss -f -t open sbt

(I don't actually have a Mac handy to test, which it sounds like
you're using; on Linux I'd do "strace -f -e open sbt".)

That should observe all the 'open' system calls SBT is making,
including the one that fails, which should tell you what you need to
fix the permissions on.

HTH,
Greg

Som Snytt

unread,
Sep 7, 2011, 12:43:45 AM9/7/11
to simple-b...@googlegroups.com

Quick guess, check your ~/.ivy2/.sbt.ivy.lock file.

On Tue, Sep 6, 2011 at 9:12 PM, Greg Price <gr...@quora.com> wrote:

It looks from the stack trace like the permissions issue is coming up
when trying to create a file to serve as a lock.

>>
Reply all
Reply to author
Forward
0 new messages