[Kea-users] Infinite lease not stored in postgresql DB

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Kea-users] Infinite lease not stored in postgresql DB

Laurent Aubert (laaubert)

Hi,

 

We deployed KEA 1.5 with a postgresql DB without any issue. We have an application which asks for IP addresses with an infinite lease.

 

When KEA receives the request, we see the following error:

 

<a href="tel:2019">2019-06-06 09:05:02.566 ERROR [kea-dhcp4.alloc-engine/259] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:00:00:00:00:00], cid=[ff:00:00:00:00:00:02:00:00:00:09:01:10:49:52:38:30:39:47:2d:4c:54:45:2d:47:41:2d:4b:39:02:0
b:4a:4d:58:32:30:32:33:58:30:30:30], tid=0x8aed1f: error during attempt to allocate an IPv4 address: Could not create bind array from Lease4: 192.168.89.2, reason: Time value is too large: <a href="tel:5854779197">5854779197

 

Everything works fine if we use csv file to store the leases instead of postgres.

 

Any idea why such leases can’t be stored in the DB ?

 

Our config is the following:

 

# This is a basic configuration for the Kea DHCPv4 and DHCPv6 servers.

# Subnet declarations are commented out and no interfaces are listed.

# Therefore, the servers will not listen or respond to any queries.

# The basic configuration must be extended to specify interfaces on

# which the servers should listen. Also, subnets and options must be

# declared.

{

 

# DHCPv4 configuration starts here.

"Dhcp4":

{

# Add names of interfaces to listen on.

  "interfaces-config": {

    "interfaces": ["*" ]

  },

 

# Control gent configuration

   "control-socket": {

        "socket-type": "unix",

        "socket-name": "/tmp/kea-dhcp4-ctrl.sock"

    },

 

# Use PostgresDB

  "lease-database": {

    "typedb": "postgresql",

    "host": "10.10.10.22",

    "user": "kea",

    "password": "kea",

    "namedb": "kea"

  },

 

 

 

# Inifite lease

  "valid-lifetime": -1,

 

# Below an example of the simple subnet declaration. Uncomment to

# enable it. This is a list, denoted with [ ], of structure, denoted

# with { }. Each structure describes a single subnet and may have

# several parameters. One of those parameters is "pools" that is

# also a list of structures.

  "subnet4": [

{    "subnet": "192.168.89.0/24",

          "id": 4001,

       "pools": [ { "pool": "192.168.89.2 - 192.168.89.100" } ] }

  ]

},

 

 

# Logging configuration starts here. It tells Kea servers to store

# all log messages (on severity INFO or more) in a file.

# debuglevel variable is used on DEBUG level only.

"Logging":

{

  "loggers": [

    {

      "name": "kea-dhcp4",

      "output_options": [

          {

            "output": "/var/log/kea/kea-dhcp4.log"

          }

      ],

      "severity": "INFO",

      "debuglevel": 0

    }

 

  ]

}

 

}

 

 

Thanks for your help

 

 

 


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Infinite lease not stored in postgresql DB

Sten Carlsen


On 06/06/2019 13.02, Laurent Aubert (laaubert) wrote:

Hi,

 

We deployed KEA 1.5 with a postgresql DB without any issue. We have an application which asks for IP addresses with an infinite lease.

 

When KEA receives the request, we see the following error:

 

<a href="tel:2019" moz-do-not-send="true">2019-06-06 09:05:02.566 ERROR [kea-dhcp4.alloc-engine/259] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:00:00:00:00:00], cid=[ff:00:00:00:00:00:02:00:00:00:09:01:10:49:52:38:30:39:47:2d:4c:54:45:2d:47:41:2d:4b:39:02:0
b:4a:4d:58:32:30:32:33:58:30:30:30], tid=0x8aed1f: error during attempt to allocate an IPv4 address: Could not create bind array from Lease4: 192.168.89.2, reason: Time value is too large: <a href="tel:5854779197" moz-do-not-send="true">5854779197

How is your definition of the lease time field in the database? this value requires 33 bits to be stored.

 

Everything works fine if we use csv file to store the leases instead of postgres.

Yes, not limited by a fixed number of bits.

 

Any idea why such leases can’t be stored in the DB ?

 


Sten

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Infinite lease not stored in postgresql DB

Laurent Aubert (laaubert)

Thanks Sten for your reply.

 

In our understanding the tool kea-admin lease-init, initialize the PostgresDB with the right schema defined for Kea

 

The way data is stored in PostgresDB is defined by Kea schema, which is defined here:

https://github.com/isc-projects/kea/blob/master/src/share/database/scripts/pgsql/dhcpdb_create.pgsql

 

Where valid_lifetime is define as:

valid_lifetime BIGINT,

 

