gnieh / bluelatex

A collaborative Latex Editor written in Scala and AngularJS
http://www.bluelatex.org
Apache License 2.0
81 stars 18 forks source link

couchdb in testing mode #239

Open monperrus opened 9 years ago

monperrus commented 9 years ago

This first time I use sbt, I get the following exception. It's raised in gnieh.sohva.testing.CouchInstance.

The second time and later, the exception disappears.

How and when is the testing mode recognized? Is it only for Travis?

java.io.IOException: Cannot run program "couchdb" (in directory "/tmp/bluelatex/target/couchdb"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
    at gnieh.sohva.testing.CouchInstance.start(CouchInstance.scala:106)
    at blue.Server$$anonfun$blueStartTask$1$$anonfun$apply$9.apply(Server.scala:112)
    at blue.Server$$anonfun$blueStartTask$1$$anonfun$apply$9.apply(Server.scala:112)
    at scala.Option.foreach(Option.scala:236)
    at blue.Server$$anonfun$blueStartTask$1.apply(Server.scala:112)
    at blue.Server$$anonfun$blueStartTask$1.apply(Server.scala:110)
    at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
    at scala.Function7$$anonfun$tupled$1.apply(Function7.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:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
    at gnieh.sohva.testing.CouchInstance.start(CouchInstance.scala:106)
    at blue.Server$$anonfun$blueStartTask$1$$anonfun$apply$9.apply(Server.scala:112)
    at blue.Server$$anonfun$blueStartTask$1$$anonfun$apply$9.apply(Server.scala:112)
    at scala.Option.foreach(Option.scala:236)
    at blue.Server$$anonfun$blueStartTask$1.apply(Server.scala:112)
    at blue.Server$$anonfun$blueStartTask$1.apply(Server.scala:110)
    at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
    at scala.Function7$$anonfun$tupled$1.apply(Function7.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:745)
[error] (bluelatex/*:blueStart) java.io.IOException: Cannot run program "couchdb" (in directory "/tmp/bluelatex/target/couchdb"): error=2, No such file or directory
satabin commented 9 years ago

If you have a couchdb instance running locally, you can create a build.sbt file containing the following lines to override the default http://www.bluelatex.org/developers/#customize-your-building-environment

monperrus commented 9 years ago

why does the default couchdb fail with this exception?

On 06/04/2015 01:59 PM, Lucas Satabin wrote:

If you have a couchdb instance running locally, you can create a build.sbt file containing the following lines to override the default http://www.bluelatex.org/developers/#customize-your-building-environment

— Reply to this email directly or view it on GitHub https://github.com/gnieh/bluelatex/issues/239#issuecomment-108860000.

satabin commented 9 years ago

Are you on windows?

monperrus commented 9 years ago

Arrghhhh, no I'm on Linux :-)

satabin commented 9 years ago

ok, so no it's not normal at all. Out of the box, it should start a local couchdb instance on the test port without any further problem.

What version of CouchDB do you have?

Just to be sure: you are working in /tmp???

monperrus commented 9 years ago

couchdb - Apache CouchDB 1.4.0

Yes, I'm in /tmp for now.

satabin commented 9 years ago

What I do not understand is why sbt is trying to execute the couchdb binary located in the target directory? Did you change anything in the build files? Any build.sbt file?

monperrus commented 9 years ago

Did you change anything in the build files? Any build.sbt file? No. No change. No build.sbt.

satabin commented 9 years ago

What java version do you use?

It seems that something goes wrong when the couchdb temporary directory does not exist, but I never encountered this.

monperrus commented 9 years ago

What java version do you use?

OpenJDK 1.7.0_79

satabin commented 9 years ago

I have exactly the same settings on my computer and it works out of the box with a fresh clone. I really do not understand this exception of yours :(