Couchbase Server 3.0.1
Java client 2.1.2
We have been facing this issue on below code -
public UserDocument getUserByUserName(String userName) {
UserDocument userDocument = null;
if (userName == null) {
return null;
}
ViewResult result = bucket.query(ViewQuery
.from(DesignDocumentEnum.USERNAME_DESIGN_DOC.getName(),
ViewEnum.BY_USERNAME.getName()).key(userName).limit(1));
if (!result.success()) {
return null;
}
List<ViewRow> allRows = result.allRows();
for (ViewRow row : allRows) {
JsonDocument userDocumentJson = row.document();
userDocument = gson.fromJson(
userDocumentJson.content() != null ? userDocumentJson
.content().toString() : null, UserDocument.class);
break;
}
return userDocument;
}
We are not able to figure out why this happening. Based on our investigation this is pretty random,
! java.lang.IllegalStateException: The Content of this Observable is already released. Subscribe earlier or tune the CouchbaseEnvironment#autoreleaseAfter() setting.
! at com.couchbase.client.core.utils.UnicastAutoReleaseSubject$OnSubscribeAction.call(UnicastAutoReleaseSubject.java:230) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at com.couchbase.client.core.utils.UnicastAutoReleaseSubject$OnSubscribeAction.call(UnicastAutoReleaseSubject.java:202) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:145) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:137) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:145) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:137) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:145) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:137) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:145) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:137) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:145) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable$1.call(Observable.java:137) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
! at rx.Observable.unsafeSubscribe(Observable.java:7304) ~[pgweb-usermanagement-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]