Re: Receiving OverlappingFileLockException after executing sbt at dos command prompt

835 views
Skip to first unread message
Message has been deleted

Francisco Carriedo

unread,
Sep 21, 2012, 2:05:36 PM9/21/12
to simple-b...@googlegroups.com
Yeah.

I'm on a work laptop with the HOME directory located on the network drive. I'm connected through VPN. Digging into this, this seems to be the problem as you mention.

I'll confirm once I get into my work's network.

Thanks!

On Thursday, September 20, 2012 10:52:48 PM UTC-7, Thomas Corbat wrote:
Hi

I've encountered the same problem yesterday. After failing to find a satisfying solution on the web, I tried solving the problem myself.
One thing I could observe was that sbt creates a hidden directory ".sbt" in my home directory. As I have been working with the notebook of my company at home, I did not have the connection my home drive, which is located on some server. It was available in offline mode though.
When I tried the same at work, with the connection to the corporate network, I had no problem executing sbt.

I the same works for you.

Regards
Thomas

On Thursday, August 30, 2012 11:55:54 PM UTC+2, mark dufresne wrote:
I'm receiving the following Exception:

C:\Users\GT907054>sbt
java.nio.channels.OverlappingFileLockException
        at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
        at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:65)
        at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:58)
        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:79)
        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 xsbt.boot.Update.apply(JavaConversions.scala:89)
        at xsbt.boot.Provider$initialize.call(Provider.scala:34)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:75)
        at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:58)
        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:79)
        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.mutable.FlatHashTable$class.$init$(Proxy.scala:32)
        at xsbt.boot.Launch$ScalaProvider$AppProvider.<init>(Launch.scala:130)
        at xsbt.boot.Launch$ScalaProvider.app(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:50)
        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:25)
        at xsbt.boot.Boot$.main(Boot.scala:15)
        at xsbt.boot.Boot.main(Boot.scala)
        at SbtJansiLaunch.main(SbtJansiLaunch.java:4)
Error during sbt execution: java.nio.channels.OverlappingFileLockException

Anyone have any idea why?

thanks so much

Fluffy

unread,
Sep 21, 2012, 2:37:24 PM9/21/12
to simple-b...@googlegroups.com
Depending on how you are running sbt, most scripts support a -sbt-dir flag that allows you to specify a different home directory for SBT.

If this is a windows machine (I assume), then you can use -Dsbt.boot.directory=/somewhere/local

I have a patch for the windows bat scripts that allows you to create a "config file" for SBT.  You'd be able to specify a non-home-directory for SBT in this, and then file locks should work.

It appears to be an issue with using real file locks on "offline" home directories....

Josh Suereth

unread,
Sep 22, 2012, 8:25:28 PM9/22/12
to simple-b...@googlegroups.com
Hey guys, I just duplicated this issue.  I'm looking for a solution.  I think it *may* be related to permissions n the BAT file on MSI install (or some other "you can't see these permissions easily" issues).   I'm investigating workarounds now that I can duplicate.

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/MnzdtKDxBFAJ.

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.

Mark Harrah

unread,
Sep 24, 2012, 6:35:24 AM9/24/12
to simple-b...@googlegroups.com
On Sat, 22 Sep 2012 20:25:28 -0400
Josh Suereth <joshua....@gmail.com> wrote:

> Hey guys, I just duplicated this issue. I'm looking for a solution. I
> think it *may* be related to permissions n the BAT file on MSI install (or
> some other "you can't see these permissions easily" issues). I'm
> investigating workarounds now that I can duplicate.

There is a property in the [boot] section of sbt.boot.properties:

lock: false

that disables using file locks. With that setting, it is important that only one instance of sbt is run at a time to avoid corruption.

-Mark
> >>>> java.nio.channels.**OverlappingFileLockException
> >>>> at sun.nio.ch.FileChannelImpl$**SharedFileLockTable.checkList(*
> >>>> *FileChannelImpl.java:1166)
> >>>> at sun.nio.ch.FileChannelImpl$**SharedFileLockTable.add(**
> >>>> FileChannelImpl.java:1068)
> >>>> at sun.nio.ch.FileChannelImpl.**tryLock(FileChannelImpl.java:**
> >>>> 868)
> >>>> at java.nio.channels.FileChannel.**
> >>>> tryLock(FileChannel.java:962)
> >>>> at xsbt.boot.Locks$GlobalLock.**withChannel$1(Locks.scala:65)
> >>>> at xsbt.boot.Locks$GlobalLock.**withChannelRetries$1(Locks.**
> >>>> scala:58)
> >>>> at xsbt.boot.Locks$GlobalLock$$**anonfun$withFileLock$1.apply(*
> >>>> *Locks.scala:79)
> >>>> 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 xsbt.boot.Update.apply(**JavaConversions.scala:89)
> >>>> at xsbt.boot.Provider$initialize.**call(Provider.scala:34)
> >>>> at xsbt.boot.Locks$GlobalLock.**withChannel$1(Locks.scala:75)
> >>>> at xsbt.boot.Locks$GlobalLock.**withChannelRetries$1(Locks.**
> >>>> scala:58)
> >>>> at xsbt.boot.Locks$GlobalLock$$**anonfun$withFileLock$1.apply(*
> >>>> *Locks.scala:79)
> >>>> 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.mutable.**FlatHashTable$class.$init$(**
> >>>> Proxy.scala:32)
> >>>> at xsbt.boot.Launch$**ScalaProvider$AppProvider.<**
> >>>> init>(Launch.scala:130)
> >>>> at xsbt.boot.Launch$**ScalaProvider.app(Launch.**scala:128)
> >>>> at xsbt.boot.Launch$.run(Launch.**scala:50)
> >>>> 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:25)
> >>>> at xsbt.boot.Boot$.main(Boot.**scala:15)
> >>>> at xsbt.boot.Boot.main(Boot.**scala)
> >>>> at SbtJansiLaunch.main(**SbtJansiLaunch.java:4)
> >>>> Error during sbt execution: java.nio.channels.**
> >>>> OverlappingFileLockException
Reply all
Reply to author
Forward
0 new messages