Getting Exception while inserting using bucket.async.insert

When i try to insert set of documents using the below code, i am getting an exception

Observable.from(documents.subList(i, end)).flatMap(new Func1<JsonDocument, Observable>() {

  				public Observable<JsonDocument> call(JsonDocument docToInsert) {
  					return bucket.async().insert(docToInsert);

Exception Trace:

Exception in thread “main” java.util.NoSuchElementException: Sequence contains no elements
at rx.internal.operators.OperatorSingle$1.onCompleted(
at rx.internal.operators.NotificationLite.accept(
at rx.internal.operators.TakeLastQueueProducer.emit(
at rx.internal.operators.TakeLastQueueProducer.startEmitting(
at rx.internal.operators.OperatorTakeLast$1.onCompleted(
at rx.internal.operators.OperatorMerge$MergeSubscriber.drainAndComplete(
at rx.internal.operators.OperatorMerge$MergeSubscriber.onCompleted(
at rx.internal.operators.OperatorMap$1.onCompleted(
at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(
at rx.Subscriber.setProducer(
at rx.Subscriber.setProducer(
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable$
at rx.Observable.subscribe(
at rx.observables.BlockingObservable.blockForSingle(
at rx.observables.BlockingObservable.single(


I could see this exception being raised if the documents sublist is empty. Can you test if this is the case?

1 Like

yes. The list coming was empty. Thanks. When i try to write large volume of documents(3 to 4 lac documets) this operation gets hung after sometime. i see the below messages. Any idea what is going wrong here?

10:48:56.515 [cb-io-1-1] DEBUG c.c.c.c.endpoint.kv.KeyValueHandler - [localhost/][KeyValueEndpoint]: Identified Idle State, signalling config reload.
10:48:56.515 [cb-io-1-1] DEBUG c.c.c.c.e.AbstractGenericHandler - [localhost/][KeyValueEndpoint]: KeepAlive fired
10:48:56.515 [cb-core-3-1] DEBUG c.c.c.c.config.ConfigurationProvider - Received signal for outdated configuration.
10:48:56.527 [cb-computations-2] DEBUG c.c.c.c.config.ConfigurationProvider - New Bucket contact-service-data config proposed.
10:48:56.529 [cb-computations-2] DEBUG c.c.c.c.c.refresher.CarrierRefresher - Completed refreshing config for bucket “contact-service-data”

These logs seem to be unrelated to your hanging problems. Can you show us more logs?

Hi @ldoguin I could resolve this problem. The issue was with the long running Oracle database query from which i am trying to get the data. Thanks.