Another "Communications link failure" post, with a twist

I understand the overarching cause here: Lucee cannot connect to the database.
But other programs on this machine can.

I’m running the “Express” version for development on my Zorin Linux OS 16 laptop. It’s been wonderful, connecting to many AWS RDS flavors (like Postgres, MSSQL and MySQL).

I’ve also set up DBeaver 21.3.4 IDE for added SQL madness… on the same laptop

The problem pops up for my one Maria instance:

  • DBeaver can connect to it without issue. Any user, any DB.
  • Lucee cannot (“Communications link failure”), regardless of user or DB.

Because both of these examples are on the same laptop, network layer issues have pretty much been ruled out, right?

Maybe I need more than the admin UI to set this up; do you have any script or tag DSN suggestions - which introduce some needed parameters I’m not aware of?

Thanks for reading, and sorry for the almost-repetitive subject.

Which database driver Lucee extension are you using? MySQL or MariaDB?

Can you verify the datasource in your admin UI (i.e. ticking the box and clicking “Verify”)?

To try a scripted version, edit the datasource entry and scroll down to the bottom of the page where you’ll find a box titled “You can also set this in the Application.cfc as follows:”

Hi Julian, and thanks.

The only options for DSNs in my Lucee Admin version are JTDS, Microsoft SQL Server, MySQL (selected), Other and PostgreSQL. *

From other threads here, it seems like Maria is supposed to mimic compatibility with MySQL.

This is the same setup that is used on other Linux/Lucee machines (like our production box), which also use different JDBC clients besides Lucee to do business.

But on my laptop, only Lucee throws the communications link failure. The other client (DBeaver) works fine - but it has a specific Maria option.

** * Is a special extension now required for Maria connections to work?**

Thanks for the reminder of the scripting option provided by the admin UI, my question was more along the lines of introducing settings that might not be available in the form (like “ValidateServerCertificate=no” or some such thing).

Can you test on the latest 5.3.9? Lucee had a super annoying bug in the error handling for JDBC connections that discarded the “caused by” portion of jdbc connection exceptions which contains the actual cause. Communication Failure is just a generic message for all failures. I sent a pull request to fix this and it’s part of 5.3.9. Troubleshooting any connection failure is pretty much impossible otherwise and I was floored Lucee had been doing this for so long.

1 Like

No, not at all, the MySQL extension should work fine.

I hope Brad’s suggestion sorts the issue for you.

1 Like

Always nice to hear from you, Brad, although my preferred method is conference junkets.
The high-level message did not change.

FWIW: Here’s the full dump after updating to and restarting. Much like your write up, does this little item have significance?


