Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Creating Mango Persistent TCP publisher causes fatal error


  • I was attempting to create a Mango Persistent TCP publisher on a MangoGT, and I got an error. The transient banner went away, but kept repeating. I attempted to restart the Mango instance, but now it fails to come up.

    Here is the log:

    ERROR 2020-03-11T15:40:48,147 (com.serotonin.m2m2.Main.main:162) - Error during initialization
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select e.id, e.typeName, e.subtypeName, e.typeRef1, e.typeRef2, e.activeTs, e.rtnApplicable, e.rtnTs,   e.rtnCause, e.alar
    mLevel, e.message, e.ackTs, e.ackUserId, u.username, e.alternateAckSource,   (select count(1) from userComments where commentType=1     and typeKey=e.id) as cnt from events e   left join users u on e.ackUserId=u.id where e.rtnApplicable=
    ? and e.rtnTs is null]; SQL state [HY000]; error code [50000]; General error: "java.lang.RuntimeException: page[49090] data leaf table:103 EVENTS entries:12 parent:46488 keys:[264424, 264425, 264426, 264427, 264428, 264429, 264430, 26443
    1, 264432, 264433, 264434, 264435] offsets:[3897, 3696, 3502, 3308, 3112, 3038, 2836, 2636, 2434, 2234, 2031, 1823] parent 46488 expected 50476"; SQL statement:
    select e.id, e.typeName, e.subtypeName, e.typeRef1, e.typeRef2, e.activeTs, e.rtnApplicable, e.rtnTs,   e.rtnCause, e.alarmLevel, e.message, e.ackTs, e.ackUserId, u.username, e.alternateAckSource,   (select count(1) from userComments where commentType=1     and typeKey=e.id) as cnt from events e   left join users u on e.ackUserId=u.id where e.rtnApplicable=? and e.rtnTs is null [50000-199]; nested exception is org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.RuntimeException: page[49090] data leaf table:103 EVENTS entries:12 parent:46488 keys:[264424, 264425, 264426, 264427, 264428, 264429, 264430, 264431, 264432, 264433, 264434, 264435] offsets:[3897, 3696, 3502, 3308, 3112, 3038, 2836, 2636, 2434, 2234, 2031, 1823] parent 46488 expected 50476"; SQL statement:
    select e.id, e.typeName, e.subtypeName, e.typeRef1, e.typeRef2, e.activeTs, e.rtnApplicable, e.rtnTs,   e.rtnCause, e.alarmLevel, e.message, e.ackTs, e.ackUserId, u.username, e.alternateAckSource,   (select count(1) from userComments where commentType=1     and typeKey=e.id) as cnt from events e   left join users u on e.ackUserId=u.id where e.rtnApplicable=? and e.rtnTs is null [50000-199]
            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1442) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:632) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:668) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:699) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:711) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:762) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at com.serotonin.db.DaoUtils.query(DaoUtils.java:250) ~[mango-3.7.4.jar:?]
            at com.serotonin.m2m2.db.dao.EventDao.getActiveEvents(EventDao.java:198) ~[mango-3.7.4.jar:?]
            at com.serotonin.m2m2.rt.EventManagerImpl.initialize(EventManagerImpl.java:865) ~[mango-3.7.4.jar:?]
            at com.serotonin.m2m2.Lifecycle.eventManagerInitialize(Lifecycle.java:762) ~[ma-priv-3.7.4.jar:?]
            at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:322) ~[ma-priv-3.7.4.jar:?]
            at com.serotonin.m2m2.Main.main(Main.java:159) ~[ma-priv-3.7.4.jar:?]
    Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.RuntimeException: page[49090] data leaf table:103 EVENTS entries:12 parent:46488 keys:[264424, 264425, 264426, 264427, 264428, 264429, 264430, 264431, 264432, 264433, 264434, 264435] offsets:[3897, 3696, 3502, 3308, 3112, 3038, 2836, 2636, 2434, 2234, 2031, 1823] parent 46488 expected 50476"; SQL statement:
    select e.id, e.typeName, e.subtypeName, e.typeRef1, e.typeRef2, e.activeTs, e.rtnApplicable, e.rtnTs,   e.rtnCause, e.alarmLevel, e.message, e.ackTs, e.ackUserId, u.username, e.alternateAckSource,   (select count(1) from userComments where commentType=1     and typeKey=e.id) as cnt from events e   left join users u on e.ackUserId=u.id where e.rtnApplicable=? and e.rtnTs is null [50000-199]
            at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.message.DbException.get(DbException.java:194) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.message.DbException.convert(DbException.java:347) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.Command.executeQuery(Command.java:219) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115) ~[h2-1.4.199.jar:1.4.199]
            at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:677) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:616) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            ... 10 more
    Caused by: java.lang.RuntimeException: page[49090] data leaf table:103 EVENTS entries:12 parent:46488 keys:[264424, 264425, 264426, 264427, 264428, 264429, 264430, 264431, 264432, 264433, 264434, 264435] offsets:[3897, 3696, 3502, 3308, 3112, 3038, 2836, 2636, 2434, 2234, 2031, 1823] parent 46488 expected 50476
            at org.h2.message.DbException.throwInternalError(DbException.java:293) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:219) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageDataNode.getRowWithKey(PageDataNode.java:278) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageDataNode.getRowWithKey(PageDataNode.java:279) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageDataIndex.getRowWithKey(PageDataIndex.java:387) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:376) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.table.PageStoreTable.getRow(PageStoreTable.java:84) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:303) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:45) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.IndexCursor.get(IndexCursor.java:274) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.table.TableFilter.getValue(TableFilter.java:1092) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:215) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.IndexCondition.getCurrentValue(IndexCondition.java:138) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.IndexCursor.prepare(IndexCursor.java:108) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.index.IndexCursor.find(IndexCursor.java:154) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.table.TableFilter.next(TableFilter.java:475) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.table.TableFilter.next(TableFilter.java:545) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1882) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.result.LazyResult.hasNext(LazyResult.java:101) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.result.LazyResult.next(LazyResult.java:60) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.dml.Select.queryFlat(Select.java:742) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.dml.Select.queryWithoutCache(Select.java:884) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:151) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.dml.Query.query(Query.java:435) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.dml.Query.query(Query.java:397) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.CommandContainer.query(CommandContainer.java:145) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.command.Command.executeQuery(Command.java:202) ~[h2-1.4.199.jar:1.4.199]
            at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115) ~[h2-1.4.199.jar:1.4.199]
            at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:677) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:616) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            ... 10 more
    INFO  2020-03-11T15:40:48,149 (com.serotonin.m2m2.Lifecycle.terminate:400) - Mango Lifecycle terminating...
    INFO  2020-03-11T15:40:48,226 (com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl.joinTermination:550) - All high priority tasks exited gracefully.
    INFO  2020-03-11T15:40:48,228 (com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl.joinTermination:556) - All medium priority tasks exited gracefully.
    INFO  2020-03-11T15:40:48,229 (com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl.joinTermination:561) - All low priority tasks exited gracefully.
    INFO  2020-03-11T15:40:48,267 (com.infiniteautomation.mango.spring.components.executors.MangoExecutors.destroy:71) - Shutting down shared executor and scheduled exectutor
    INFO  2020-03-11T15:40:48,271 (com.infiniteautomation.mango.spring.components.executors.MangoExecutors.awaitTermination:129) - Executors shutdown successfully
    INFO  2020-03-11T15:40:48,284 (com.serotonin.m2m2.db.H2Proxy.terminateImpl:406) - Terminating database.
    INFO  2020-03-11T15:40:48,575 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:116) - Terminating NoSQL Batch Write Manager.
    INFO  2020-03-11T15:40:48,577 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:241) - Terminating NoSQL Point Value Mover.
    INFO  2020-03-11T15:40:48,580 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:266) - Terminating NoSQL Stale Point Cleaner.
    INFO  2020-03-11T15:40:48,582 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:269) - Terminating NoSQL Status Provider.
    INFO  2020-03-11T15:40:48,584 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:124) - Closing NoSQL Database: Point Values
    INFO  2020-03-11T15:40:48,625 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:132) - Closing NoSQL Database: Point Data
    INFO  2020-03-11T15:40:48,635 (com.serotonin.m2m2.Lifecycle.terminate:550) - Mango Lifecycle terminated.
    
    

    Unfortunately, it seems the logs may not have captured the original error I briefly saw during the attempt to create the publisher. Is there another place I could look? Or is this log enough for you to identify the problem?

    Aldo


  • @AldoRamos it looks like the database was corrupted. I would restore from a backup if possible. If not there are h2 tools to attempt recovery. Might want to just check you disk isn't full.

    Here is one such post by Phillip,

    https://forum.infiniteautomation.com/topic/4073/corrupt-h2-database