<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mango 1.13.0 Adding Datapoints Fails]]></title><description><![CDATA[<p dir="auto">We've been using Mango at our brewery two years with great success. We have two Modbus IP data Sources which work great, among others.  SQL is mySQL.<br />
I added a third Modbus IP datasource which went without a problem.  But when I try adding dataponts I get:</p>
<p dir="auto">PreparedStatementCallback; SQL [insert into dataPoints (xid, dataSourceId, data) values (?,?,?)]; Cannot add or update a child row: a foreign key constraint fails (<code>mungo1</code>.<code>datapoints</code>, CONSTRAINT <code>dataPointsFk1</code> FOREIGN KEY (<code>dataSourceId</code>) REFERENCES <code>datasourcesold</code> (<code>id</code>)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (<code>mungo1</code>.<code>datapoints</code>, CONSTRAINT <code>dataPointsFk1</code> FOREIGN KEY (<code>dataSourceId</code>) REFERENCES <code>datasourcesold</code> (<code>id</code>))</p>
<p dir="auto">I can successfully add additional datapoints to all other existing datasources.</p>
<p dir="auto">I tried deleting one of the existing datasources but that did not help.</p>
<p dir="auto">I exported the database and installed on another computer with a new installation of xampp and mango 1.13.0.  The problem followed to this installation.  Maybe this points to some sort of data corruption???...</p>
<p dir="auto">Many thanks in advance.</p>
<p dir="auto">Ken</p>
]]></description><link>https://forum.mango-os.com/topic/1738/mango-1-13-0-adding-datapoints-fails</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 04:06:05 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1738.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Oct 2014 06:07:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mango 1.13.0 Adding Datapoints Fails on Tue, 21 Oct 2014 22:15:43 GMT]]></title><description><![CDATA[<p dir="auto">Jeremy and Joel:</p>
<p dir="auto">Thanks for the replies.</p>
<p dir="auto">Jeremy: To reinstall, i exported the entire mango data base, using mySQL Export, then imported it into a virgin mango installation on another computer with mySQL Import.</p>
<p dir="auto">I found the problem.  At some time in the past, Mango created a table called datasourcesold which appears to be identical to datasources.  When I created a new datasource, a new entry was made in datasources but not in datasourcesold.  Then when I tried to create a new point, the difference btween datasources and datasourcesold triggered the error.</p>
<p dir="auto">I copied the newly created datasource record from datasources to datasourcesold.  Then the new point was created wih no problem.</p>
<p dir="auto">I'll be testing this extensively before going forward.</p>
<p dir="auto">Again, thanks for the responses.</p>
<p dir="auto">Ken</p>
]]></description><link>https://forum.mango-os.com/post/9414</link><guid isPermaLink="true">https://forum.mango-os.com/post/9414</guid><dc:creator><![CDATA[kdebower]]></dc:creator><pubDate>Tue, 21 Oct 2014 22:15:43 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 1.13.0 Adding Datapoints Fails on Tue, 21 Oct 2014 07:53:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi Ken,</p>
<p dir="auto">It looks like something has gone wrong in the database but I can't really tell exactly what.  Mango 1.13 isn't supported anymore so the only thing I can suggest is to upgrade to Mango Automation or get someone experience in MySQL to go through your database. Mango Automation has lots of benefits over 1.13 including support but also if you go with the Enterprise edition we have an upgrade process which will convert all your data over to the new high performance database.  We also have a modules specially for Breweries that you might want to look at: <a href="http://forum.infiniteautomation.com/forum/forums/show/21.page" rel="nofollow ugc">http://forum.infiniteautomation.com/forum/forums/show/21.page</a></p>
<p dir="auto">Joel.</p>
]]></description><link>https://forum.mango-os.com/post/9412</link><guid isPermaLink="true">https://forum.mango-os.com/post/9412</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Tue, 21 Oct 2014 07:53:06 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 1.13.0 Adding Datapoints Fails on Tue, 21 Oct 2014 04:23:11 GMT]]></title><description><![CDATA[<p dir="auto">Hi Ken</p>
<p dir="auto">If you wrap your text in 'code' tags it will be easier to read and make it easier for folks to help you.</p>
<blockquote>
<p dir="auto">I exported the database and installed on another computer with a new installation of xampp and mango 1.13.0.</p>
</blockquote>
<p dir="auto">Did you do an actual mysql database dump or did you simply export the mango datas ource and data point configuration?</p>
<p dir="auto">I am not a Mango developer nor a java developer, just a user. But if the problem 'followed' you to a new install and you only exported the configuration (and didn't do a full db dump), then I would start looking for odd/escaped characters, whitespace, or otherwise invalid contents in your data source and point config. The message you receive seems to hint at that kind of thing.</p>
]]></description><link>https://forum.mango-os.com/post/9411</link><guid isPermaLink="true">https://forum.mango-os.com/post/9411</guid><dc:creator><![CDATA[jeremyh]]></dc:creator><pubDate>Tue, 21 Oct 2014 04:23:11 GMT</pubDate></item><item><title><![CDATA[Reply to Mango 1.13.0 Adding Datapoints Fails on Mon, 20 Oct 2014 17:28:21 GMT]]></title><description><![CDATA[<p dir="auto">Additionally, this is found in the CMD window.  It may help identify the problem:</p>
<p dir="auto">ERROR 2014-10-20 08:17:45,664 (com.serotonin.mango.web.filter.ExceptionDetection<br />
Filter.doFilter:52) - DWR invocation exception<br />
org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallba<br />
ck; SQL [insert into dataPoints (xid, dataSourceId, data) values (?,?,?)]; Canno<br />
t add or update a child row: a foreign key constraint fails (<code>mungo1</code>.<code>datapoint s</code>, CONSTRAINT <code>dataPointsFk1</code> FOREIGN KEY (<code>dataSourceId</code>) REFERENCES <code>datasour cesold</code> (<code>id</code>)); nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegr<br />
ityConstraintViolationException: Cannot add or update a child row: a foreign key<br />
constraint fails (<code>mungo1</code>.<code>datapoints</code>, CONSTRAINT <code>dataPointsFk1</code> FOREIGN KEY<br />
(<code>dataSourceId</code>) REFERENCES <code>datasourcesold</code> (<code>id</code>))<br />
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.d<br />
oTranslate(SQLErrorCodeSQLExceptionTranslator.java:245)<br />
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat<br />
or.translate(AbstractFallbackSQLExceptionTranslator.java:72)<br />
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:<br />
602)<br />
at com.serotonin.db.spring.ExtendedJdbcTemplate.update(ExtendedJdbcTempl<br />
ate.java:172)<br />
at com.serotonin.db.spring.ExtendedJdbcTemplate.update(ExtendedJdbcTempl<br />
ate.java:130)<br />
at com.serotonin.db.spring.ExtendedJdbcTemplate.update(ExtendedJdbcTempl<br />
ate.java:126)<br />
at com.serotonin.db.DaoUtils.doInsert(DaoUtils.java:154)<br />
at com.serotonin.mango.db.dao.DataPointDao.insertDataPoint(DataPointDao.<br />
java:188)<br />
at com.serotonin.mango.db.dao.DataPointDao$1.doInTransactionWithoutResul<br />
t(DataPointDao.java:172)<br />
at org.springframework.transaction.support.TransactionCallbackWithoutRes<br />
ult.doInTransaction(TransactionCallbackWithoutResult.java:33)<br />
at org.springframework.transaction.support.TransactionTemplate.execute(T<br />
ransactionTemplate.java:130)<br />
at com.serotonin.mango.db.dao.DataPointDao.saveDataPoint(DataPointDao.ja<br />
va:167)<br />
at com.serotonin.mango.rt.RuntimeManager.saveDataPoint(RuntimeManager.ja<br />
va:382)<br />
at com.serotonin.mango.web.dwr.DataSourceEditDwr.validatePoint(DataSourc<br />
eEditDwr.java:309)<br />
at com.serotonin.mango.web.dwr.DataSourceEditDwr.saveModbusPointLocator(<br />
DataSourceEditDwr.java:406)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<br />
java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces<br />
sorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:597)<br />
at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilt<br />
er.java:34)<br />
at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.j<br />
ava:428)<br />
at com.serotonin.mango.web.dwr.util.LoggedInAjaxFilter.doFilter(LoggedIn<br />
AjaxFilter.java:39)<br />
at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.j<br />
ava:428)<br />
at com.serotonin.web.dwr.LocalizationFilter.doFilter(LocalizationFilter.<br />
java:62)<br />
at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.j<br />
ava:428)<br />
at com.serotonin.mango.web.filter.ExceptionDetectionFilter.doFilter(Exce<br />
ptionDetectionFilter.java:40)<br />
at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.j<br />
ava:428)<br />
at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java<br />
:431)<br />
at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java<br />
:283)<br />
at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandle<br />
r.java:52)<br />
at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:1<br />
01)<br />
at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)<br />
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)<br />
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)<br />
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl<br />
icationFilterChain.java:305)<br />
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF<br />
ilterChain.java:210)<br />
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV<br />
alve.java:225)<br />
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV<br />
alve.java:123)<br />
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica<br />
torBase.java:472)<br />
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j<br />
ava:168)<br />
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j<br />
ava:98)<br />
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:<br />
927)<br />
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal<br />
ve.java:118)<br />
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav<br />
a:407)<br />
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp<br />
11Processor.java:1001)<br />
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(<br />
AbstractProtocol.java:579)<br />
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin<br />
t.java:312)<br />
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec<br />
utor.java:886)<br />
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor<br />
.java:908)<br />
at java.lang.Thread.run(Thread.java:662)<br />
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce<br />
ption: Cannot add or update a child row: a foreign key constraint fails (<code>mungo1 </code>.<code>datapoints</code>, CONSTRAINT <code>dataPointsFk1</code> FOREIGN KEY (<code>dataSourceId</code>) REFERENC<br />
ES <code>datasourcesold</code> (<code>id</code>))<br />
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p>
<pre><code>    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
</code></pre>
<p dir="auto">orAccessorImpl.java:39)<br />
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC<br />
onstructorAccessorImpl.java:27)<br />
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)<br />
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)<br />
at com.mysql.jdbc.Util.getInstance(Util.java:381)<br />
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)<br />
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)<br />
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)<br />
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)<br />
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)<br />
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)<br />
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)<br />
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja<br />
va:1761)<br />
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java<br />
:2046)<br />
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java<br />
:1964)<br />
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java<br />
:1949)<br />
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del<br />
egatingPreparedStatement.java:108)<br />
at com.serotonin.db.spring.ExtendedJdbcTemplate$1.doInPreparedStatement(<br />
ExtendedJdbcTemplate.java:179)<br />
at com.serotonin.db.spring.ExtendedJdbcTemplate$1.doInPreparedStatement(<br />
ExtendedJdbcTemplate.java:172)<br />
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:<br />
586)<br />
... 47 more</p>
<p dir="auto">Again, many thanks.</p>
<p dir="auto">Ken</p>
]]></description><link>https://forum.mango-os.com/post/9410</link><guid isPermaLink="true">https://forum.mango-os.com/post/9410</guid><dc:creator><![CDATA[kdebower]]></dc:creator><pubDate>Mon, 20 Oct 2014 17:28:21 GMT</pubDate></item></channel></rss>