Increase in "Communications link failure" errors

I’ve seen a significant uptick in the number of “lucee.runtime.exp.CustomTypeException: Communications link failure The last packet successfully received from the server was 6 milliseconds ago. The last packet sent successfully to the server was 6 milliseconds ago.” type failures in the past few months.

I’m using Lucee 5.2.x and MySQL Connector/J mysql-connector-java-8.0.14 connecting to an AWS Aurora instance.

Has anybody successfully dealt with this? How’d you solve it? It probably isn’t Lucee specific but I’m checking here to see if anyone has experienced this.

Thanks!

how is your instance setup, what os, are you behind a cloud instance firewall or trying to route everything over the virtual adapter?

Thanks Terry,

Ubuntu 16.04 EC2 instance connecting to an Aurora RDS cluster in a different Availability Zone. The Security Groups and Subnet configs allow 3306 traffic.

Using the same setup, minus AWS. I see these errors daily and haven’t found an actual cause.

Its more than likely the timeout for your mysql database.

in the mysql console you set up this

SET @@GLOBAL.interactive_timeout=XXXXX

XXXXX is the number of seconds you want your connection to time out. By default on most distros this is set to 8 hours. (28800)

I would tweak the database settings and then check the logs to see if the new settings are changing the timeout frequency.

I was using Luce 5.3.x and it solve my problem by adding “sslMode=DISABLED” in connection in datasource and that make my issue disappear.
Mine connection string look like below…

jdbc:mysql://[server]:3306/[db]?useUnicode=true&characterEncoding=UTF-8&connectionCollation=utf8mb4_unicode_ci&zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=true&allowMultiQueries=true&useLegacyDatetimeCode=true&sslMode=DISABLED

2 Likes

If you are using commandbox and cfconfig and dotenv…the problem was that Lucee was updated and the class, bundlename, and bundle versions were not what they were supposed to be.
Test Case: Go to your lucee admin datasources, scroll to the bottom and press update. If the error goes away, then you are half way there.
Solution: open your working datasource. Scroll to the bottom and you should see all the appropriate connection settings.
Update your cfconfig our datasource script with the correct settings.
-For me, i just updated my cfconfig file with the updated env variables.

"bundleName":"${DB_BUNDLENAME}",
"bundleVersion":"${DB_BUNDLEVERSION}",
"class":"${DB_CLASS}",