Dear Dojo,
Any idea why this error accurses when I am trying to send an email report via a script ?
GenerateAlarmReport_BTZ/3) (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Unexpected exception occurred ---> SLDataGateway.API.Types.Exceptions.ClientException: Session 5c8559a0-329a-4210-a406-eee50d610709 is no longer available at SLDataGateway.API.Paging.PagingHandlers.AggregatePagingHandler`1.PrefetchItems() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at SLDataGateway.API.Paging.PagingHandlers.AggregatePagingHandler`1.PrefetchItems() at SLDataGateway.API.Paging.PagingHandlers.AggregatePagingHandler`1.GetNextPage() 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.HandlePagedDataSetRequest[T](IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, IQuery`1 overruledQuery) at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.HandlePagedDataSetRequestAlarmEventMessage[T](IDataSetRepository`1 repository, PagedDataSetRequest`1 requestMessage, ILogger logger, IDataConnectionInfo connectionInfo, Func`2 queryOverruleFunc) at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.MessageHandler.LocalDatabaseRepositoryMessageHandler.HandlePagedDataSetRequestForAlarmWithAlarmFilter(IDataSetRepository`1 repository, PagedDataSetRequestForAlarmWithAlarmFilter requestMessage, IDataConnectionInfo connectionInfo, ILogger logger) at Skyline.DataMiner.Net.SLDataGateway.API.Repositories.Factory.LocalDatabaseRepositoryFactory.<>c__DisplayClass8_0`1.<GetDataSetRepositoryMessageHandlerBuilder>b__0(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 SLDataGateway.API.Repositories.MessageHandlers.CompositeUtil.CompositeRepositoryMessageHandler.<>c__0`1.<DefaultBuilder>b__0_2(TCompositeRepository 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 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 CManagedAutomation.RunWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* pvarReturn, String scriptName) at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* varEntryPoint, tagVARIANT* pvarReturn) (CSharp; 0x80131500h):
Only via the API
I see – do you need the API to trigger this?
Or could you trigger the message in a different way?
public OutageList getAlarms(Engine engine, AlarmFilterItemString elementFilter, AlarmFilterItemParameterID parameterFilter, string StartDate, string EndDate, int location)
{
DateTime start_date = DateTime.Parse(StartDate, new CultureInfo(“en-US”));
engine.Log(“Converted to Datetime Object: ” + start_date.ToString());
DateTime end_date = DateTime.Parse(EndDate, new CultureInfo(“en-US”));
engine.Log(“Converted to Datetime Object: ” + end_date.ToString());
var repoReg = DatabaseRepositoryRegistryBuilder.Default.
WithConnection(Engine.SLNetRaw).
Build();
var alarmRepo = repoReg.Get();
var alarmsFromRepo = alarmRepo.Read(new AlarmFilter(new AlarmFilterItem[] { elementFilter, parameterFilter }), start_date, end_date, int.MaxValue)
.Cast()
.Where(a => a.Severity == “Critical” || a.IsClearedAlarm)
.GroupBy(a => a.AlarmID)
.Select(a => a.First())
.ToList();
This is the part which I am retrieving Alarms
You may need more expert eyes on this, but from the looks of it I'd say the API session expires by the time the report is complete.
To see if that's the case or not, you may try a few things:
- test with a very simple report that takes less than 5 min to be completed and to be attached to your message;
- test out of the API context (running e.g. an automation script locally, so that you are not using the session key - correlation can be used if you want that message to go out when a specific thing happen).
I'd also check you can actually send out emails (log in method and so on for the DMA you are using).
HTH
Ok, Thank you for the advice.
Hi,
I managed to fix the problem temporarily by rebooting the Data Miner but the issue is present again.
Is this just via the API or do you get similar outcome also from an automation script?