And  according to PostgreSQL doc is:

bigint     8 bytes  large-range integer          -9223372036854775808 to +9223372036854775807

 

So is there a problem with the schema for PostgreSQL ?

 

Thanks,

Laurent.

 

From: Kea-users <[hidden email]> on behalf of Sten Carlsen <[hidden email]>
Date: Thursday, June 6, 2019 at 5:20 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: [Kea-users] Infinite lease not stored in postgresql DB

 

 

On 06/06/2019 13.02, Laurent Aubert (laaubert) wrote:

Hi,

 

We deployed KEA 1.5 with a postgresql DB without any issue. We have an application which asks for IP addresses with an infinite lease.

 

When KEA receives the request, we see the following error:

 

<a href="tel:2019">2019-06-06 09:05:02.566 ERROR [kea-dhcp4.alloc-engine/259] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:00:00:00:00:00], cid=[ff:00:00:00:00:00:02:00:00:00:09:01:10:49:52:38:30:39:47:2d:4c:54:45:2d:47:41:2d:4b:39:02:0
b:4a:4d:58:32:30:32:33:58:30:30:30], tid=0x8aed1f: error during attempt to allocate an IPv4 address: Could not create bind array from Lease4: 192.168.89.2, reason: Time value is too large: <a href="tel:5854779197">5854779197

How is your definition of the lease time field in the database? this value requires 33 bits to be stored.

 

Everything works fine if we use csv file to store the leases instead of postgres.

Yes, not limited by a fixed number of bits.

 

Any idea why such leases can’t be stored in the DB ?

 

 

Sten


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Infinite lease not stored in postgresql DB

Sten Carlsen
This was just a quick check for obvious things, I have nor used database backends. I am trying to learn because I see obvious advantages in my setting.


-- 
Best regards

Sten Carlsen

No improvements come from shouting:

      "MALE BOVINE MANURE!!!"

On 6 Jun 2019, at 18.24, Laurent Aubert (laaubert) <[hidden email]> wrote:

Thanks Sten for your reply.

 

In our understanding the tool kea-admin lease-init, initialize the PostgresDB with the right schema defined for Kea

 

The way data is stored in PostgresDB is defined by Kea schema, which is defined here:

https://github.com/isc-projects/kea/blob/master/src/share/database/scripts/pgsql/dhcpdb_create.pgsql

 

Where valid_lifetime is define as:

valid_lifetime BIGINT,

 

And  according to PostgreSQL doc is:

bigint     8 bytes  large-range integer          -9223372036854775808 to +9223372036854775807

 

So is there a problem with the schema for PostgreSQL ?

 

Thanks,

Laurent.

 

From: Kea-users <[hidden email]> on behalf of Sten Carlsen <[hidden email]>
Date: Thursday, June 6, 2019 at 5:20 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: [Kea-users] Infinite lease not stored in postgresql DB

 

 

On 06/06/2019 13.02, Laurent Aubert (laaubert) wrote:

Hi,

 

We deployed KEA 1.5 with a postgresql DB without any issue. We have an application which asks for IP addresses with an infinite lease.

 

When KEA receives the request, we see the following error:

 

<a href="tel:2019">2019-06-06 09:05:02.566 ERROR [kea-dhcp4.alloc-engine/259] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:00:00:00:00:00], cid=[ff:00:00:00:00:00:02:00:00:00:09:01:10:49:52:38:30:39:47:2d:4c:54:45:2d:47:41:2d:4b:39:02:0
b:4a:4d:58:32:30:32:33:58:30:30:30], tid=0x8aed1f: error during attempt to allocate an IPv4 address: Could not create bind array from Lease4: 192.168.89.2, reason: Time value is too large: <a href="tel:5854779197">5854779197

How is your definition of the lease time field in the database? this value requires 33 bits to be stored.

 

Everything works fine if we use csv file to store the leases instead of postgres.

Yes, not limited by a fixed number of bits.

 

Any idea why such leases can’t be stored in the DB ?

 

 

Sten


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Infinite lease not stored in postgresql DB

Thomas Markwalder
Please see section 4.3.6 of Kea Admin Guide:

https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#idm139894053942032



On 6/6/19 12:56 PM, Sten Carlsen wrote:
This was just a quick check for obvious things, I have nor used database backends. I am trying to learn because I see obvious advantages in my setting.


-- 
Best regards

Sten Carlsen

No improvements come from shouting:

      "MALE BOVINE MANURE!!!"

On 6 Jun 2019, at 18.24, Laurent Aubert (laaubert) <[hidden email]> wrote:

Thanks Sten for your reply.

 

In our understanding the tool kea-admin lease-init, initialize the PostgresDB with the right schema defined for Kea

 

The way data is stored in PostgresDB is defined by Kea schema, which is defined here:

