@mpp Guys in MySensors forum noticed I cleared EEPROM with zeros instead of 0xFF.
Posts made by benya
-
RE: MySensor auto node ID
-
RE: Database issue?
@jkandasa I upgraded a while ago when you fixed another DB error.
New error appeared with no particular reason.
Should I restore DB from backup? -
Database issue?
I see the following errors in mycontroller.log and mycontroller process appears to be down:
2017-03-31 22:17:47,223 INFO [main] [org.mycontroller.standalone.db.DataBaseUtils:116] Checking migration... 2017-03-31 22:17:47,999 ERROR [main] [org.mycontroller.standalone.db.DataBaseUtils:119] Migration exception, org.flywaydb.core.internal.dbsupport.FlywaySqlException: Unable to obtain Jdbc connection from DataSource (jdbc:h2:file:../conf/mycontroller;MVCC=TRUE) for user 'mycontroller': General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- SQL State : HY000 Error Code : 50000 Message : General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:396) at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnection(DriverDataSource.java:358) at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:51) at org.flywaydb.core.Flyway.execute(Flyway.java:1367) at org.flywaydb.core.Flyway.migrate(Flyway.java:930) at org.mycontroller.standalone.db.DataBaseUtils.runDatabaseMigration(DataBaseUtils.java:117) at org.mycontroller.standalone.StartApp.startServices(StartApp.java:251) at org.mycontroller.standalone.StartApp.startMycontroller(StartApp.java:108) at org.mycontroller.standalone.StartApp.main(StartApp.java:95) Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:168) at org.h2.message.DbException.convert(DbException.java:295) at org.h2.engine.Database.openDatabase(Database.java:304) at org.h2.engine.Database.<init>(Database.java:267) at org.h2.engine.Engine.openSession(Engine.java:64) at org.h2.engine.Engine.openSession(Engine.java:176) at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154) at org.h2.engine.Engine.createSession(Engine.java:137) at org.h2.engine.Engine.createSession(Engine.java:27) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:115) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:99) at org.h2.Driver.connect(Driver.java:69) at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:393) ... 8 common frames omitted Caused by: java.lang.ArrayIndexOutOfBoundsException: 2048 at org.h2.store.Data.readInt(Data.java:160) at org.h2.index.PageDataNode.read(PageDataNode.java:105) at org.h2.index.PageDataNode.read(PageDataNode.java:84) at org.h2.store.PageStore.getPage(PageStore.java:799) at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:232) at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:85) at org.h2.table.RegularTable.<init>(RegularTable.java:83) at org.h2.store.PageStore.addMeta(PageStore.java:1696) at org.h2.store.PageStore.readMetaData(PageStore.java:1627) at org.h2.store.PageStore.recover(PageStore.java:1405) at org.h2.store.PageStore.openExisting(PageStore.java:367) at org.h2.store.PageStore.open(PageStore.java:288) at org.h2.engine.Database.getPageStore(Database.java:2482) at org.h2.engine.Database.open(Database.java:695) at org.h2.engine.Database.openDatabase(Database.java:273) ... 19 common frames omitted 2017-03-31 22:17:48,095 ERROR [main] [org.mycontroller.standalone.db.DataBaseUtils:132] Unable to close flyway connection org.flywaydb.core.internal.dbsupport.FlywaySqlException: Unable to obtain Jdbc connection from DataSource (jdbc:h2:file:../conf/mycontroller;MVCC=TRUE) for user 'mycontroller': General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- SQL State : HY000 Error Code : 50000 Message : General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:396) at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnection(DriverDataSource.java:358) at org.mycontroller.standalone.db.DataBaseUtils.runDatabaseMigration(DataBaseUtils.java:127) at org.mycontroller.standalone.StartApp.startServices(StartApp.java:251) at org.mycontroller.standalone.StartApp.startMycontroller(StartApp.java:108) at org.mycontroller.standalone.StartApp.main(StartApp.java:95) Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:168) at org.h2.message.DbException.convert(DbException.java:295) at org.h2.engine.Database.openDatabase(Database.java:304) at org.h2.engine.Database.<init>(Database.java:267) at org.h2.engine.Engine.openSession(Engine.java:64) at org.h2.engine.Engine.openSession(Engine.java:176) at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154) at org.h2.engine.Engine.createSession(Engine.java:137) at org.h2.engine.Engine.createSession(Engine.java:27) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:115) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:99) at org.h2.Driver.connect(Driver.java:69) at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:393) ... 5 common frames omitted Caused by: java.lang.ArrayIndexOutOfBoundsException: 2048 at org.h2.store.Data.readInt(Data.java:160) at org.h2.index.PageDataNode.read(PageDataNode.java:105) at org.h2.index.PageDataNode.read(PageDataNode.java:84) at org.h2.store.PageStore.getPage(PageStore.java:799) at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:232) at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:85) at org.h2.table.RegularTable.<init>(RegularTable.java:83) at org.h2.store.PageStore.addMeta(PageStore.java:1696) at org.h2.store.PageStore.readMetaData(PageStore.java:1627) at org.h2.store.PageStore.recover(PageStore.java:1405) at org.h2.store.PageStore.openExisting(PageStore.java:367) at org.h2.store.PageStore.open(PageStore.java:288) at org.h2.engine.Database.getPageStore(Database.java:2482) at org.h2.engine.Database.open(Database.java:695) at org.h2.engine.Database.openDatabase(Database.java:273) ... 16 common frames omitted 2017-03-31 22:17:48,568 ERROR [main] [org.mycontroller.standalone.db.DaoUtils:198] Unable to load Dao, org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException: 2048" [50000-193] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:168) at org.h2.message.DbException.convert(DbException.java:295) at org.h2.engine.Database.openDatabase(Database.java:304) at org.h2.engine.Database.<init>(Database.java:267) at org.h2.engine.Engine.openSession(Engine.java:64) at org.h2.engine.Engine.openSession(Engine.java:176) at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154) at org.h2.engine.Engine.createSession(Engine.java:137) at org.h2.engine.Engine.createSession(Engine.java:27) at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:115) at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:99) at org.h2.Driver.connect(Driver.java:69) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at com.j256.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnectionSource.java:266) at com.j256.ormlite.jdbc.JdbcPooledConnectionSource.getReadWriteConnection(JdbcPooledConnectionSource.java:140) at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:397) at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:383) at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:75) at org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl.<init>(BaseAbstractDaoImpl.java:65) at org.mycontroller.standalone.db.dao.ExternalServerDaoImpl.<init>(ExternalServerDaoImpl.java:38) at org.mycontroller.standalone.db.DaoUtils.loadAllDao(DaoUtils.java:157) at org.mycontroller.standalone.db.DataBaseUtils.runDatabaseMigration(DataBaseUtils.java:136) at org.mycontroller.standalone.StartApp.startServices(StartApp.java:251) at org.mycontroller.standalone.StartApp.startMycontroller(StartApp.java:108) at org.mycontroller.standalone.StartApp.main(StartApp.java:95) Caused by: java.lang.ArrayIndexOutOfBoundsException: 2048 at org.h2.store.Data.readInt(Data.java:160) at org.h2.index.PageDataNode.read(PageDataNode.java:105) at org.h2.index.PageDataNode.read(PageDataNode.java:84) at org.h2.store.PageStore.getPage(PageStore.java:799) at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:232) at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:85) at org.h2.table.RegularTable.<init>(RegularTable.java:83) at org.h2.store.PageStore.addMeta(PageStore.java:1696) at org.h2.store.PageStore.readMetaData(PageStore.java:1627) at org.h2.store.PageStore.recover(PageStore.java:1405) at org.h2.store.PageStore.openExisting(PageStore.java:367) at org.h2.store.PageStore.open(PageStore.java:288) at org.h2.engine.Database.getPageStore(Database.java:2482) at org.h2.engine.Database.open(Database.java:695) at org.h2.engine.Database.openDatabase(Database.java:273) ... 24 common frames omitted 2017-03-31 22:17:49,136 ERROR [main] [org.mycontroller.standalone.StartApp:97] Unable to start application, refer error log, java.lang.NullPointerException: null at org.mycontroller.standalone.settings.SettingsUtils.getValue(SettingsUtils.java:57) at org.mycontroller.standalone.settings.SettingsUtils.getValue(SettingsUtils.java:62) at org.mycontroller.standalone.settings.LocationSettings.getValue(LocationSettings.java:72) at org.mycontroller.standalone.settings.LocationSettings.get(LocationSettings.java:57) at org.mycontroller.standalone.AppProperties.loadPropertiesFromDb(AppProperties.java:520) at org.mycontroller.standalone.db.DataBaseUtils.runDatabaseMigration(DataBaseUtils.java:141) at org.mycontroller.standalone.StartApp.startServices(StartApp.java:251) at org.mycontroller.standalone.StartApp.startMycontroller(StartApp.java:108) at org.mycontroller.standalone.StartApp.main(StartApp.java:95) Exception in thread "MyController.org Shutdown-Hook" java.lang.NullPointerException at Acme.Serve.Serve.stopBackground(Serve.java:684) at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.stop(TJWSServletServer.java:184) at org.mycontroller.standalone.StartApp.stopHTTPWebServer(StartApp.java:222) at org.mycontroller.standalone.StartApp.stopServices(StartApp.java:303) at org.mycontroller.standalone.AppShutdownHook$1.run(AppShutdownHook.java:34)
-
RE: Triggering rule through the HTTP request
I figured how to set dummy sensor by script called through REST API.
I created "Set DummySensor" groovy script:
def uid = "DummySensor" def value = "1" def sensor = mcApi.uidTag().getByUid(uid).getResource() sensor.setValue(value) mcApi.sensor().sendPayload(sensor);
and call it through the REST API:
curl "http://admin:admin@localhost:9880/mc/rest/scripts/runNow?bindings=%7B+%7D&script=operations%2FSet+DummySensor.groovy&scriptBindings=%7B%7D"
I defined rule that gets triggered when dummy sensor value changes.
No 5 sec delays anymore. Cool! -
RE: Triggering rule through the HTTP request
Looks like dummy sensor variable triggers rule much faster than repository variable.
How could I change sensor variable (referring by UID tag) through REST API?
Could you post sample HTTP payload? -
RE: "Send email" questions
@jkandasa Yes, followed https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/ and got it working in short time.
-
RE: Rule and operation order
Any chance to overcome this limitation?
At least keep operations in the order they were added to the rule. -
RE: "Send email" questions
I guess local postfix server would address both issues (performance and email delivery reliability).
-
Rule and operation order
I defined rule that triggers execution of a few operations.
I'd like operations to be executed in a specific order.
When I add operations, they appear in the list in the alphabetical order.
Is there a way to reorder operations or add new item to the end of list? -
"Send email" questions
- If rule executes series of operations, they are execute sequentially or in parallel?
- if one operation in the series is "Send email", is it executed asynchronously (and network and SMTP server don't affect timing of other operations in the series)?
- or "Send email" gets executed synchronously (e.g. controller delays execution of other operations in the series until Send Email succeeded)?
- if "Send Email" failed (for example, because of bad Internet connection), does controller retries to send email later? What's the retry interval? Does it retry indefinitely?
- Is it advisable to run local SMTP server to minimize impact on rule execution?
-
Corrupted database?
I noticed the following errors in the mycontroller.log:
2017-03-20 22:35:20,144 INFO [Quartz_Scheduler_Worker-5] [org.mycontroller.standalone.email.EmailUtils:57] EmailSettings(smtpHost=smtp.gmail.com, smtpPort=465, fromAddress=8768768@gmail.com, enableSsl=true, useStartTLS=false, smtpUsername=8768768) 2017-03-20 22:35:22,231 ERROR [Quartz_Scheduler_Worker-5] [org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl:279] unable to update item:[OperationTable(id=1, enabled=true, user=User(id=1, enabled=null, username=null, fullName=null, email=null, validity=null, permissions=[Super admin], allowedResources=AllowedResources(userId=1, gatewayIds=[-1], nodeIds=[-1], sensorIds=[-1], sensorVariableIds=[-1], mqttReadTopics=[], mqttWriteTopics=[])), name=Send notification email, type=SEND_EMAIL, lastExecution=1490042122174, properties={template=Event notification.html, toEmailAddress=8768768@gmail.com, templateBindings={notification=Rule definition: Disarm Alarm\nCondition: Script [ conditions/IsAlarmDisarmed.groovy <= {} ]\nPresent value: null\nTriggered at: Mar 20, 2017 10:35:20 PM IST\n--- www.mycontroller.org}, emailSubject=Motion sensor})] java.sql.SQLException: Unable to run update stmt on object OperationTable(id=1, enabled=true, user=User(id=1, enabled=null, username=null, fullName=null, email=null, validity=null, permissions=[Super admin], allowedResources=AllowedResources(userId=1, gatewayIds=[-1], nodeIds=[-1], sensorIds=[-1], sensorVariableIds=[-1], mqttReadTopics=[], mqttWriteTopics=[])), name=Send notification email, type=SEND_EMAIL, lastExecution=1490042122174, properties={template=Event notification.html, toEmailAddress=8768768@gmail.com, templateBindings={notification=Rule definition: Disarm Alarm Condition: Script [ conditions/IsAlarmDisarmed.groovy <= {} ] Present value: null Triggered at: Mar 20, 2017 10:35:20 PM IST --- www.mycontroller.org}, emailSubject=Motion sensor}): UPDATE `operation` SET `enabled` = ?, `userId` = ?, `name` = ?, `type` = ?, `lastExecution` = ?, `properties` = ? WHERE `id` = ? at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:25) at com.j256.ormlite.stmt.mapped.MappedUpdate.update(MappedUpdate.java:129) at com.j256.ormlite.stmt.StatementExecutor.update(StatementExecutor.java:472) at com.j256.ormlite.dao.BaseDaoImpl.update(BaseDaoImpl.java:409) at org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl.update(BaseAbstractDaoImpl.java:276) at org.mycontroller.standalone.operation.model.OperationSendEmail.execute(OperationSendEmail.java:148) at org.mycontroller.standalone.rule.McRuleBase.execute(McRuleBase.java:188) at org.easyrules.core.DefaultRulesEngine.applyRules(DefaultRulesEngine.java:162) at org.easyrules.core.DefaultRulesEngine.fireRules(DefaultRulesEngine.java:118) at org.mycontroller.standalone.rule.McRuleEngine.execute(McRuleEngine.java:97) at org.mycontroller.standalone.rule.McRuleEngine.doRun(McRuleEngine.java:128) at org.knowm.sundial.Job.execute(Job.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:178) at org.quartz.core.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:515) Caused by: java.sql.SQLException: Could not write serialized object to byte array: {template=Event notification.html, toEmailAddress=8768768@gmail.com, templateBindings={notification=Rule definition: Disarm Alarm Condition: Script [ conditions/IsAlarmDisarmed.groovy <= {} ] Present value: null Triggered at: Mar 20, 2017 10:35:20 PM IST --- www.mycontroller.org}, emailSubject=Motion sensor} at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:27) at com.j256.ormlite.field.types.SerializableType.javaToSqlArg(SerializableType.java:83) at com.j256.ormlite.field.FieldType.convertJavaFieldToSqlArgValue(FieldType.java:652) at com.j256.ormlite.field.FieldType.extractJavaFieldToSqlArgValue(FieldType.java:638) at com.j256.ormlite.stmt.mapped.BaseMappedStatement.getFieldObjects(BaseMappedStatement.java:45) at com.j256.ormlite.stmt.mapped.MappedUpdate.update(MappedUpdate.java:94) ... 12 common frames omitted Caused by: java.io.NotSerializableException: org.mycontroller.standalone.operation.Notification at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at java.util.HashMap.internalWriteEntries(HashMap.java:1785) at java.util.HashMap.writeObject(HashMap.java:1362) at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at java.util.HashMap.internalWriteEntries(HashMap.java:1785) at java.util.HashMap.writeObject(HashMap.java:1362) at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at com.j256.ormlite.field.types.SerializableType.javaToSqlArg(SerializableType.java:78) ... 16 common frames omitted 2017-03-20 22:35:22,251 ERROR [Quartz_Scheduler_Worker-5] [org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl:279] unable to update item:[OperationTable(id=1, enabled=true, user=User(id=1, enabled=null, username=null, fullName=null, email=null, validity=null, permissions=[Super admin], allowedResources=AllowedResources(userId=1, gatewayIds=[-1], nodeIds=[-1], sensorIds=[-1], sensorVariableIds=[-1], mqttReadTopics=[], mqttWriteTopics=[])), name=Send notification email, type=SEND_EMAIL, lastExecution=1490042122237, properties={template=Event notification.html, toEmailAddress=8768768@gmail.com, templateBindings={notification=Rule definition: Disarm Alarm\nCondition: Script [ conditions/IsAlarmDisarmed.groovy <= {} ]\nPresent value: null\nTriggered at: Mar 20, 2017 10:35:20 PM IST\n--- www.mycontroller.org}, emailSubject=Motion sensor})] java.sql.SQLException: Unable to run update stmt on object OperationTable(id=1, enabled=true, user=User(id=1, enabled=null, username=null, fullName=null, email=null, validity=null, permissions=[Super admin], allowedResources=AllowedResources(userId=1, gatewayIds=[-1], nodeIds=[-1], sensorIds=[-1], sensorVariableIds=[-1], mqttReadTopics=[], mqttWriteTopics=[])), name=Send notification email, type=SEND_EMAIL, lastExecution=1490042122237, properties={template=Event notification.html, toEmailAddress=8768768@gmail.com, templateBindings={notification=Rule definition: Disarm Alarm Condition: Script [ conditions/IsAlarmDisarmed.groovy <= {} ] Present value: null Triggered at: Mar 20, 2017 10:35:20 PM IST --- www.mycontroller.org}, emailSubject=Motion sensor}): UPDATE `operation` SET `enabled` = ?, `userId` = ?, `name` = ?, `type` = ?, `lastExecution` = ?, `properties` = ? WHERE `id` = ? at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:25) at com.j256.ormlite.stmt.mapped.MappedUpdate.update(MappedUpdate.java:129) at com.j256.ormlite.stmt.StatementExecutor.update(StatementExecutor.java:472) at com.j256.ormlite.dao.BaseDaoImpl.update(BaseDaoImpl.java:409) at org.mycontroller.standalone.db.dao.BaseAbstractDaoImpl.update(BaseAbstractDaoImpl.java:276) at org.mycontroller.standalone.rule.McRuleBase.execute(McRuleBase.java:190) at org.easyrules.core.DefaultRulesEngine.applyRules(DefaultRulesEngine.java:162) at org.easyrules.core.DefaultRulesEngine.fireRules(DefaultRulesEngine.java:118) at org.mycontroller.standalone.rule.McRuleEngine.execute(McRuleEngine.java:97) at org.mycontroller.standalone.rule.McRuleEngine.doRun(McRuleEngine.java:128) at org.knowm.sundial.Job.execute(Job.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:178) at org.quartz.core.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:515) Caused by: java.sql.SQLException: Could not write serialized object to byte array: {template=Event notification.html, toEmailAddress=8768768@gmail.com, templateBindings={notification=Rule definition: Disarm Alarm Condition: Script [ conditions/IsAlarmDisarmed.groovy <= {} ] Present value: null Triggered at: Mar 20, 2017 10:35:20 PM IST --- www.mycontroller.org}, emailSubject=Motion sensor} at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:27) at com.j256.ormlite.field.types.SerializableType.javaToSqlArg(SerializableType.java:83) at com.j256.ormlite.field.FieldType.convertJavaFieldToSqlArgValue(FieldType.java:652) at com.j256.ormlite.field.FieldType.extractJavaFieldToSqlArgValue(FieldType.java:638) at com.j256.ormlite.stmt.mapped.BaseMappedStatement.getFieldObjects(BaseMappedStatement.java:45) at com.j256.ormlite.stmt.mapped.MappedUpdate.update(MappedUpdate.java:94) ... 11 common frames omitted Caused by: java.io.NotSerializableException: org.mycontroller.standalone.operation.Notification at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at java.util.HashMap.internalWriteEntries(HashMap.java:1785) at java.util.HashMap.writeObject(HashMap.java:1362) at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at java.util.HashMap.internalWriteEntries(HashMap.java:1785) at java.util.HashMap.writeObject(HashMap.java:1362) at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at com.j256.ormlite.field.types.SerializableType.javaToSqlArg(SerializableType.java:78) ... 15 common frames omitted
Do I need to repair database?
Is SQLite more reliable than default DB engine?
How would I migrate? -
RE: Triggering rule through the HTTP request
Here is a sample REST API call that modifies MyController repository variable:
curl -X PUT -H "Content-Type: application/json" -d '{"key":"Var1","value":"222"}' "http://demo:demo@demo.mycontroller.org/mc/rest/variables"
-
RE: Triggering rule through the HTTP request
Looks like I could replace client that pushes data through REST API with a rule that uses condition script.
Condition script could read external file and return true/false accordingly.How often MyController executes condition script (linked to the rule)? Every 5sec?
-
RE: Triggering rule through the HTTP request
@jkandasa said:
@benya For now there is no doc for REST API. You have to refer source code.
Are there any samples?
I need to pass credentials and trigger some operation.Besides REST API, MyController supports any other IPC?
May I trigger operation from external app or shell script on the same host? -
RE: Synchronization between rules and timer handlers
@jkandasa said:
@benya Do you face any issue with out Synchronization?
I face potential issue in the following scenario:
- multiple PIRs tigger rule that reads/writes global variable and disables/enables timer
- timer reads global variable as well
- timer has counter=1 and self-disables when triggered
Therefore I need to synchronize access to the global variable and modifications of timer object.
Otherwise global variable and timer could be left in an unexpected state. -
RE: Triggering rule through the HTTP request
Where could I lookup REST API samples or docs?
-
RE: Synchronization between rules and timer handlers
Is any <String, Object> map accessible to Groovy scripts?
It would be possible to store there generic objects and use them for synchronization. -
RE: Synchronization between rules and timer handlers
@jkandasa We need some mechanism to prevent race condition.