-
AlexHK
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
-
AlexHK
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!
-
AlexHK
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
-
AlexHK
I have just created a Modbus serial data source using ttyS129, which is a symbolic link pointing to ttyR00.
I am using Moxa NPort 5150 Ethernet Serial modules and they create virtual devices ttyR00, ttyR01, etc.
Since RXTX seems not to enumerate them, a symbolic link is a quick workaround.
When I create a new source the serial port indeed shows up and all is good (I can communicate).When I look at the list of data sources it is also all good (data_sources.shtm) and the source shows up wity ttyS129, also when I export I get it right.
But when I click on edit, I am left with only ttyS0 and ttyS1.
When I edit the data source, I only get ttyS00 and ttyS01 in the HTML form (data_source_edit.shtm?dsid=31)
Exporting, deleting and reimporting with the corrected ttyS129 seems to have fixed my problem. -
AlexHK
I am not sure if it's me who's doing it wrong or if there is an error.
When I hit HTTP Send Test / Send Static Data it shows "Sending..." and will stay like this until I hit cancel.
I also get the following errorWARN 2013-10-21 12:20:07,223 (com.serotonin.m2m2.web.dwr.MiscDwr.jsError:176) - Javascript error Description: TypeError: PublisherEditDwr.httpSenderTest is not a function Page: http://192.168.0.171:8080/publisher_edit.shtm?pid=1 Line: 567 Browser name: Firefox Browser version: 23 osName: Windows location: http://192.168.0.171:8080/publisher_edit.shtm?pid=1
Apart from this, what I am trying to do is to post some info via HTTP GET to a Cai WebControl board.
The URL would be
http://192.168.1.15/api/seturom.cgi?uromid=1&value=23456789
But I am using a password, so maybe
http://admin:password@192.168.1.15/api/seturom.cgi?uromid=1&value=23456789
Or using static HTTP headers. That's what I am trying to figure out.
Under Static Headers I entered
Authorization=Basic YWRtaW46cGFzc3dvcmQ=
(The string is base64 encode of "admin:password")
Is what I am doing about right?
Eventually what I am trying to do is update a value as above on a certain event (ie. HTTP Retriefer receives an alarm).
Alex
-
AlexHK
Hello,
I am new to Mango and I am really impressed. I bought the license just yesterday, one day after installing. Here is my first question.
I have setup a data source with some points called 'HKO - Current Weather'.
Later I renamed the same to simply 'HKO'.When I look at the Point Hierarchy, they still show up with the old name. Is there way to change this? I am just trying to find out the small details before setting up a system with hundreds of data points.
-
AlexHK
I have installed Mango Automation a few days ago and I am really impressed. Now that we are in the middle of a very busy project, I don't really have the time to look at all the details or even read the user guide (if one actually exists, lol). I keep adding more and more datapoints every day.
Does anybody know a simple way to get a cron job running with some simple backup?
So that I don't have to worry about having to do it all over again if in worst case the server has some problems?Could I just backup/tar the mango directory while mango is running once a day and transfer it to a backup server? I have all the things in place to do backup and file transfers, I am just not sure what I have to include and if it would actually be safe to do so.
Alex
-
AlexHK
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.
-
AlexHK
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
-
AlexHK
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>