Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hello, I'm following the manual in order to create an anomaly alert and, so far, I've seen they need to be set on remote thing.
I have a thing (not remote) with Timer as base template.
I have a subscription such that every 5 seconds updates its property and I have an anomaly alert on this.
It's just a test because I want to learn how anomaly alert works.
My issue is that I get the status in Calibrating and after a while it get Failed.
Do you have any suggestions about why this happens?
Thank you
Hello,
Thank you for posting your question to the PTC Community.
Have you reviewed the following user guide: Anomaly Alert Statuses
Also, please take a look at this Knowledge Base Article around setting up Anomaly Alerts for Anomaly Detection
Please let me know if this helps.
Regards,
Neel
Actually in this guide you sent me setting up Anomaly Alerts for Anomaly Detection they talk about a remote thing so it's not my case.
I will have Generic Things; they update their properties from a Stream and I would like to set an anomaly alert on the Thing.
I would like to know if the status failure depends on the fact the Template is not Remote Thing or not
If it can help, I'm getting those two error in log
Returning a FAILED state for TimedValue [timestamp=1535037648979, value=23.498079488541133]. ThingWatcherMessage [timestamp=2018-08-23T17:20:48.986, severity=ERROR, state=ThingWatcherInternalState [internal=OBTAINING_MODEL, external=TRAINING], messageCode=WAT1001E, messageText=Operation exception. {Throwable=[Trainer.TrainingJobErrorException: Training job with id 4 entered into an incomplete state [FAILED] unable to process models. Error message: [UnrecognizedPropertyException: Unrecognized field "code" (class com.thingworx.analytics.results.api.ResultResponse), not marked as ignorable (7 known properties: "status", "tags", "id", "description", "lastModified", "name", "resultUri"])_ at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@195e5542; line: 1, column: 12] (through reference chain: com.thingworx.analytics.results.api.ResultResponse["code"])]}]]_com.thingworx.analytics.thingwatcher.exceptions.ThingWatcherOperationException: Error accessing PMML Model URI, cannot download model_ at com.thingworx.analytics.thingwatcher.ThingWatcherInternal.isModelAvailableAfterTraining(ThingWatcherInternal.java:673)_ at com.thingworx.analytics.thingwatcher.ThingWatcherInternal.runStateMachineFor(ThingWatcherInternal.java:410)_ at com.thingworx.analytics.thingwatcher.ThingWatcherInternal.bareMonitor(ThingWatcherInternal.java:302)_ at com.thingworx.analytics.thingwatcher.ThingWatcherInternal.monitor(ThingWatcherInternal.java:229)_ at com.thingworx.analytics.thingwatcher.ThingWatcher.monitor(ThingWatcher.java:57)_ at com.thingworx.system.subsystems.alerts.anomalyalert.AnomalyMonitor.monitor(AnomalyMonitor.java:256)_ at com.thingworx.system.subsystems.alerts.data.Alert.doAnomalyEvaluation(Alert.java:565)_ at com.thingworx.system.subsystems.alerts.handlers.NumberAlert.evaluateAlarm(NumberAlert.java:138)_ at com.thingworx.system.subsystems.alerts.data.AlertList.checkAlerts(AlertList.java:87)_ at com.thingworx.things.Thing.rawSetPropertyVTQ(Thing.java:4093)_ at com.thingworx.things.Thing.rawSetPropertyVTQ(Thing.java:3913)_ at com.thingworx.things.Thing.handleSetPropertyWithUpdate(Thing.java:4155)_ at com.thingworx.things.Thing.internalSetPropertyVTQ(Thing.java:4148)_ at com.thingworx.things.Thing.setPropertyVTQ(Thing.java:4270)_ at com.thingworx.things.Thing.setPropertyValue(Thing.java:4197)_ at com.thingworx.dsl.engine.adapters.ThingworxEntityAdapter.put(ThingworxEntityAdapter.java:296)_ at org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:2347)_ at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1598)_ at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1592)_ at org.mozilla.javascript.gen.Event_Timer_1280._c_script_0(Event.Timer:5)_ at org.mozilla.javascript.gen.Event_Timer_1280.call(Event.Timer)_ at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)_ at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3090)_ at org.mozilla.javascript.gen.Event_Timer_1280.call(Event.Timer)_ at org.mozilla.javascript.gen.Event_Timer_1280.exec(Event.Timer)_ at com.thingworx.dsl.engine.DSLProcessor.executeService(DSLProcessor.java:171)_ at com.thingworx.dsl.DSLServiceHandler.processService(DSLServiceHandler.java:38)_ at com.thingworx.handlers.ServiceHandlerBase.processServiceWithMetrics(ServiceHandlerBase.java:48)_ at com.thingworx.things.Thing.handleEvent(Thing.java:7645)_ at com.thingworx.things.Thing.processEvent(Thing.java:7581)_ at com.thingworx.system.subsystems.eventprocessing.EventInstance.run(EventInstance.java:61)_ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)_ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)_ at java.lang.Thread.run(Thread.java:748)_Caused by: com.thingworx.analytics.thingwatcher.Trainer$TrainingJobErrorException: Training job with id 4 entered into an incomplete state [FAILED] unable to process models. Error message: [UnrecognizedPropertyException: Unrecognized field "code" (class com.thingworx.analytics.results.api.ResultResponse), not marked as ignorable (7 known properties: "status", "tags", "id", "description", "lastModified", "name", "resultUri"])_ at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@195e5542; line: 1, column: 12] (through reference chain: com.thingworx.analytics.results.api.ResultResponse["code"])]_ at com.thingworx.analytics.thingwatcher.Trainer.lambda$getPMMLModelUri$1(Trainer.java:69)_ at java.util.Optional.orElseThrow(Optional.java:290)_ at com.thingworx.analytics.thingwatcher.Trainer.getPMMLModelUri(Trainer.java:69)_ at com.thingworx.analytics.thingwatcher.ThingWatcherInternal.isModelAvailableAfterTraining(ThingWatcherInternal.java:654)_ ... 33 more_
Anomaly Alert [AnomalyAlertTest_Thing-propTest1-AnomalyAlertTest] Failed when in [TRAINING] State. Thingwatcher Error Code :: [WAT1001E] Message :: Operation exception. {Throwable=[Trainer.TrainingJobErrorException: Training job with id 4 entered into an incomplete state [FAILED] unable to process models. Error message: [UnrecognizedPropertyException: Unrecognized field "code" (class com.thingworx.analytics.results.api.ResultResponse), not marked as ignorable (7 known properties: "status", "tags", "id", "description", "lastModified", "name", "resultUri"])_ at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@195e5542; line: 1, column: 12] (through reference chain: com.thingworx.analytics.results.api.ResultResponse["code"])]}]
Hello,
From the error message, it appears to be a configuration issue with your Anomaly Detection, where the properties file was not set correctly.
Can you provide the exact name of the JAR files you are using and provide the microservice.properities file?
Also, please take a moment to review this Article that may resolve your issue.
Regards,
Neel
My JAR files are
result-standalone-2.0.2-bin.jar
training-standalone-2.0.4-bin.jar
my microservices.properties is
results.destination.uri=results://52.169.91.141:8096/results/models file.storage.path=file:/ThingworxMicroservices/models dataset.webservices.url= dataset.app.id= dataset.app.key=
Hello,
Did the second article (https://www.ptc.com/en/support/article?n=CS270006) I provided resolve your issue?
I see you have another thread around a different issue with H2 persistence; which I gather you got past your original issue.
If the second article I provided did resolve your issue, can you mark that answer as solution accepted?
Thanks,
Neel
None of the articles solved my issues. I opened a new thread because I guess my problem is due to a db issue.
Sorry