SOLUTION - After internal investigation
For whom it my concern, the issue is related to a bug in Dataminer that is present since DataMiner 10.4.6 (RN 38987), where there was a change so that a protocol would be set as production if no folder existed yet in the Protocols folder for that protocol.
However, during installation of a package, what happens is that first the protocol XML file gets installed and then later the templates are installed. When the protocol XML file gets installed, it’s immediately put to production (and at the point the templates still need to be installed) so the templates did not get copied to the production version.
The install package also has a way of indicating that a version needs to be set as production and to copy the templates but that would not do anything anymore as DataMiner would see that the version that is requested to be put as production is already the production version.
With RN 40291, available since DataMiner 10.4.10, the implementation has changed a bit to overcome this problem. With this change, it will now only automatically set it to production in case a dmprotocol is installed (if no version was uploaded yet) and only after the full dmprotocol package has been installed.
A workaround to have the package installation work on version 10.4.6-10.4.9 is to create a directory for the protocol in the install script (as this would bypass the logic to set it to production automatically). See workaround section in https://collaboration.dataminer.services/task/241354.
DESCRIPTION
Deployment of Ping Monitoring package has failed every time it has been tried in recent weeks.
This was working before, but now I have tried using different versions and different DMAs and I get errors every time I try to deploy from Catalog.
The latest attempt was done in a DaaS system.
HOW TO REPRODUCE
1. Deploy Ping Monitoring | Catalog (dataminer.services) in a cloud-connected DMA.
2. Check for errors in the Cloud Admin page
INVESTIGATION
I have tried deploying different version of Ping Monitoring package and I get this error: every time.
{
"errorMessage": "Unexpected exception occurred",
"exceptionMessage": "StatusCode: UnknownError, DebugMessage: A unknown exception occurred in CoreGateway: Installation of the package Ping Monitoring version 1.0.1-CU8 failed because something went wrong while running the install script: Error triggering entry point Skyline.DataMiner.Net.Automation.AutomationEntryPoint: EXIT: \"Exception encountered during installation: (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Run Subscript 'CreateDefaultPing' Failed: 0x80004005\r\n at Skyline.DataMiner.Automation.Engine.InternalLaunchSubScript(String scriptName, List`1 finalOptions, Int32 inheritSubScript, Int32 extendedErrorInfo, Dictionary`2& subScriptOutput, List`1& errorMessages)\r\n at Skyline.DataMiner.Automation.SubScriptOptions.StartScript()\r\n at Script.Install(Engine engine, AppInstallContext context)\", DmaId: 1003814",
"stackTrace": " at ArtifactDeployer.Services.CoreGateWayResponseHandler.Implementations.CoreGateWayResponseHandler.Handle[TReq,TResp](ICoreGatewayRequestExecutor coreGatewayRequestExecutor, TReq request, MessageParser`1 responseParser, String topicId)\r\n at ArtifactDeployer.Deployer.Implementations.AppPackageDeployer.Deploy(String deploymentId, EventingInfo eventingInfo, ArtifactInfo info, String artifactLocation, DeployContext context)\r\n at ArtifactDeployer.Handler.Implementations.DeploymentHandlerEventingDecorator.<>c__DisplayClass7_0.<<DeployArtifactAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at ArtifactDeployer.Handler.Implementations.DeploymentHandlerEventingDecorator.CaptureExceptionAsync(ContextType contextType, Func`1 action)"
}
QUESTION
Is this something you have seen before? Seems to be specific for this LCA, and it has been reproduced over several systems, both DAAS and not DAAS. Last try, was on a freshly installed DAAS running the latest version of Dataminer (10.4.8.0-14612).
MORE INFORMATION
We tried installing the dmapp on previous versions of Dataminer, and 10.4.1 and it seems it works, while it fails in newer versions. The issue seems to be the following
024/08/29 16:01:06.076|SLAutomation.exe 10.4.2432.678|20916|47744|CSharp|DBG|5|(Script CreateDefaultPing/1) Extended Error Info:
(Code: 0x80131500) Skyline.DataMiner.Automation.ScriptAbortException: Sequence contains no matching element
at Skyline.DataMiner.Automation.Engine.ExitFail(String reason)
at CreateDefaultPing_1.Script.Run(IEngine engine)
2024/08/29 16:01:06.078|SLAutomation.exe 10.4.2432.678|20916|47744|CScriptLoader::ExitNow|DBG|-1|[Baptiste Pattyn] (Script CreateDefaultPing) EXIT: “Sequence contains no matching element”
2024/08/29 16:01:06.079|SLAutomation.exe 10.4.2432.678|20916|47744|CScriptLoader::FinalActions|DBG|3|[Baptiste Pattyn] (Script CreateDefaultPing) Script execution FAILED
2024/08/29 16:01:06.092|SLAutomation.exe 10.4.2432.678|20916|47744|CAutomation::Execute|INF|0|[Baptiste Pattyn] Finished executing script: ‘CreateDefaultPing’ (ID: 48) – FAILED – Execution took 00.520s.
2024/08/29 16:01:06.096|SLAutomation.exe 10.4.2432.678|20916|64052|CSharp|DBG|5|(Script Ping Monitoring_1.0.1-CU8_InstallScript_2643ce95de1648e18f217533bd205057/1) Extended Error Info:
(Code: 0x80131500) Skyline.DataMiner.Automation.ScriptAbortException: Exception encountered during installation: (Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Run Subscript ‘CreateDefaultPing’ Failed: 0x80004005
at Skyline.DataMiner.Automation.Engine.InternalLaunchSubScript(String scriptName, List`1 finalOptions, Int32 inheritSubScript, Int32 extendedErrorInfo, Dictionary`2& subScriptOutput, List`1& errorMessages)
at Skyline.DataMiner.Automation.SubScriptOptions.StartScript()
at Script.Install(Engine engine, AppInstallContext context)
at Skyline.DataMiner.Automation.Engine.ExitFail(String reason)
at Script.Install(Engine engine, AppInstallContext context)
This CreateDefaultPing creates a default Ping Element when the app is deployed from the catalog.
Any idea why this might be failing in newer versions?
As Alexander mentioned, this does indeed seem to be an exception that is thrown inside the installation script. I tried this on my local development agent running a dev build of 10.4.10 and this worked fine.
Looking at the error you shared, it seems that within the 'try-catch' of the installation script, an exception is thrown with the message 'Sequence contains no matching element'. This could be an exception thrown when using the 'First' method of LINQ. It could help by passing the full exception to 'engine.ExitFail' instead of only the message of the exception. That way, you'll know in what method it was thrown.
The installation script does have two usages of the 'First' method in the 'CreateElement' method. If I read the code correctly, these try to retrieve the alarm or trend templates associated with the protocol for the element, and assumes that they will exist. If these are not returned by the 'dms.GetAlarmTemplates' or 'dms.GetTrendTemplates' methods, the aforementioned exception would be thrown. I believe that these are added by the installation package before this script is run, but it may occur on some systems that it takes a bit of time before they are returned in these get requests. Maybe some changes in the recent DataMiner versions are causes these uploaded templates to register a bit more slowly than before, increasing the chances of not finding them in this script.
I would recommend making the installation script more robust by retrying retrieving certain things like the alarm & trend template, but also the created element as it now expects it to be available at most 1s after the create call. (on loaded systems, this may not always be the case)