I was trying to execute query on a view, first time its work perfectly fine and on the second launch I was getting an exception "“Failed to update index for equipmentsbytype
: DbError”
Below is the code is was trying to execute
var view = database.GetView("equipmentsbytype");
view.SetMap((doc, emit) =>
{
// retrieving operation type and its document
if (doc[Constants.TYPE].Equals(Constants.TYPE_EQUIPMENT) && doc[Constants.OPERATION].Equals(type) && doc[Constants.STATUS].Equals(Constants.ACTIVE))
{
emit(doc[Constants.EQUIPMENT], doc);
}
}, Constants.VIEW_VERSION);
//create query with descending order
Query query = view.CreateQuery();
query.Descending = true;
var equipmentsDetails = query.Run();
and the stack trace is
"Failed to update index for equipmentsbytype
: DbError, "
StackTrace
at Couchbase.Lite.Storage.SystemSQLite.SqlitePCLRawStorageEngine.RunInTransaction(RunInTransactionDelegate block)\r\n
at Couchbase.Lite.Storage.SystemSQLite.SqliteCouchStore.RunInTransaction(RunInTransactionDelegate block)\r\n
at Couchbase.Lite.Database.RunInTransaction(RunInTransactionDelegate transactionDelegate)\r\n
at Couchbase.Lite.Query.Run()\r\n
at DataLite.Models.Equipment.GetEquipmentsByType(Database database, String type) in C:\\Users\\AJAY\\Documents\\windows\\DataLite\\Models\\Equipment.cs:line 72" string
$exception {"Failed to update index for `equipmentsbytype`: DbError, "} Couchbase.Lite.CouchbaseLiteException
-
CBLStatus {Status: DbError} Couchbase.Lite.Status Code DbError Couchbase.Lite.StatusCode
-
Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} HResult -2146233088 int HelpLink null string
-
IPForWatsonBuckets {142813044} System.UIntPtr
-
InnerException null System.Exception IsTransient false bool Message "Failed to update index for `equipmentsbytype`: DbError, " string RemoteStackTrace null string Source "Couchbase.Lite.Storage.SystemSQLite" string StackTrace " at Couchbase.Lite.Storage.SystemSQLite.SqlitePCLRawStorageEngine.RunInTransaction(RunInTransactionDelegate block)\r\n at Couchbase.Lite.Storage.SystemSQLite.SqliteCouchStore.RunInTransaction(RunInTransactionDelegate block)\r\n at Couchbase.Lite.Database.RunInTransaction(RunInTransactionDelegate transactionDelegate)\r\n at Couchbase.Lite.Query.Run()\r\n at DataLite.Models.Equipment.GetEquipmentsByType(Database database, String type) in C:\\Users\\AJAY\\Documents\\lehman-caves-windows\\DataLite\\Models\\Equipment.cs:line 72" string
-
TargetSite {Boolean RunInTransaction(Couchbase.Lite.RunInTransactionDelegate)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo} WatsonBuckets null object _HResult -2146233088 int _className null string
-
_data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal} _dynamicMethods null object
-
_exceptionMethod {Boolean RunInTransaction(Couchbase.Lite.RunInTransactionDelegate)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo} _exceptionMethodString null string _helpURL null string
-
_innerException null System.Exception
-
_ipForWatsonBuckets {142813044} System.UIntPtr _message "Failed to update index for `equipmentsbytype`: DbError, " string _remoteStackIndex 0 int _remoteStackTraceString null string
-
_safeSerializationManager {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager _source "Couchbase.Lite.Storage.SystemSQLite" string
-
_stackTrace {sbyte[96]} object {sbyte[]} _stackTraceString null string _watsonBuckets null object _xcode -532462766 int
-
_xptrs {0} System.IntPtr
-
Static members