MySQL Database Connection Faulted

Did your MySQL Database Connection just fail?
[poll type=multiple max=4]

  • Yes
  • No
  • Linux
  • Windows
  • Just Updated
    [/poll]
    PROBLEM

Caveats - I am a Ignition newb and relative Ubuntu Linux newb. Accordingly please be gentle. While developing an initial customer application my easy chart is faulted out in red with an error

MySQL Database Connection Faulted

PRIME SUSPECT
Just updated MySQL recently

xxxxxxxxxx@u1204vm_xxx:~$ apt-cache show mysql-server | grep Version
Version: 5.5.31-0ubuntu0.12.04.2
Version: 5.5.31-0ubuntu0.12.04.1
Version: 5.5.22-0ubuntu1

STATUS

at h t t p : // 192.168.xxx.xxx:8088/main/web/config/database.connections?12
Database Connections

MySQL01 enable live values
Faulted
Error:
Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

ENVIRONMENT

Ignition Version 7.6.1 (b2278)
Java Version Sun Microsystems Inc. 1.6.0_45
Ubuntu Server 12.04 with LXDE GUI running in KVM Virtual Machine
MySQL Version: 5.5.31-0ubuntu0.12.04.2

OBSERVATIONS

I see that another user is having a similar problem with the forum topic today
Database Connection Failing with high CPU Usage

I had searched on the most prolific error observed
viewtopic.php?f=72&t=8430&start=0&st=0&sk=t&sd=a&hilit=java.lang.Exception%3A+Unable+to+add+data+to+memory+buffer%2C+buffer+full.

POSSIBLE SOLUTIONS

  1. Wait until tomorrow and hopefully just
    sudo apt-get update
    sudo apt-get upgrade

  2. Try to figure out how to revert my MySQL version
    since I hadn’t done a recent complete environment backup
    thankfully my recent application development is backed up

  3. Restore from an old environment backup and do a bunch of updates and
    restore my recent application development work

  4. See what the auspicious forum has to say

LOG TEXT

Overview
Modules
SQLTags
Database Connections
Store & Forward
OPC Connections
Sessions
Gateway Scripts
Alarm Pipelines
OPC-UA Server
Logged in as admin | log out
Database Connections

MySQL01 enable live values
Faulted
Error:
hide Details
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:194)
com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:150)
com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1103)
java.lang.Thread.run(Thread.java:662)
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
sun.reflect.GeneratedConstructorAccessor50.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
com.mysql.jdbc.MysqlIO.(MysqlIO.java:355)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2461)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2498)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)
com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822)
com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
sun.reflect.GeneratedConstructorAccessor47.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:194)
com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:150)
com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1103)
java.lang.Thread.run(Thread.java:662)
java.net.ConnectException: Connection refused
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:529)
java.net.Socket.connect(Socket.java:478)
java.net.Socket.(Socket.java:375)
java.net.Socket.(Socket.java:218)
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:259)
com.mysql.jdbc.MysqlIO.(MysqlIO.java:305)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2461)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2498)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)
com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822)
com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
sun.reflect.GeneratedConstructorAccessor47.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:194)
com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:150)
com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1103)
java.lang.Thread.run(Thread.java:662)
Ignition by Inductive Automation. Copyright © 2003-2013. All rights reserved. | view license

Never have achieved a direct problem resolution as yet. I archived the broken virtual machine Ignition instance for now after a failed attempt to uninstall / reinstall MySQL and just fired up another virtual machine already updated to the latest MySQL. I reloaded Java and Ignition on the new VM, then restored my Ignition development in progress from the ???.gwbk and ???.proj files. Finally I deactivated / reactivated the Ignition license.

Will always test all updates on a test instance virtual machine before deploying to working copy from now on, as I had initially intended to eventually do. So much for rushing to development without five layers of backups. 1. VM hypervisor 2. VM instance 3. MySQL database 4. .gwbk and 5. ???.proj files

S

Hi,

Sorry we didn't reply more quickly on the original post, but the real secret is buried in that stack:

Ignition simply couldn't connect to the server. It was working before you upgraded mysql? Basically, either mysql wasn't able to open the port for some reason, or a firewall decided to start getting in the way, or some other random network based issue was happening.

Regards,

Yes, Thank You. :smiley: It was running fine before, now I can’t even get the mySQL service to start. …or in another cloned instance it starts and runs for a while and then crashes. Just Ubuntu issues, Ignition is all wonderful so far. I just keep restoring my backed up .gwbk and .jnlp files and continuing project development from there. :thumb_left:

Unable to update MySQL. Unable to repair mySQL, update Python, uninstall, purge, remove, re-install, anything successfully. Each cloned instance of Ubuntu gets more broken with each repair attempt, arrggghhhhh. I don’t want to experiment, I just want an old tried and true Ubuntu LTS server version to just run. :open_mouth:

Nothing but problems since Ubuntu distribution changed to new kernel in Ubuntu 12.04.02 with MySQL 5.5. Everything during pre-development proof of concept phase was great, with Ubuntu 12.04.01 server version with MySQL 5.1. I am going to try a clean install instance of Ubuntu 12.04.02 with MySQL 5.5 in another, new from scratch virtual machine, move the Ignition licence over there and try to continue development. I may disable AppArmor in another test instance as well, since all this only runs on the local network and VPN. I have seen issues discussed for every recent version of Ubuntu with AppArmor breaking MySQL. Oh well. Worst case, I’ll just install Ubuntu 12.04.01 with the default LAMP stack and not update a blame thing until I get some more time to play with it in more detail in a test VM.

A post was split to a new topic: MySQL Connection Faulted