lucee.runtime.exp.NativeException: 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. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException( at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException( at com.mysql.cj.jdbc.ConnectionImpl.createNewIO( at com.mysql.cj.jdbc.ConnectionImpl.( at com.mysql.cj.jdbc.ConnectionImpl.getInstance( at com.mysql.cj.jdbc.NonRegisteringDriver.connect( at lucee.runtime.db.DataSourceSupport._getConnection( at lucee.runtime.db.DataSourceSupport.getConnection( at lucee.runtime.tag.Admin._doVerifyDatasource( at lucee.runtime.tag.Admin.doUpdateDatasource( at lucee.runtime.tag.Admin._doStartTag( at lucee.runtime.tag.Admin.doStartTag( at services_datasource_create_cfm1334$ at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl.doInclude( at services_datasource_cfm414$ at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl.doInclude( at web_cfm$ at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl.doInclude( at server_cfm$ at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.PageContextImpl._doInclude( at lucee.runtime.listener.ModernAppListener._onRequest( at lucee.runtime.listener.MixedAppListener.onRequest( at lucee.runtime.PageContextImpl.execute( at lucee.runtime.PageContextImpl._execute( at lucee.runtime.PageContextImpl.executeCFML( at lucee.runtime.engine.Request.exe( at lucee.runtime.engine.CFMLEngineImpl._service( at lucee.runtime.engine.CFMLEngineImpl.serviceCFML( at lucee.loader.engine.CFMLEngineWrapper.serviceCFML( at lucee.loader.servlet.CFMLServlet.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.tomcat.websocket.server.WsFilter.doFilter( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.authenticator.AuthenticatorBase.invoke( at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.valves.ErrorReportValve.invoke( at org.apache.catalina.valves.AbstractAccessLogValve.invoke( at org.apache.catalina.core.StandardEngineValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.service( at org.apache.coyote.http11.Http11Processor.service( at org.apache.coyote.AbstractProcessorLight.process( at org.apache.coyote.AbstractProtocol$ConnectionHandler.process( at$SocketProcessor.doRun( at at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( at java.base/java.util.concurrent.ThreadPoolExecutor$ at org.apache.tomcat.util.threads.TaskThread$ at java.base/ Caused by: com.mysql.cj.jdbc.exceptions.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. … 60 more Caused by: com.mysql.cj.exceptions.CJCommunicationsException: 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. at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance( at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.base/java.lang.reflect.Constructor.newInstanceWithCaller( at java.base/java.lang.reflect.Constructor.newInstance( at com.mysql.cj.exceptions.ExceptionFactory.createException( at com.mysql.cj.exceptions.ExceptionFactory.createException( at com.mysql.cj.exceptions.ExceptionFactory.createException( at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException( at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection( at com.mysql.cj.protocol.a.NativeAuthenticationProvider.negotiateSSLConnection( at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication( at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect( at com.mysql.cj.protocol.a.NativeProtocol.connect( at com.mysql.cj.NativeSession.connect( at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly( at com.mysql.cj.jdbc.ConnectionImpl.createNewIO( … 57 more Caused by: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) at java.base/ at java.base/ at java.base/ at java.base/ at java.base/ at com.mysql.cj.protocol.ExportControlled.performTlsHandshake( at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake( at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake( at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection( … 64 more

On the same laptop, with the same strings, DBeaver has no problem connecting.

However, it is using this driver instead:

If youze guys think it would be a valid next step, AND you feel it would not mess up any other conditions in our ultra-scientific debugging process ;-] would you suggest I try using this other driver, IAW the instructions here:

…or a recommended extension?


Here’s the error. It’s always the last “caused by” in the stack on these scenarios and it’s a java ssl configuration issue. You should be able to search for it on Pete Freitag’s blog for more info.

Alan, if it wasn’t clear to you from Brad’s comment, the issue seems to be about the jvm that you have Lucee running on. My guess is that it’s a version that’s a good bit older than the currently supported LTS versions, 11.0.14 or 1.8.0_321.

And yes, this would explain why it happens in Lucee and yet not from DBeaver or other tools running on the same machine–if those tools either are not based on Java (like Lucee and ACF are) or they might even embed their own more recent java version.

FWIW, I’ve done a blog post this frequent need to update the jvm (used by CF or Lucee) to solve problems of calling out of cfml via https/tls. I’ve also done one on the most recent Java updates, from January 2022, for 8, 11, and 17–the latter of which will be supported by upcoming updates to CF and Lucee. (See my point in that last post also about an important change in the jvm updates since April 2021, where calls out to servers not yet supporting tls 1.2 would be blocked by default–and how that can be changed if needed.)

Finally, as for how to go about changing the jvm used by Lucee, that depends on how you installed/deployed Lucee, and may depend also on how you install/configure Java. The topic has been discussed here, the docs, and elsewhere. I’ll leave it at that for now, if the info above is all you needed to get going.

And of course I’m open to corrections if anyone thinks I’ve misspoken on any points.

Man, I really appreciate you heavy-hitters coming out from your man caves to help me out. Or would that be “men caves”… “mans cave”?

Our shared DEV server at Viviotech:
Lucee running on Linux (4.4.0-210-generic) 64bit under Java 1.8.0_201 (Oracle Corporation) 64bit. This instance has JDBC Type 4 Driver for the MySQL and MariaDB databases version 8.0.24.
SUCCESS: The above machine was able to establish a Lucee datasource to AWS Maria db/user without a problem.

My localhost dev laptop:
Lucee running on Linux (5.13.0-28-generic) 64bit under Java 16.0.1 (AdoptOpenJDK) 64bit. This instance also has JDBC Type 4 Driver for the MySQL and MariaDB databases version 8.0.24.
All of this from a lucee-express- archive downloaded only 69 days ago.
FAILED: This laptop was unable to establish a Lucee datasource to the same AWS Maria db/user, while a different app on the laptop can.
(That’s DBeaver - a customized Eclipse that uses the driver noted earlier, and runs on OpenJDK 11)

I’m still tinkering with the connection here. I just wanted to add more info to the thread.

Alan, can you confirm how you are determining the Java version? I have seen people presume that what they see with a java -version command is what Lucee uses, but instead please confirm what you see shown in the Lucee admin itself.

And if you DO confirm that the 16.0.1 really is what is shown in Lucee, then I would point you again to the point I made about TLS 1.2. It may be that your MariaDB implementation does not yet support it (that would surprise me). Anyway, see my blog post for more on how you could change the JVM to allow it to talk to a server not yet supporting tls 1.2, Just saying it’s an easy change to make and see if it helps. But please do this after checking out the lucee-reported jvm version.

Thanks, Charlie - all the stats in my 2-14 reply were taken directly from the relative Lucee admin Server Overview pages.
I’m going to pursue this as a likely TLS version issue.

Modifying the connection string to omit all SSL security, and the DSN finally works. This is not the optimal solution, so I’m still working on a SSL connection.
(Note that in the admin UI, neither option is selected, and is allowed like this.)

Thanks to the commit by @bdw429s for some concise error messaging now:
“Cannot open file:/home/xxxx/lucee-express- [Keystore was tampered with, or password was incorrect]”

Not sure what password is being referred to here. My command uses “sudo” to presumably run Lucee’s as root. I have not “tampered” with cacerts.

Seeing as this is just a localhost dev laptop, my first inclination was to just cdmod all the permissions in this unzipped Lucee stack to 777 (none), but that seems extreme. When using Nautilus (ie Explorer) to navigate to the /security/ folder, I am prompted for my password repeatedly. As Linux distros go, Zorin is pretty tightfisted with the root user. Maybe I missed an installation note?

But at least the issue’s cause is in view now. I’ll keep looking & tinkering. Thanks for the tips.

The default password of Lucee’s cacerts file is changeit though I’ve never seen that error before so I’m not sure why it can’t open it :thinking: Did you by chance wholesale copy another cacerts file from elsewhere over the top of Lucee’s as part of your attempts to make this work. In doing so, you could have put a file in place with another password. I’d have to see the full stack to know what code exactly was attempting to open that file.