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.
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.
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
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>
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
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
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!
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!
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.
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
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
I've installed it using sudo apt-get install librxtx-java on Ubuntu 12.04. I am not familiar with Java unfortunately and it's infrastructure, so consider me a dumb user.
I have a modbus serial source setup and it seems to work fine (ie. I get he frequency from the inverter).
But it seems each time it will create the following error in the log:
Oct 23 23:59: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:54: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:49: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:44: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:39: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:34: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:29: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
UrgentOct 23 23:24: 'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
Hi Phil, thanks for your help.
I did not have this, so I did it now. Not sure if I did that right, but I copied /usr/lib/jni/librxtxSerial.so to my mango/overrides folder and restarted mango.
I also get the following in the logs:
Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
Jar version = RXTX-2.1-7
native lib Version = RXTX-2.2pre2
Serial communication/modbus seems to work though, although I get the error message posted in another thread:
'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1
I still get the following error when I use Modbus Serial.
"'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1".
Is this a known bug?
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.
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.
I have received the new license file thanks.
If anyone needs to see the log when Mango starts as a service under Ubuntu Linux (12.04) it's at /var/log/upstart/mango.log
Look at the log continuously:
sudo tail -f /var/log/upstart/mango.log
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 error
WARN 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
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 error
WARN 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
@JoelHaggar said:
Attached is a linux service that works on Ubuntu. I put it in the ext/init/ dir You'll have to edit the path to the ma-start.sh file but then you can run sudo service mango start and sudo service mango stop from the terminal.
Let me know if this works for you?
Joel.
Thanks for posting this. I have purchased a license and everything is fine (license file in mango directory). But when I use sudo service mango start to fire up Mango, it says the core module is running on a free license. I have added some code to the script to change into the mango directory before the exec command, but it didn't make a difference. Any ideas?
Ubuntu Server 12.04
Alex
Thanks Phil, very helpful info.
So far Mango is still running with the derby database and I have manually started it. As mentioned, we are very pressed for time and I was impressed that it worked like this out of the box.
Do you by chance have a link to official info to start it as a service? I can then put some clean bash script together for stopping, backup up, and restarting Mango (and maybe transferring it to an offsite location). And I can share it right here.
Alex
PS: Once the project is complete, I'll have the time to set this all up properly with external database etc.