• cbyrne

    @terrypacker Sorry for dredging up an old thread but I ran the same DELETE FROM EVENTS; as before but this time mango has failed to restart. It gets an out of bounds error when connecting to H2.

    INFO  2020-06-10T18:38:06,912 (com.serotonin.m2m2.db.H2Proxy.initializeImpl:61) - Initializing H2 connection manager 
    INFO  2020-06-10T18:38:06,953 (com.serotonin.m2m2.db.H2Proxy.initializeImpl:83) - Initializing H2 web server 
    FATAL 2020-06-10T18:38:07,527 (com.serotonin.m2m2.db.AbstractDatabaseProxy.initialize:163) - Unable to connect to database of type H2 
    org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [50000-199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:611) ~[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 com.serotonin.db.spring.ExtendedJdbcTemplate.queryForObject(ExtendedJdbcTemplate.java:39) ~[mango-3.6.5.jar:?]
    	at com.serotonin.db.spring.ExtendedJdbcTemplate.queryForObject(ExtendedJdbcTemplate.java:63) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.H2Proxy.tableExists(H2Proxy.java:405) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.AbstractDatabaseProxy.newDatabaseCheck(AbstractDatabaseProxy.java:181) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.AbstractDatabaseProxy.initialize(AbstractDatabaseProxy.java:82) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.Lifecycle.databaseInitialize(Lifecycle.java:760) ~[ma-priv-3.6.5.jar:?]
    	at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:312) ~[ma-priv-3.6.5.jar:?]
    	at com.serotonin.m2m2.Main.main(Main.java:143) ~[ma-priv-3.6.5.jar:?]
    Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [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.engine.Database.openDatabase(Database.java:345) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.<init>(Database.java:313) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:201) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:161) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:31) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199) ~[h2-1.4.199.jar:1.4.199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	... 12 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    	at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:329) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.index.PageDataCursor.nextRow(PageDataCursor.java:67) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.index.PageDataCursor.next(PageDataCursor.java:40) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.table.PageStoreTable.addIndex(PageStoreTable.java:222) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.open(Database.java:827) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.openDatabase(Database.java:319) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.<init>(Database.java:313) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:201) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:161) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:31) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199) ~[h2-1.4.199.jar:1.4.199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	... 12 more
    ERROR 2020-06-10T18:38:07,527 (com.serotonin.m2m2.Main.main:146) - Error during initialization 
    org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [50000-199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:611) ~[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 com.serotonin.db.spring.ExtendedJdbcTemplate.queryForObject(ExtendedJdbcTemplate.java:39) ~[mango-3.6.5.jar:?]
    	at com.serotonin.db.spring.ExtendedJdbcTemplate.queryForObject(ExtendedJdbcTemplate.java:63) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.H2Proxy.tableExists(H2Proxy.java:405) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.AbstractDatabaseProxy.newDatabaseCheck(AbstractDatabaseProxy.java:181) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.AbstractDatabaseProxy.initialize(AbstractDatabaseProxy.java:82) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.Lifecycle.databaseInitialize(Lifecycle.java:760) ~[ma-priv-3.6.5.jar:?]
    	at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:312) ~[ma-priv-3.6.5.jar:?]
    	at com.serotonin.m2m2.Main.main(Main.java:143) ~[ma-priv-3.6.5.jar:?]
    Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [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.engine.Database.openDatabase(Database.java:345) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.<init>(Database.java:313) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:201) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:161) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:31) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199) ~[h2-1.4.199.jar:1.4.199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	... 12 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    	at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:329) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.index.PageDataCursor.nextRow(PageDataCursor.java:67) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.index.PageDataCursor.next(PageDataCursor.java:40) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.table.PageStoreTable.addIndex(PageStoreTable.java:222) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.open(Database.java:827) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.openDatabase(Database.java:319) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.<init>(Database.java:313) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:201) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:161) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:31) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199) ~[h2-1.4.199.jar:1.4.199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	... 12 more
    INFO  2020-06-10T18:38:07,527 (com.serotonin.m2m2.Lifecycle.terminate:427) - Mango Lifecycle terminating... 
    INFO  2020-06-10T18:38:07,559 (com.serotonin.m2m2.db.H2Proxy.terminateImpl:394) - Terminating database. 
    ERROR 2020-06-10T18:38:07,823 (com.serotonin.m2m2.Lifecycle.terminate:563) - Failed to terminate database. 
    org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [50000-199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:370) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:417) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at com.serotonin.m2m2.db.H2Proxy.runScript(H2Proxy.java:280) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.H2Proxy.terminateImpl(H2Proxy.java:395) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.db.AbstractDatabaseProxy.terminate(AbstractDatabaseProxy.java:211) ~[mango-3.6.5.jar:?]
    	at com.serotonin.m2m2.Lifecycle.databaseTerminate(Lifecycle.java:765) ~[ma-priv-3.6.5.jar:?]
    	at com.serotonin.m2m2.Lifecycle.terminate(Lifecycle.java:561) ~[ma-priv-3.6.5.jar:?]
    	at com.serotonin.m2m2.Main.main(Main.java:147) ~[ma-priv-3.6.5.jar:?]
    Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [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.engine.Database.openDatabase(Database.java:345) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.<init>(Database.java:313) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:201) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:161) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:31) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199) ~[h2-1.4.199.jar:1.4.199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	... 8 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    	at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:329) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.index.PageDataCursor.nextRow(PageDataCursor.java:67) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.index.PageDataCursor.next(PageDataCursor.java:40) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.table.PageStoreTable.addIndex(PageStoreTable.java:222) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.open(Database.java:827) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.openDatabase(Database.java:319) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Database.<init>(Database.java:313) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.openSession(Engine.java:201) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:161) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.Engine.createSession(Engine.java:31) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:336) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:169) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:148) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:189) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcDataSource.getPooledConnection(JdbcDataSource.java:384) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow(JdbcConnectionPool.java:234) ~[h2-1.4.199.jar:1.4.199]
    	at org.h2.jdbcx.JdbcConnectionPool.getConnection(JdbcConnectionPool.java:199) ~[h2-1.4.199.jar:1.4.199]
    	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    	... 8 more
    INFO  2020-06-10T18:38:07,826 (com.serotonin.m2m2.Lifecycle.terminate:578) - Mango Lifecycle terminated. 
    

    Running the web console manually gives the same out of bounds error when the connection is tested.

    General error: "java.lang.ArrayIndexOutOfBoundsException: 0" [50000-199] HY000/50000
    

    Update

    Managed to get it fixed (after a database restore) by:

    1. SET REFERENTIAL_INTEGRITY FALSE;
    2. TRUNCATE TABLE EVENTS;
    3. SET REFERENTIAL_INTEGRITY TRUE;
    4. TRUNCATE TABLE USEREVENTS;
    5. Restart Mango

    Database went from 6Gb to 17Mb.

    posted in User help read more
  • cbyrne

    I really only want to set a low limit, what is a safe max for the datatype that holds the high set limit?

    posted in User help read more
  • cbyrne

    Trying to get a superscript on an axis title:

    options='{
        valueAxes:[{
            title: "m[baseline-shift: super]3[/]"
        }]
    }'
    

    produces the entire unformatted string as the title.

    posted in User help read more
  • cbyrne

    @mattfox Couldn't see much change unfortunately. When graphing at 1 hour deltas, at best it just brings the previous hour into the graph.

    posted in User help read more
  • cbyrne

    @craigweb Ah awesome! Thanks Craig.

    posted in Wishlist read more
  • cbyrne

    When creating a user account for a client, I have to set their password, send it to them and then request that they then change it themselves.

    Ideally, I'd like to be able to set a flag forcing the user to set a new password on login. Either that or perhaps create the user account via email invitation where the invitation link brings them to a page for password creation.

    posted in Wishlist read more
  • cbyrne

    Just wondering if there's been any movement on the delta statistics issue from a few months back?

    Associated thread: https://forum.infiniteautomation.com/topic/4413/rollup-value-calculations-and-no-values-for-15m-intervals
    Associated public github issue: https://github.com/infiniteautomation/ma-core-public/issues/1480

    Unfortunately, this issue is causing us problems as our clients' primary need is for correct energy usage statistics/graphs.

    Thanks!

    posted in User help read more
  • cbyrne

    Perfect, thanks @terrypacker! I'll try that and update this post.

    update 1:
    The H2 database shell doesn't recognise LIKE in CREATE TABLE. It may not be supported, The H2 command info for CREATE DATABASE doesn't show LIKE - https://www.h2database.com/html/commands.html#create_table

    update 2
    I just did a DELETE FROM EVENTS; instead.

    So yeah, there might have been a few too many events... 12 million. The database has gone from ~6 Gb to 76 Mb.

    posted in User help read more
  • cbyrne

    @terrypacker Hi Terry, I am just continuing @petermcs's work and have the jmap -hist outputs.

    Before:

     num     #instances         #bytes  class name
    ----------------------------------------------
       1:        173771      715822488  [I
       2:       3748110      508063720  [C
       3:       1945314      443221056  [B
       4:       1733728       41609472  java.lang.String
       5:       1973991       37379904  [Ljava.lang.Class;
       6:        478710       23272440  [Ljava.lang.Object;
       7:             1       16777232  [Lorg.h2.util.CacheObject;
       8:        151493       11321608  [Ljava.util.HashMap$Node;
       9:        228571       10971408  java.util.HashMap
      10:        168383       10776512  java.net.URL
      11:        318951       10206432  java.util.HashMap$Node
      12:         99723        9573408  java.util.jar.JarFile$JarFileEntry
      13:        101097        8896536  java.lang.reflect.Method
      14:         99443        7955440  java.util.zip.ZipEntry
      15:        194720        7788800  java.util.LinkedHashMap$Entry
      16:        262144        6291456  org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapper
      17:        107562        6023472  java.util.LinkedHashMap
      18:        211916        5085984  java.lang.StringBuilder
      19:        155322        4970304  java.util.LinkedHashMap$LinkedEntryIterator
      20:        132436        4237952  java.util.ArrayList$Itr
      21:        106631        4096384  [Ljava.lang.String;
      22:         48305        3915312  [S
      23:        103984        3635760  [Ljava.lang.reflect.Method;
      24:        148571        3565704  java.util.ArrayList
      25:        145630        3495120  org.springframework.core.annotation.AnnotationUtils$AnnotationCacheKey
      26:        213448        3415168  java.util.HashSet
      27:         57295        3208520  org.springframework.asm.Label
      28:          5081        3195656  [J
      29:         37779        3022320  java.lang.reflect.Constructor
      30:         89701        2870432  java.io.File
      31:         59175        2840400  java.nio.HeapByteBuffer
      32:        168665        2698640  java.lang.Integer
      33:         16617        2641896  [Lorg.springframework.asm.Label;
      34:         73858        2363456  java.util.concurrent.ConcurrentHashMap$Node
      35:         89469        2147256  java.lang.Class$MethodArray
      36:         44728        2146944  org.springframework.core.ResolvableType
      37:         81522        1956528  java.util.LinkedList$Node
      38:         32363        1812328  org.springframework.asm.SymbolTable$Entry
      39:         15886        1783136  java.lang.Class
      40:         52571        1682272  java.util.LinkedHashMap$LinkedKeyIterator
      41:         22174        1596528  org.springframework.core.annotation.AnnotationAttributes
      42:         32146        1543008  org.springframework.util.ConcurrentReferenceHashMap$SoftEntryReference
      43:         57998        1391952  java.util.concurrent.CopyOnWriteArrayList$COWIterator
      44:         42207        1350624  org.springframework.asm.Type
      45:         29777        1191080  java.lang.ref.Finalizer
      46:         36791        1177312  java.util.AbstractList$Itr
      47:         65801        1052816  sun.reflect.ConstantPool
      48:          9550         993200  sun.net.www.protocol.file.FileURLConnection
      49:         19600         940800  org.springframework.asm.Frame
      50:         22090         883600  com.serotonin.bacnet4j.util.sero.ByteQueue
      51:         37028         864280  [Ljava.lang.reflect.Type;
      52:         35583         853992  org.springframework.asm.Edge
      53:          1968         826856  [Ljava.util.concurrent.ConcurrentHashMap$Node;
      54:         25594         819008  java.util.concurrent.locks.AbstractQueuedSynchronizer$Node
      55:         50928         814848  java.lang.Object
      56:         25147         804704  java.util.LinkedHashMap$LinkedValueIterator
      57:         24671         789472  java.util.LinkedList
      58:         49091         785456  org.springframework.core.annotation.AnnotationUtils$DefaultValueHolder
      59:         13853         775768  org.springframework.core.type.classreading.MethodMetadataReadingVisitor
      60:         13740         769440  jdk.internal.org.objectweb.asm.Item
      61:         31486         755664  java.util.Arrays$ArrayList
      62:         46717         747472  java.util.LinkedHashSet
      63:         17178         687120  java.lang.invoke.MethodType
      64:          9400         676800  java.lang.reflect.Field
      65:         27985         671640  sun.reflect.generics.tree.SimpleClassTypeSignature
      66:         26545         637080  sun.reflect.generics.visitor.Reifier
      67:          2806         628544  org.springframework.asm.MethodWriter
      68:         11198         627088  java.lang.invoke.LambdaFormEditor$Transform
      69:         24021         576504  sun.reflect.generics.factory.CoreReflectionFactory
      70:         23902         573648  sun.reflect.generics.parser.SignatureParser
      71:         10093         565208  java.util.zip.ZipFile$ZipFileInputStream
      72:         10089         564984  java.util.zip.ZipFile$ZipFileInflaterInputStream
      73:         23307         559368  sun.reflect.generics.scope.ClassScope
      74:         17324         554368  java.lang.invoke.MethodType$ConcurrentWeakInternSet$WeakEntry
      75:         13514         540560  java.util.HashMap$KeyIterator
      76:         16637         532384  java.lang.ref.WeakReference
      77:         13288         531520  java.util.HashMap$EntryIterator
      78:          6026         530288  sun.net.www.protocol.jar.JarURLConnection
      79:         16281         520992  java.util.RegularEnumSet
      80:         31992         511872  java.util.LinkedHashMap$LinkedKeySet
      81:         18654         507960  [Ljava.lang.annotation.Annotation;
      82:         15760         504320  org.springframework.util.ConcurrentReferenceHashMap$1
      83:         30116         498104  [Lsun.reflect.generics.tree.TypeArgument;
      84:          7673         491072  org.springframework.core.MethodParameter
      85:          5066         486336  sun.net.www.protocol.jar.URLJarFile$URLJarFileEntry
      86:         14914         477248  java.util.LinkedList$ListItr
      87:          5921         476640  [Ljava.util.WeakHashMap$Entry;
      88:          7171         458944  com.serotonin.timer.OrderedTaskInfo
      89:           394         452912  [Lorg.springframework.asm.SymbolTable$Entry;
      90:         18617         446808  org.springframework.core.annotation.AnnotatedElementUtils$MergedAnnotationAttributesProcessor
      91:         27787         444592  sun.reflect.generics.tree.ClassTypeSignature
      92:         11069         442760  sun.nio.cs.UTF_8$Decoder
      93:          6897         441408  java.util.regex.Matcher
      94:         13780         440960  org.springframework.core.annotation.AnnotationUtils$$Lambda$48/1194398327
      95:          5356         428480  sun.net.www.protocol.jar.URLJarFile
      96:          7588         424928  com.serotonin.bacnet4j.npdu.NPCI
      97:         19494         420832  [Lorg.springframework.asm.Type;
      98:         12977         415264  java.lang.reflect.WeakCache$CacheKey
      99:         17180         412320  org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource$DefaultCacheKey
     100:         12269         392608  java.util.Hashtable$Entry
    
    Total      16594285     2034054440
    
    

    After opening a browser window and logging in, greeted by the admin page and an immediate "connectivity lost, restoring connection" toast message that never permenantly resolves.
    It then takes about 3-5 minutes to max out

    
     num     #instances         #bytes  class name
    ----------------------------------------------
       1:      51017979     3130737016  [C
       2:      51017618     1224422832  java.lang.String
       3:      10175891      895478408  com.serotonin.m2m2.rt.event.EventInstance
       4:      20380459      550396632  [Ljava.lang.Object;
       5:      20352135      488451240  com.serotonin.m2m2.i18n.TranslatableMessage
       6:      10175862      325627584  com.serotonin.m2m2.rt.event.type.DataSourceEventType
       7:        469887      198080400  [B
       8:       1599229       87706096  [Lorg.h2.value.Value;
       9:       1248203       39942496  org.h2.result.RowImpl
      10:        425490       30635280  org.h2.value.ValueLobDb
      11:        828920       26525440  org.h2.result.SimpleRowValue
      12:             1       16777232  [Lorg.h2.util.CacheObject;
      13:         45454       15596376  [I
      14:         31155       12509192  [J
      15:        438464        7015424  org.h2.value.ValueInt
      16:        265342        6368208  org.h2.value.ValueLong
      17:        262144        6291456  org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapper
      18:         30244        5475296  [Lorg.h2.result.Row;
      19:         85336        3413440  java.util.LinkedHashMap$Entry
      20:          2874        3363200  [Lorg.h2.result.SearchRow;
      21:         30243        3145272  org.h2.index.PageDataLeaf
      22:         28393        2498584  java.lang.reflect.Method
      23:         28704        2297592  [Ljava.util.HashMap$Node;
      24:         66713        2134816  java.util.HashMap$Node
      25:         60656        1940992  java.util.concurrent.ConcurrentHashMap$Node
      26:         16839        1888904  java.lang.Class
      27:         23457        1313592  java.util.LinkedHashMap
      28:         33277        1064864  org.h2.store.Data
      29:           608         741064  [Ljava.util.concurrent.ConcurrentHashMap$Node;
      30:          8489         611208  org.springframework.core.annotation.AnnotationAttributes
      31:         26206         593480  [Ljava.lang.Class;
      32:          7131         513432  java.lang.reflect.Field
      33:         31170         498720  java.lang.Object
      34:         10792         476208  [Ljava.lang.String;
      35:         18951         454824  java.util.ArrayList
      36:          9363         449424  java.util.HashMap
      37:         15410         369840  org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource$DefaultCacheKey
      38:          4273         341840  java.lang.reflect.Constructor
      39:          9479         303328  java.util.LinkedList
      40:          9008         288256  java.util.Hashtable$Entry
      41:         11579         277896  java.util.LinkedList$Node
      42:         17155         274480  org.springframework.core.annotation.AnnotationUtils$DefaultValueHolder
      43:         11080         265920  org.h2.value.ValueRow
      44:          2851         228080  org.h2.index.PageBtreeLeaf
      45:          4539         181560  java.lang.ref.SoftReference
      46:          2998         167888  java.lang.Class$ReflectionData
      47:         10089         161424  java.util.LinkedHashMap$LinkedEntrySet
      48:          9949         159184  java.util.LinkedHashSet
      49:          3796         151840  javax.servlet.jsp.tagext.TagAttributeInfo
      50:          2614         146384  java.lang.invoke.MemberName
      51:          6080         145920  java.util.jar.Attributes$Name
      52:          5878         141072  sun.reflect.generics.tree.SimpleClassTypeSignature
      53:          3514         140560  java.util.TreeMap$Entry
      54:          2734         140264  [Ljava.lang.reflect.Method;
      55:             4         131136  [Ljava.util.concurrent.ForkJoinTask;
      56:          1807         130104  org.springframework.web.method.HandlerMethod$HandlerMethodParameter
      57:          3164         126560  jdk.nashorn.internal.runtime.CompiledFunction
      58:          2488         119424  org.springframework.core.ResolvableType
      59:          1796         114944  java.net.URL
      60:          5878         109584  [Lsun.reflect.generics.tree.TypeArgument;
      61:          1890         105840  jdk.nashorn.internal.runtime.ScriptFunction
      62:           488         105720  [Ljava.util.Hashtable$Entry;
      63:          4046          97104  sun.reflect.annotation.AnnotationInvocationHandler
      64:          1483          94912  java.util.concurrent.ConcurrentHashMap
      65:          3898          93696  [Lorg.springframework.core.annotation.AnnotationAttributes;
      66:          1056          92928  org.h2.table.Column
      67:          5702          91232  sun.reflect.generics.tree.ClassTypeSignature
      68:           543          91224  org.springframework.beans.factory.support.RootBeanDefinition
      69:          5543          88688  java.lang.Integer
      70:          1485          83160  java.security.Provider$Service
      71:          1904          76160  java.lang.invoke.BoundMethodHandle$Species_LL
      72:          4608          73728  java.util.LinkedHashMap$LinkedKeySet
      73:           973          70056  org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor
      74:          2944          70008  [Ljava.lang.reflect.Type;
      75:          2890          69360  java.security.Provider$ServiceKey
      76:           650          67600  org.h2.mvstore.Chunk
      77:          4151          66416  java.util.jar.Attributes
      78:          2063          66016  java.lang.ref.WeakReference
      79:          2036          65152  com.serotonin.bacnet4j.obj.PropertyTypeDefinition
      80:          2002          64064  jdk.nashorn.internal.runtime.FinalScriptFunctionData
      81:          1099          61544  java.lang.Package
      82:           162          61088  [Ljdk.nashorn.internal.runtime.PropertyHashMap$Element;
      83:          1507          60280  java.lang.invoke.MethodType
      84:          1497          59880  java.lang.ref.Finalizer
      85:           710          58992  [Ljava.util.WeakHashMap$Entry;
      86:            41          58216  [Ljava.nio.ByteBuffer;
      87:          2464          56256  [Ljava.lang.reflect.Constructor;
      88:           308          54208  org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$ConfigurationClassBeanDefinition
      89:          1123          53904  org.springframework.util.ConcurrentReferenceHashMap$SoftEntryReference
      90:          1648          52736  java.lang.invoke.DirectMethodHandle
      91:          1638          52416  jdk.nashorn.internal.runtime.PropertyHashMap$Element
      92:          1624          51968  java.lang.invoke.LambdaForm$Name
      93:           205          50840  com.serotonin.m2m2.vo.DataPointVO
      94:           880          49280  org.springframework.core.type.classreading.MethodMetadataReadingVisitor
      95:          2036          48864  com.serotonin.bacnet4j.obj.ObjectPropertyTypeDefinition
      96:          1519          48608  java.util.concurrent.locks.ReentrantLock$NonfairSync
      97:           432          48384  org.springframework.context.annotation.ScannedGenericBeanDefinition
      98:          1511          48352  java.lang.ref.ReferenceQueue
      99:          1508          48256  java.lang.invoke.MethodType$ConcurrentWeakInternSet$WeakEntry
     100:          1147          45880  java.math.BigInteger
    
    Total     169664483     7108600472
    

    I've limited it to the first 100 and totals, just to save post space. The full outputs ~7k can be sent on if needed.

    htop when things max out:
    0_1576156299362_htop.png

    posted in User help read more