I'm trying to read some DOM instances based on some conditions but I'm getting an exception.
These are the conditions:
var resourceDomGuids = resourcesData.Keys.ToList();
// Get jobs using nodes that have have certain dim id in the reference
var searchQueryJobs = resourceDomGuids.Select(resourceDomId =>
DomInstanceExposers.FieldValues.DomInstanceField(SlcWorkflow.Sections.Nodes.NodeReferenceID)
.Equal(resourceDomId)).ToArray();
var orFilterJobs = new ORFilterElement<DomInstance>(searchQueryJobs);
// Only jobs in the future and within 4 hours
var timeFilterStart = DomInstanceExposers.FieldValues.DomInstanceField(SlcWorkflow.Sections.JobInfo.JobStart).GreaterThan(DateTime.UtcNow);
var timeFilterEnd = DomInstanceExposers.FieldValues.DomInstanceField(SlcWorkflow.Sections.JobInfo.JobStart).LessThan(DateTime.UtcNow.AddHours(4));
var andTimeFilter = new ANDFilterElement<DomInstance>(timeFilterStart, timeFilterEnd);
// Only jobs in confirmed or canceled state
var confirmedFilter = DomInstanceExposers.StatusId.Equal(SlcWorkflow.Behaviors.Job_Behavior.Statuses.Confirmed);
var canceledFilter = DomInstanceExposers.StatusId.Equal(SlcWorkflow.Behaviors.Job_Behavior.Statuses.Canceled);
var orFilterState = new ORFilterElement<DomInstance>(confirmedFilter, canceledFilter);
// Definition filter
var definitionFilterJobs = DomInstanceExposers.DomDefinitionId.Equal(SlcWorkflow.Definitions.Jobs.Id);
My goal is that this query works:
// Query
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs, andTimeFilter, orFilterState);
var domInstanceJobs = domHelperWorkflow.DomInstances.Read(andFilterJobs);
But i can only make it to work like this:
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs);
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs, confirmedFilter);
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs, timeFilterStart);
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs, confirmedFilter, timeFilterStart);
If I introduce another condition for the state or the time it fails.
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs, timeFilterStart, timeFilterEnd);
big exception for:
var timeFilterStart = DomInstanceExposers.FieldValues.DomInstanceField(SlcWorkflow.Sections.JobInfo.JobStart).GreaterThan(DateTime.UtcNow);
var timeFilterEnd = DomInstanceExposers.FieldValues.DomInstanceField(SlcWorkflow.Sections.JobInfo.JobStart).LessThan(DateTime.UtcNow.AddHours(4));
var andFilterJobs = new ANDFilterElement<DomInstance>(definitionFilterJobs, orFilterJobs, timeFilterStart, timeFilterEnd);
Script Failure (DaznBookingResourcesApi): Skyline.DataMiner.Net.ManagerStore.CrudFailedException: Exception of type 'Skyline.DataMiner.Net.ManagerStore.CrudFailedException' was thrown.
at CManagedAutomation.RunEntryPointWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn, String scriptName, tagVARIANT* pvarEntryPointResult)
at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn, tagVARIANT* pvarEntryPointResult)
Containing TraceData:
TraceData: (amount = 1)
- ErrorData: (amount = 1)
- Reason: Unknown, Message: Read failed, could not read the objects from the database: (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Unexpected exception occurred ---> Skyline.DataMiner.Net.Exceptions.DataMinerException: (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Unexpected exception occurred ---> SLDataGateway.API.Types.Exceptions.Queries.QueryException: Exception thrown while executing paged query: Query(((DomInstance.DomDefinitionId[Guid] ==094b7503-2cd8-4e86-a189-c33076cabfbc) AND ((DomInstance.FieldValues.fbbd7129-e818-4c73-9cc2-e6db158bf89f[DynamicList<Guid>] ==f93dd4c9-aebc-4bdd-be68-1c67042b83e6... ) ---> SLDataGateway.API.Types.Exceptions.Queries.QueryException: Exception thrown while executing paged query: Query(((DomInstance.DomDefinitionId[Guid] ==094b7503-2cd8-4e86-a189-c33076cabfbc) AND ((DomInstance.FieldValues.fbbd7129-e818-4c73-9cc2-e6db158bf89f[DynamicList<Guid>] ==f93dd4c9-aebc-4bdd-be68-1c67042b83e6... ) ---> OpenSearch.Net.OpenSearchClientException: The remote server returned an error: (500) Internal Server Error.. Call: Status code 500 from: POST /dms-cdominstance_(slc)workflow/_search?typed_keys=true&scroll=15m. ServerError: Type: search_phase_execution_exception Reason: "all shards failed" CausedBy: "Type: too_many_nested_clauses Reason: "Query contains too many nested clauses; maxClauseCount is set to 1024" CausedBy: "Type: too_many_nested_clauses Reason: "Query contains too many nested clauses; maxClauseCount is set to 1024""" ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OpenSearch.Net.HttpWebRequestConnection.<RequestAsync>d__5`1.MoveNext()
--- End of inner exception stack trace ---
at OpenSearch.Net.Transport`1.HandleOpenSearchClientException(RequestData data, Exception clientException, IOpenSearchResponse response)
at OpenSearch.Net.Transport`1.FinalizeResponse[TResponse](RequestData requestData, IRequestPipeline pipeline, List`1 seenExceptions, TResponse response)
at OpenSearch.Net.Transport`1.<RequestAsync>d__15`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OpenSearch.Client.OpenSearchClient.<SearchAsync>d__198`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.StorageTypes.OpenSearchStorageType`1.<HandleSearchRequest>d__94`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.StorageTypes.OpenSearchCustomData`1.<GetFirstPage>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.StorageTypes.OpenSearchStorageType`1.<GetFirstPage>d__92.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.PagingHandlers.OpenSearchPagingHandler`1.<GetNextPageFromOpenSearchAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Skyline.DataMiner.SLSearch.OpenSearch.PagingHandlers.OpenSearchPagingHandler`1.<TryFillBufferAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.PagingHandlers.OpenSearchPagingHandler`1.<GetNextPageAsyncInternal>d__38.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
--- End of inner exception stack trace ---
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
at SLDataGateway.Types.StorageType`1.ReadPagedData(PagingCookie cookie)
at SLDataGateway.Types.Storage.StorageTypeLimitPagingHandler`1.GetNextPageAsyncInternal(CancellationToken cancellationToken)
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
--- End of inner exception stack trace ---
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
at SLCassandraClassLibrary.DBGateway.RepositoryUtil.Types.DataSetStorageTypeRepository`1.ReadPaged(PagingCookie cookie)
at SLCassandraClassLibrary.DBGateway.RepositoryMessageHandlerUtil.DataSetStorageTypeRepositoryMessageHandler`1.HandlePagedDataSetRequest(IDataSetStorageTypeRepository`1 repository, PagedDataSetRequest`1 pagedDataSetRequest, IDataConnectionInfo connectionInfo, ILogger logger)
at SLCassandraClassLibrary.DBGateway.RepositoryUtil.Factories.StorageTypeDatabaseRepositoryFactory.<>c__DisplayClass29_0`1.<GetDataSetRepositoryMessageHandlerBuilder>b__0(IDataSetRepository`1 repository, IDataSetRequest message, IDataConnectionInfo connInfo)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequestInternal(TRepository repository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequest(IBasicRepository basicRepository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.ADatabaseRepository.HandleRequest(IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandler.ADataSetRequestMessageHandler.HandleRequest(IDataSetRequest dataSetRequest, IDataConnectionInfo connInfo)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<InternalExecuteAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<ExecuteAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Skyline.DataMiner.Net.SLDataGateway.Helpers.AsyncHelper.WaitToComplete(Task task, TimeSpan timeout)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.Execute()
at SLDataGateway.API.Paging.PagingHandlers.RepositoryPagingHandler`1.GetNextPage()
at SLDataGateway.API.Paging.PagingHandlers.RepositoryPagingHandler`1.NextPage()
at SLDataGateway.API.Repositories.MessageHandlers.DataSetUtil.DataSetRepositoryMessageHandler`1.GetNextPageInfo(IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery, ITracingConfiguration overruledTracingConfiguration)
at SLDataGateway.API.Repositories.MessageHandlers.DataSetUtil.DataSetRepositoryMessageHandler`1.HandlePagedDataSetRequest(IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.Helper`1.HandlePagedDataSetRequest(IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.Helper`1.HandlePagedDataSetRequest(IDataSetRepository repository, PagedDataSetRequest requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.HandlePagedDataSetRequest[T](IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.Factory.LocalDatabaseRepositoryFactory.<>c__DisplayClass8_0`1.<GetDataSetRepositoryMessageHandlerBuilder>b__2(IDataSetRepository`1 repository, IDataSetRequest message, IDataConnectionInfo info)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequestInternal(TRepository repository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequest(IBasicRepository basicRepository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.ADatabaseRepository.HandleRequest(IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.DataSetRequestMessageHandler.HandleRequestInternal(IDataSetRequest dataSetRequest, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandler.ADataSetRequestMessageHandler.HandleRequest(IDataSetRequest dataSetRequest, IDataConnectionInfo connInfo)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<InternalExecuteAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<ExecuteAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Skyline.DataMiner.Net.SLDataGateway.Helpers.AsyncHelper.WaitToComplete(Task task, TimeSpan timeout)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.Execute()
at Skyline.DataMiner.Net.Apps.Utils.CustomDataRepositoryStorage`2.InnerReadAll(IQuery`1 query)
at Skyline.DataMiner.Net.AsyncDatabaseCacher`2.ReadAll(IQuery`1 query)
at Skyline.DataMiner.Net.DatabaseCallerExtensions.ExecutePagingMeta[T](IDatabaseCaller`1 dbCaller, PagingMeta meta, IQuery`1 query)
at Skyline.DataMiner.Net.ManagerStore.CrudComponent`1.Read(OperationMeta meta, IQuery`1 query), InnerException: (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Unexpected exception occurred ---> Skyline.DataMiner.Net.Exceptions.DataMinerException: (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Unexpected exception occurred ---> SLDataGateway.API.Types.Exceptions.Queries.QueryException: Exception thrown while executing paged query: Query(((DomInstance.DomDefinitionId[Guid] ==094b7503-2cd8-4e86-a189-c33076cabfbc) AND ((DomInstance.FieldValues.fbbd7129-e818-4c73-9cc2-e6db158bf89f[DynamicList<Guid>] ==f93dd4c9-aebc-4bdd-be68-1c67042b83e6... ) ---> SLDataGateway.API.Types.Exceptions.Queries.QueryException: Exception thrown while executing paged query: Query(((DomInstance.DomDefinitionId[Guid] ==094b7503-2cd8-4e86-a189-c33076cabfbc) AND ((DomInstance.FieldValues.fbbd7129-e818-4c73-9cc2-e6db158bf89f[DynamicList<Guid>] ==f93dd4c9-aebc-4bdd-be68-1c67042b83e6... ) ---> OpenSearch.Net.OpenSearchClientException: The remote server returned an error: (500) Internal Server Error.. Call: Status code 500 from: POST /dms-cdominstance_(slc)workflow/_search?typed_keys=true&scroll=15m. ServerError: Type: search_phase_execution_exception Reason: "all shards failed" CausedBy: "Type: too_many_nested_clauses Reason: "Query contains too many nested clauses; maxClauseCount is set to 1024" CausedBy: "Type: too_many_nested_clauses Reason: "Query contains too many nested clauses; maxClauseCount is set to 1024""" ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OpenSearch.Net.HttpWebRequestConnection.<RequestAsync>d__5`1.MoveNext()
--- End of inner exception stack trace ---
at OpenSearch.Net.Transport`1.HandleOpenSearchClientException(RequestData data, Exception clientException, IOpenSearchResponse response)
at OpenSearch.Net.Transport`1.FinalizeResponse[TResponse](RequestData requestData, IRequestPipeline pipeline, List`1 seenExceptions, TResponse response)
at OpenSearch.Net.Transport`1.<RequestAsync>d__15`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OpenSearch.Client.OpenSearchClient.<SearchAsync>d__198`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.StorageTypes.OpenSearchStorageType`1.<HandleSearchRequest>d__94`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.StorageTypes.OpenSearchCustomData`1.<GetFirstPage>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.StorageTypes.OpenSearchStorageType`1.<GetFirstPage>d__92.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.PagingHandlers.OpenSearchPagingHandler`1.<GetNextPageFromOpenSearchAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Skyline.DataMiner.SLSearch.OpenSearch.PagingHandlers.OpenSearchPagingHandler`1.<TryFillBufferAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Skyline.DataMiner.SLSearch.OpenSearch.PagingHandlers.OpenSearchPagingHandler`1.<GetNextPageAsyncInternal>d__38.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
--- End of inner exception stack trace ---
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
at SLDataGateway.Types.StorageType`1.ReadPagedData(PagingCookie cookie)
at SLDataGateway.Types.Storage.StorageTypeLimitPagingHandler`1.GetNextPageAsyncInternal(CancellationToken cancellationToken)
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
--- End of inner exception stack trace ---
at SLDataGateway.Types.Storage.PagingHandlers.APagingHandler`1.GetNextPage()
at SLCassandraClassLibrary.DBGateway.RepositoryUtil.Types.DataSetStorageTypeRepository`1.ReadPaged(PagingCookie cookie)
at SLCassandraClassLibrary.DBGateway.RepositoryMessageHandlerUtil.DataSetStorageTypeRepositoryMessageHandler`1.HandlePagedDataSetRequest(IDataSetStorageTypeRepository`1 repository, PagedDataSetRequest`1 pagedDataSetRequest, IDataConnectionInfo connectionInfo, ILogger logger)
at SLCassandraClassLibrary.DBGateway.RepositoryUtil.Factories.StorageTypeDatabaseRepositoryFactory.<>c__DisplayClass29_0`1.<GetDataSetRepositoryMessageHandlerBuilder>b__0(IDataSetRepository`1 repository, IDataSetRequest message, IDataConnectionInfo connInfo)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequestInternal(TRepository repository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequest(IBasicRepository basicRepository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.ADatabaseRepository.HandleRequest(IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandler.ADataSetRequestMessageHandler.HandleRequest(IDataSetRequest dataSetRequest, IDataConnectionInfo connInfo)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<InternalExecuteAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<ExecuteAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Skyline.DataMiner.Net.SLDataGateway.Helpers.AsyncHelper.WaitToComplete(Task task, TimeSpan timeout)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.Execute()
at SLDataGateway.API.Paging.PagingHandlers.RepositoryPagingHandler`1.GetNextPage()
at SLDataGateway.API.Paging.PagingHandlers.RepositoryPagingHandler`1.NextPage()
at SLDataGateway.API.Repositories.MessageHandlers.DataSetUtil.DataSetRepositoryMessageHandler`1.GetNextPageInfo(IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery, ITracingConfiguration overruledTracingConfiguration)
at SLDataGateway.API.Repositories.MessageHandlers.DataSetUtil.DataSetRepositoryMessageHandler`1.HandlePagedDataSetRequest(IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.Helper`1.HandlePagedDataSetRequest(IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.Helper`1.HandlePagedDataSetRequest(IDataSetRepository repository, PagedDataSetRequest requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.HandlePagedDataSetRequest[T](IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.Factory.LocalDatabaseRepositoryFactory.<>c__DisplayClass8_0`1.<GetDataSetRepositoryMessageHandlerBuilder>b__2(IDataSetRepository`1 repository, IDataSetRequest message, IDataConnectionInfo info)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequestInternal(TRepository repository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandlers.CloneUtil.RepositoryMessageHandler`1.HandleRequest(IBasicRepository basicRepository, IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.ADatabaseRepository.HandleRequest(IDataSetRequest requestMessage, IDataConnectionInfo connectionInfo)
at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.DataSetRequestMessageHandler.HandleRequestInternal(IDataSetRequest dataSetRequest, IDataConnectionInfo connectionInfo)
at SLDataGateway.API.Repositories.MessageHandler.ADataSetRequestMessageHandler.HandleRequest(IDataSetRequest dataSetRequest, IDataConnectionInfo connInfo)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<InternalExecuteAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.<ExecuteAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Skyline.DataMiner.Net.SLDataGateway.Helpers.AsyncHelper.WaitToComplete(Task task, TimeSpan timeout)
at SLDataGateway.API.Requests.Queries.Abstract.ADatabaseQuery`2.Execute()
at Skyline.DataMiner.Net.Apps.Utils.CustomDataRepositoryStorage`2.InnerReadAll(IQuery`1 query)
at Skyline.DataMiner.Net.AsyncDatabaseCacher`2.ReadAll(IQuery`1 query)
at Skyline.DataMiner.Net.DatabaseCallerExtensions.ExecutePagingMeta[T](IDatabaseCaller`1 dbCaller, PagingMeta meta, IQuery`1 query)
at Skyline.DataMiner.Net.ManagerStore.CrudComponent`1.Read(OperationMeta meta, IQuery`1 query)
(CSharp; 0x80004005h): (see comment for more details)
Thanks for sharing the stack-trace. It looks to be the issue I described in my comment. Within this stack trace, you'll find the error response that is returned by the DB. Here, this is "Query contains too many nested clauses; maxClauseCount is set to 1024". Could you check the amount of items there are in the 'resourceDomGuids' list? Outputting a simple count of that list should be sufficient.
Because I have to evaluate certain conditions I ended up removing those conditions and filter afterwards based on those conditions.
That should work as well. Do make sure however that not too much data is retrieved. (e.g. 1000 records, while we are interested in 10) Filtering in the DB is the most efficient way to retrieve data. If you would need additional help with getting the full DB query working, don't hesitate to leave another reply.
Hi Daniel,
As mentioned in Tom's comment, could you share the exception you are getting? This will help us to understand what could be going wrong.
When I check the query you shared, I already have a slight assumption it may be caused by the amount of clauses it has. On the Elasticsearch and OpenSearch database, there is a limit on the amount of clauses a single query can have. In your query, this amount seems to be variable depending on the amount of IDs in the 'resourceDomGuids' variable. Could you check and share how many IDs are in there?
Hi Daniel, what exception do you get?