https://github.com/isc-projects/kea/blob/master/src/share/database/scripts/pgsql/dhcpdb_create.pgsql

 

Where valid_lifetime is define as:

valid_lifetime BIGINT,

 

And  according to PostgreSQL doc is:

bigint     8 bytes  large-range integer          -9223372036854775808 to +9223372036854775807

 

So is there a problem with the schema for PostgreSQL ?

 

Thanks,

Laurent.

 

From: Kea-users <[hidden email]> on behalf of Sten Carlsen <[hidden email]>
Date: Thursday, June 6, 2019 at 5:20 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: [Kea-users] Infinite lease not stored in postgresql DB

 

 

On 06/06/2019 13.02, Laurent Aubert (laaubert) wrote:

Hi,

 

We deployed KEA 1.5 with a postgresql DB without any issue. We have an application which asks for IP addresses with an infinite lease.

 

When KEA receives the request, we see the following error:

 

<a href="tel:2019" moz-do-not-send="true">2019-06-06 09:05:02.566 ERROR [kea-dhcp4.alloc-engine/259] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:00:00:00:00:00], cid=[ff:00:00:00:00:00:02:00:00:00:09:01:10:49:52:38:30:39:47:2d:4c:54:45:2d:47:41:2d:4b:39:02:0
b:4a:4d:58:32:30:32:33:58:30:30:30], tid=0x8aed1f: error during attempt to allocate an IPv4 address: Could not create bind array from Lease4: 192.168.89.2, reason: Time value is too large: <a href="tel:5854779197" moz-do-not-send="true">5854779197

How is your definition of the lease time field in the database? this value requires 33 bits to be stored.

 

Everything works fine if we use csv file to store the leases instead of postgres.

Yes, not limited by a fixed number of bits.

 

Any idea why such leases can’t be stored in the DB ?

 

 

Sten


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Infinite lease not stored in postgresql DB

Thomas Markwalder
You need only use a very large value to get a lease that it is virtually infinite. So long as the value is no more than max for 32-bit signed integer you should be fine.

On 6/6/19 2:49 PM, Thomas Markwalder wrote:
Please see section 4.3.6 of Kea Admin Guide:

https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#idm139894053942032



On 6/6/19 12:56 PM, Sten Carlsen wrote:
This was just a quick check for obvious things, I have nor used database backends. I am trying to learn because I see obvious advantages in my setting.


-- 
Best regards

Sten Carlsen

No improvements come from shouting:

      "MALE BOVINE MANURE!!!"

On 6 Jun 2019, at 18.24, Laurent Aubert (laaubert) <[hidden email]> wrote:

Thanks Sten for your reply.

 

In our understanding the tool kea-admin lease-init, initialize the PostgresDB with the right schema defined for Kea

 

The way data is stored in PostgresDB is defined by Kea schema, which is defined here:

https://github.com/isc-projects/kea/blob/master/src/share/database/scripts/pgsql/dhcpdb_create.pgsql

 

Where valid_lifetime is define as:

valid_lifetime BIGINT,

 

And  according to PostgreSQL doc is:

bigint     8 bytes  large-range integer          -9223372036854775808 to +9223372036854775807

 

So is there a problem with the schema for PostgreSQL ?

 

Thanks,

Laurent.

 

From: Kea-users <[hidden email]> on behalf of Sten Carlsen <[hidden email]>
Date: Thursday, June 6, 2019 at 5:20 PM
To: "[hidden email]" <[hidden email]>
Subject: Re: [Kea-users] Infinite lease not stored in postgresql DB

 

 

On 06/06/2019 13.02, Laurent Aubert (laaubert) wrote:

Hi,

 

We deployed KEA 1.5 with a postgresql DB without any issue. We have an application which asks for IP addresses with an infinite lease.

 

When KEA receives the request, we see the following error:

 

<a href="tel:2019" moz-do-not-send="true">2019-06-06 09:05:02.566 ERROR [kea-dhcp4.alloc-engine/259] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 00:00:00:00:00:00], cid=[ff:00:00:00:00:00:02:00:00:00:09:01:10:49:52:38:30:39:47:2d:4c:54:45:2d:47:41:2d:4b:39:02:0
b:4a:4d:58:32:30:32:33:58:30:30:30], tid=0x8aed1f: error during attempt to allocate an IPv4 address: Could not create bind array from Lease4: 192.168.89.2, reason: Time value is too large: <a href="tel:5854779197" moz-do-not-send="true">5854779197

How is your definition of the lease time field in the database? this value requires 33 bits to be stored.

 

Everything works fine if we use csv file to store the leases instead of postgres.

Yes, not limited by a fixed number of bits.

 

Any idea why such leases can’t be stored in the DB ?

 

 

Sten


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users