• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. AlexHK

    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 Mango 5 Documentation Website
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 25
    • Best 0
    • Controversial 0
    • Groups 0

    AlexHK

    @AlexHK

    0
    Reputation
    1.0k
    Profile views
    25
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    AlexHK Unfollow Follow

    Latest posts made by AlexHK

    • RE: SQL error: duplicate key value in a unique or primary key: USEREVENTSPK' defined on 'USEREVENTS'.

      How would I delete everything from that table?

      I am a MySQL guy ;)

      I can get you more info on how that happened if you want me to. I can also zip/archive the complete folders + logs for you and share via Dropbox or Google Drive.

      posted in Mango Automation general Discussion
      A
      AlexHK
    • RE: SQL error: duplicate key value in a unique or primary key: USEREVENTSPK' defined on 'USEREVENTS'.

      Actually I have no idea. I just noticed one day it doesn't start up and this error is in the log when I try to start the deamon. Can't login, can't do anything.

      So what I was hoping for is that you know how to repair the tables. It's a system that is now out of production, but would be good to get it back to work. Otherwise I have to start from scratch ;)

      Next project we'll use MySQL and hopefully work with you guys doing the setup and all that (been in contact with Joel) .

      Alex

      posted in Mango Automation general Discussion
      A
      AlexHK
    • RE: SQL error: duplicate key value in a unique or primary key: USEREVENTSPK' defined on 'USEREVENTS'.

      We are trying to wrap up this project, but the error still persists. I can't get this sorted our myself. I managed to figure out how to start the derby CLI (if it's called that way) but I have no idea to connect to the database to check for errors.

      I am looking here:

      http://wiki.apache.org/db-derby/DatabaseConsistencyCheck

      I am a MySQL person with no idea about Java. So I am completely lost.

      That's where I am:

      server:~/mango$ java org.apache.derby.tools.ij
      ij version 10.6
      ij> connect /home/worker/mango/madb;
      IJ ERROR: Unable to establish connection
      ij> 
      
      
      posted in Mango Automation general Discussion
      A
      AlexHK
    • SQL error: duplicate key value in a unique or primary key: USEREVENTSPK' defined on 'USEREVENTS'.

      Any ideas how to fix this?

      Server never crashed, but this might have happened a while ago. I didn't use Mango for quite a while.

      Alex

      Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
              ... 22 more
      Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
              ... 16 more
      Exception in thread "main" org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [insert into userEvents (eventId, userId, silenced) values (?,?,?)]; The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.; nested exception is java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241)
              at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
              at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
              at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)
              at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883)
              at com.serotonin.m2m2.db.dao.EventDao.insertUserEvents(EventDao.java:113)
              at com.serotonin.m2m2.rt.EventManager.raiseEvent(EventManager.java:108)
              at com.serotonin.m2m2.rt.event.type.SystemEventType.raiseEvent(SystemEventType.java:93)
              at com.serotonin.m2m2.Lifecycle.terminate(Lifecycle.java:214)
              at com.serotonin.m2m2.Main.main(Main.java:94)
      Caused by: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
              at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeBatchElement(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedStatement.executeBatch(Unknown Source)
              at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:898)
              at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1)
              at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
              ... 7 more
      Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
              ... 19 more
      Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
              ... 13 more
      
      posted in Mango Automation general Discussion
      A
      AlexHK
    • RE: SQL error: duplicate key value in a unique or primary key: USEREVENTSPK' defined on 'USEREVENTS'.

      Any ideas how to fix this?

      Server never crashed, but this might have happened a while ago. I didn't use Mango for quite a while.

      Alex

      Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
              ... 22 more
      Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
              ... 16 more
      Exception in thread "main" org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [insert into userEvents (eventId, userId, silenced) values (?,?,?)]; The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.; nested exception is java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241)
              at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
              at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
              at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)
              at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883)
              at com.serotonin.m2m2.db.dao.EventDao.insertUserEvents(EventDao.java:113)
              at com.serotonin.m2m2.rt.EventManager.raiseEvent(EventManager.java:108)
              at com.serotonin.m2m2.rt.event.type.SystemEventType.raiseEvent(SystemEventType.java:93)
              at com.serotonin.m2m2.Lifecycle.terminate(Lifecycle.java:214)
              at com.serotonin.m2m2.Main.main(Main.java:94)
      Caused by: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
              at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeBatchElement(Unknown Source)
              at org.apache.derby.impl.jdbc.EmbedStatement.executeBatch(Unknown Source)
              at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:898)
              at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1)
              at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
              ... 7 more
      Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
              at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
              ... 19 more
      Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'USEREVENTSPK' defined on 'USEREVENTS'.
              at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
              at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
              at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
              at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
              ... 13 more
      
      posted in Mango Automation general Discussion
      A
      AlexHK
    • PID Loop with Mango? proportional-integral-derivative controller

      Any ideas if this is possible with an out-of-the-box solution, ie. plugin, some available code, etc?

      I have a bash script running that modulates the fan speed of a cooler based on the water temp, now I need to move away from the bash script to a proper PID loop, either by hardware (PLC or the Inverter Drives) or preferable still by software using Mango.

      And Happy Holidays everybody reading this!

      posted in Mango Automation general Discussion
      A
      AlexHK
    • RE: PID Loop with Mango? proportional-integral-derivative controller

      Any ideas if this is possible with an out-of-the-box solution, ie. plugin, some available code, etc?

      I have a bash script running that modulates the fan speed of a cooler based on the water temp, now I need to move away from the bash script to a proper PID loop, either by hardware (PLC or the Inverter Drives) or preferable still by software using Mango.

      And Happy Holidays everybody reading this!

      posted in Mango Automation general Discussion
      A
      AlexHK
    • RE: Doing math on point

      Thanks, this multiplier did the track for new data. I have overlooked this useful feature!

      It would actually be great if there would be a place to enter a formula, even better if the formula could use variables with data from other data points.

      As soon as I have a little more time I will check how to access the database and modify the old values, or must move it all to MySQL all together, since it's running on the same machine anyway.

      posted in User help
      A
      AlexHK
    • Doing math on point

      I have a source that returns me 1200 for a certain point.
      Is there an easy way to divide by 100 before it gets stored in the database?

      If that is possible, could I do the same with the existing data in the database (default database). I would know how to do that easily using MySQL.

      Alex

      posted in User help
      A
      AlexHK
    • RE: Doing math on point

      I have a source that returns me 1200 for a certain point.
      Is there an easy way to divide by 100 before it gets stored in the database?

      If that is possible, could I do the same with the existing data in the database (default database). I would know how to do that easily using MySQL.

      Alex

      posted in User help
      A
      AlexHK