Getting "The driver has not received any packets from the server" with an external mysql database with ssl-mode=REQUIRED

1,085 views
Skip to first unread message

Martin Lévesque

unread,
Feb 15, 2021, 3:30:36 PM2/15/21
to Kill Bill users mailing-list
Hi everyone,

I am getting the following error while trying to access kaui in a new killbill setup:

{"@timestamp":"2021-02-15T20:14:20.415Z","@version":"1","message":"F, [2021-02-15T20:14:20.415088 #1] FATAL -- : ActiveRecord::JDBCError (Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.):\n","logger_name":"jruby.rack","thread_name":"catalina-exec-2","level":"INFO","level_value":20000,"rails.actionName":"sessions#new","req.requestId":"e940e4eb-e711-4314-b054-989d36fd4b06"}

I am using the following environment variables (it's a kubernetes environment) and using a mysql service by https://aiven.io/ with ssl mode REQUIRED :

      spec:
        containers:
        - env:
          - name: KILLBILL_DAO_URL
            value: jdbc:mysql://external-hostname-here:22222/killbill?sslMode=REQUIRED
          - name: KILLBILL_DAO_USER
            value: admin-user-here
          - name: KILLBILL_DAO_PASSWORD
            value: a-password-here
          - name: KAUI_KILLBILL_URL
            value: http://killbill:8080

I tested manually the mysql connection from the container (pod) and it works, with mysql CLI. However kaui is unable to connect to mysql for an unknown reason. 

Any idea what could be the issue? Or how to debug a connection issue?

Pierre-Alexandre Meyer

unread,
Feb 16, 2021, 4:07:31 AM2/16/21
to Martin Lévesque, Kill Bill users mailing-list
Hi Martin,

I don't know of anyone using Aiven with Kill Bill / Kaui unfortunately. Our open-source builds have standard drivers and driver configurations for stock MySQL / PostgreSQL installations, it could be that Aiven databases require a specific configuration.

FWIW We do have customers running our Enterprise version of Kill Bill using jdbc over SSL (e.g. for IAM database authentication), this requires additional configuration options though (or sometimes alternate drivers).

Sorry I cannot be more helpful -- you would need to debug this in your environment. Try to enable enablePacketDebug maybe (https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-connp-props-debugging-profiling.html) to see if you can debug the handshake?

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/f81855c6-3cc3-4bf8-b8b9-710c6e7bedebn%40googlegroups.com.


--
Pierre

Martin Lévesque

unread,
Feb 16, 2021, 9:18:01 AM2/16/21
to Kill Bill users mailing-list
Hey Pierre-Alexandre,

Thanks for the quick response!

Tested with the following KILLBILL_DAO_URL=jdbc:mysql://AIVEN-HOST:AIVEN-PORT/killbill?enablePacketDebug=true&requireSSL=true&verifyServerCertificate=false

but I don't see any difference in terms of logs.

Note that normally it's pretty straightforward to connect from any client with aiven, as example with the mysql CLI:

mysql --ssl-mode=REQUIRED -h AIVEN-HOST -P AIVEN-PORT -u AIVEN-USERNAME -p

It just needs to have the flag ssl-mode=REQUIRED and that normally works.

Looked at the following doc to set requireSSL flag https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-using-ssl.html as you can see in my KILLBILL_DAO_URL for the jdbc uri.

Thanks

Martin Lévesque

unread,
Feb 16, 2021, 10:23:21 PM2/16/21
to Kill Bill users mailing-list
Just an update, it works well with aiven, in the kaui deployment, I was not using the right ENV variables, and so the default KAUI database configs were used, and so ending up always getting the same error messages.
I would maybe suggest to not have default value, and fail hard if they are not provided.

Reply all
Reply to author
Forward
0 new messages