Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Email Script Unexpected exception occurred

Solved1.23K views14th July 2023email protocol scripts scripting
2
Catalin Cireasa273 4th July 2022 4 Comments

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):
Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 14th July 2023
Alberto De Luca [DevOps Enabler] commented 4th July 2022

Is this just via the API or do you get similar outcome also from an automation script?

Catalin Cireasa commented 4th July 2022

Only via the API

Alberto De Luca [DevOps Enabler] commented 4th July 2022

I see – do you need the API to trigger this?
Or could you trigger the message in a different way?

Catalin Cireasa commented 4th July 2022

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

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
3
Alberto De Luca [DevOps Enabler]4.58K Posted 4th July 2022 2 Comments

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

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 14th July 2023
Catalin Cireasa commented 4th July 2022

Ok, Thank you for the advice.

Catalin Cireasa commented 20th July 2022

Hi,

I managed to fix the problem temporarily by rebooting the Data Miner but the issue is present again.

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin