[Kea-users] 1.3.0 beta not working with mysql

Thomas Markwalder tmark at isc.org
Thu Oct 5 19:06:19 UTC 2017


Hi Bill:

No, you don't need anything pre-inserted into the lease table(s).   
What's puzzling is the error code of 0 being reported.
We are invoking mysql_stmt_bind_param (a mysql client library func) and
it is failing BUT the mysql library error code is 0.
There is/was a mysql client library bug where that was true but for
mysql_stmt_execute().   This occurred when a client using prepared
statements got disconnected for being idle and was configured to use
auto-reconnect.   Upon reconnect we would try to use
our now invalid prepared statements.  We addresses this with ticket:

 https://kea.isc.org/ticket/5354

But the symptoms for that were slightly different than you report.  Part
of that resolution of that ticket was to code kea to 1: turn of
auto-reconnect and 2: set the idle timeout to an extremely large
value.   Prior to setting it we were subject the global value, which by
default is 28800 seconds but the user had configured his system to set
to 60 seconds. 

I find it hard to see how your environment could be circumventing those
changes.  I only mention it now because of the error code being 0.
Normally, mysql client library functions always return a non-zero error
code when they fail.  It makes it doubly frustrating because client
side errors like this are not logged by the server.

So a couple of questions:

1. Is this just a normal, dynamic client (i.e. no host reservations
involved) ?
2. How long after Kea starts up is it before the client interaction begins ?
3. I'm assuming this happens every time a client request comes in?


Thanks,

Thomas Markwalder
ISC Software Engineering


On 10/5/17 2:00 PM, Bill Pye wrote:
> Hi
>
> Am I missing something that obvious and basic, do I need to create
> something in the lease table?
>
> Regards
>
> Bill
>
> ------------------------------------------------------------------------
>
>     *From: *"Wlodek Wencel" <wlodek at isc.org>
>     *To: *"kea-users" <kea-users at lists.isc.org>
>     *Sent: *Thursday, 5 October, 2017 19:27:06
>     *Subject: *Re: [Kea-users] 1.3.0 beta not working with mysql
>
>     Hello,
>
>     can you show us reservation you put into database?
>
>     Wlodek
>
>
>     On 05/10/2017 18:52, Bill Pye wrote:
>
>         Hi all
>
>         I'm having problems with the current beta not working with a
>         'mysql' server, I've built this version against the current
>         MariaDB version (and the required devel versions) - all these
>         servers are CentOS7 (fully updated):
>
>         Installed Packages
>         Name        : MariaDB-server
>         Arch        : x86_64
>         Version     : 10.2.9
>         Release     : 1.el7.centos
>         Size        : 456 M
>         Repo        : installed
>         Summary     : MariaDB: a very fast and robust SQL database server
>
>         Installed Packages
>         Name        : MariaDB-devel
>         Arch        : x86_64
>         Version     : 10.2.9
>         Release     : 1.el7.centos
>         Size        : 39 M
>         Repo        : installed
>
>         # Percona cluster
>
>         dnf info Percona-XtraDB-cluster-57
>         Using metadata from Wed Oct  4 11:54:00 2017
>
>         The database was created as per the documentation and all the
>         tables and stored procedures exist, this is a single server.
>         However when a machine requests an IP I'm seeing the following
>         errors in the log file:
>
>         2017-10-05 18:16:10.273 INFO  [kea-dhcp4.dhcp4/24862]
>         DHCP4_STARTED Kea DHCPv4 server version 1.3.0-beta started
>
>         2017-10-05 18:16:19.020 INFO  [kea-dhcp4.leases/24862]
>         DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0x2c0f9a70: lease
>         192.168.1.160 will be advertised
>         2017-10-05 18:16:19.021 INFO  [kea-dhcp4.leases/24862]
>         DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0x2c0f9a70: lease
>         192.168.1.161 will be advertised
>         2017-10-05 18:16:19.029 ERROR [kea-dhcp4.alloc-engine/24862]
>         ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0xa6d4566b: error during
>         attempt to allocate an IPv4 address: unable to bind parameters
>         for <INSERT INTO lease4(address, hwaddr, client_id,
>         valid_lifetime, expire, subnet_id, fqdn_fwd, fqdn_rev,
>         hostname, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)>,
>         reason:  (error code 0)
>
>         I'm also trying to get this working with a Percona XtraDB
>         cluster and having the same problem, this a a five server cluster:
>
>         Installed Packages
>         Name        : Percona-XtraDB-Cluster-57
>         Arch        : x86_64
>         Epoch       : 0
>         Version     : 5.7.19
>         Release     : 29.22.1.el7
>         Size        : 0.0 
>         Repo        : @System
>         From repo   : percona-release-x86_64
>
>         2017-10-05 18:06:44.996 INFO  [kea-dhcp4.leases/16988]
>         DHCP4_INIT_REBOOT [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0x9ddd43c: client is in
>         INIT-REBOOT state and requests address 192.168.1.161
>         2017-10-05 18:06:52.548 INFO  [kea-dhcp4.leases/16988]
>         DHCP4_INIT_REBOOT [hwtype=1 da:d9:a8:4c:30:9d],
>         cid=[01:da:d9:a8:4c:30:9d], tid=0x1299a707: client is in
>         INIT-REBOOT state and requests address 192.168.1.170
>         2017-10-05 18:07:00.225 INFO  [kea-dhcp4.leases/16988]
>         DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0x989c660b: lease
>         192.168.1.160 will be advertised
>         2017-10-05 18:07:00.227 INFO  [kea-dhcp4.leases/16988]
>         DHCP4_LEASE_ADVERT [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0x989c660b: lease
>         192.168.1.161 will be advertised
>         2017-10-05 18:07:00.228 ERROR [kea-dhcp4.alloc-engine/16988]
>         ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:0c:29:bc:bc:18],
>         cid=[01:00:0c:29:bc:bc:18], tid=0xed6a4f7f: error during
>         attempt to allocate an IPv4 address: unable to bind parameters
>         for <INSERT INTO lease4(address, hwaddr, client_id,
>         valid_lifetime, expire, subnet_id, fqdn_fwd, fqdn_rev,
>         hostname, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)>,
>         reason:  (error code 0)
>
>         In both of those cases on the cluster and the single server
>         the error messages just keep repeating. There is also nothing
>         in the leases table.
>
>         Does anyone currently use a DB for lease data? Is there any
>         more information I can provide about this problem? Is this
>         likely to be something I've missed in building kea? Kea 1.3
>         beta does work OK using a file for lease storage. :)
>
>         Regards
>
>
>         Bill
>
>
>
>
>
>
>
>
>
>         _______________________________________________
>         Kea-users mailing list
>         Kea-users at lists.isc.org
>         https://lists.isc.org/mailman/listinfo/kea-users
>
>
>
>     _______________________________________________
>     Kea-users mailing list
>     Kea-users at lists.isc.org
>     https://lists.isc.org/mailman/listinfo/kea-users
>
>
>
> _______________________________________________
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users




More information about the Kea-users mailing list