Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudant support? Problem with 'withIDs' #57

Open
JCDClark opened this issue May 29, 2016 · 4 comments
Open

Cloudant support? Problem with 'withIDs' #57

JCDClark opened this issue May 29, 2016 · 4 comments
Assignees

Comments

@JCDClark
Copy link

Hi.

I'd firstly like to ask whether this project aims to support cloudant. I'm currently having an issue with one of the document queries.

Firstly, I'm currently learning cloudant and scala so this might just be me misusing and/or misunderstanding the tools.

When I invoke the following statement, it completes successfully and I can get out the document data just fine:

dbConnection.docs.getMany.includeDocs[Environment].byType[String]("all-environments", "environments", typeMappings.get(classOf[Environment]).get).build.query.unsafePerformSync

However, when I try the following, it fails with a upickle error:

dbConnection.docs.getMany.withIds(Seq("11a1371a7a01cbcb7a32a84415a6710a")).build.query.unsafePerformSync

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[Data: Key Missing: offset (data: Obj(ArrayBuffer((total_rows,Num(5.0)), (rows,Arr(ArrayBuffer(Obj(ArrayBuffer((id,Str(11a1371a7a01cbcb7a32a84415a6710a)), (key,Str(11a1371a7a01cbcb7a32a84415a6710a)), (value,Obj(ArrayBuffer((rev,Str(1-3ddbc6b7ff390979cfb4ee8af44829fd)))))))))))))]] at play.api.http.HttpErrorHandlerExceptions$$anon$1.<init>(HttpErrorHandler.scala:280) at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:280) at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:206) at play.api.GlobalSettings$class.onError(GlobalSettings.scala:160) at play.api.DefaultGlobal$.onError(GlobalSettings.scala:188) at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:98) at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100) at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99) at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346) at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70) at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) at scala.concurrent.Promise$class.complete(Promise.scala:55) at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) at scala.concurrent.Future$$anonfun$recoverWith$1$$anonfun$apply$6.apply(Future.scala:346) at scala.concurrent.Future$$anonfun$recoverWith$1$$anonfun$apply$6.apply(Future.scala:346) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:63) at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:78) at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:55) at scala.concurrent.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:55) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) at scala.concurrent.BatchingExecutor$Batch.run(BatchingExecutor.scala:54) at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:601) at scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:106) at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:599) at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) at scala.concurrent.Promise$class.complete(Promise.scala:55) at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237) at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91) at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91) at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:405) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: upickle.Invalid$Data: Key Missing: offset (data: Obj(ArrayBuffer((total_rows,Num(5.0)), (rows,Arr(ArrayBuffer(Obj(ArrayBuffer((id,Str(11a1371a7a01cbcb7a32a84415a6710a)), (key,Str(11a1371a7a01cbcb7a32a84415a6710a)), (value,Obj(ArrayBuffer((rev,Str(1-3ddbc6b7ff390979cfb4ee8af44829fd))))))))))))) at upickle.GeneratedUtil$class.mapToArray(GeneratedUtil.scala:45) at upickle.default$.mapToArray(Api.scala:25) at upickle.Implicits$$anonfun$CaseR$1.applyOrElse(Implicits.scala:83) at upickle.Implicits$$anonfun$CaseR$1.applyOrElse(Implicits.scala:82) at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171) at upickle.Implicits$Internal$$anon$1.apply(Implicits.scala:53) at upickle.Implicits$Internal$$anon$1.apply(Implicits.scala:50) at upickle.Types$Reader$$anonfun$read$1.applyOrElse(Types.scala:93) at upickle.Types$Reader$$anonfun$read$1.applyOrElse(Types.scala:93) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:167) at upickle.Types$class.readJs(Types.scala:137) at upickle.default$.readJs(Api.scala:25) at upickle.Types$class.read(Types.scala:133) at upickle.default$.read(Api.scala:25) at com.ibm.couchdb.core.Client$$anonfun$reqAndRead$1$$anonfun$apply$7.apply(Client.scala:86) at com.ibm.couchdb.core.Client$$anonfun$reqAndRead$1$$anonfun$apply$7.apply(Client.scala:85) at scalaz.concurrent.Task$$anonfun$map$1$$anonfun$apply$2$$anonfun$apply$3.apply(Task.scala:42) at scalaz.concurrent.Task$.Try(Task.scala:446) at scalaz.concurrent.Task$$anonfun$map$1$$anonfun$apply$2.apply(Task.scala:42) at scalaz.concurrent.Task$$anonfun$map$1$$anonfun$apply$2.apply(Task.scala:42) at scalaz.$bslash$div.flatMap(Either.scala:135) at scalaz.concurrent.Task$$anonfun$map$1.apply(Task.scala:42) at scalaz.concurrent.Task$$anonfun$map$1.apply(Task.scala:42) at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52) at scalaz.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:58) at scalaz.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:58) at scalaz.concurrent.Future.step(Future.scala:118) at scalaz.concurrent.Future.unsafePerformListen(Future.scala:75) at scalaz.concurrent.Future$$anonfun$unsafePerformListen$1$$anonfun$apply$4.apply(Future.scala:79) at scalaz.concurrent.Future$$anonfun$unsafePerformListen$1$$anonfun$apply$4.apply(Future.scala:79) at scalaz.Free$$anonfun$map$1.apply(Free.scala:87) at scalaz.Free$$anonfun$map$1.apply(Free.scala:87) at scalaz.Free.resume(Free.scala:105) at scalaz.Free.go2$1(Free.scala:149) at scalaz.Free.go(Free.scala:153) at scalaz.Free.run(Free.scala:239) at scalaz.concurrent.Future$$anonfun$apply$15$$anon$3.call(Future.scala:433) at scalaz.concurrent.Future$$anonfun$apply$15$$anon$3.call(Future.scala:433) at java.util.concurrent.FutureTask.run(FutureTask.java:277) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.lang.Thread.run(Thread.java:785)

It seems that uPickle is expecting an 'offset' key in the returned JSON. I tried this manually by posting to /_all_docs with some JSON that specified the IDs as keys and indeed, the returned JSON did not have an 'offset' value. Perhaps this is a difference between apache couchdb and cloudant? If you aim to support cloudant then I'd like to raise this as a bug.

Thanks.

@Nabegh
Copy link

Nabegh commented May 30, 2016

I have the same problem which I posted here
https://groups.google.com/forum/#!topic/couchdb-scala/ZpHGuPBoS0Q

@JCDClark
Copy link
Author

Ah, good to see I'm not the only one facing the problem. Thanks Nabegh.

@Nabegh
Copy link

Nabegh commented May 30, 2016

I downgraded to version 0.7.1 and everything seems to be working fine now.

@ermyas
Copy link
Collaborator

ermyas commented Jun 2, 2016

@JCDClark @Nabegh thanks for reporting this, we will take a look at this within the next day or so

@ermyas ermyas self-assigned this Jun 25, 2016
@ermyas ermyas added bug and removed bug labels Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants