Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2024-03-21T14:57:02Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/3292kea 2.4.x: make install fails with python 3.122024-03-21T14:57:02ZNatanael Copakea 2.4.x: make install fails with python 3.12kea 2.4.1 fails to `make install` with python 3.12:
```
...
make[4]: Entering directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
make[5]: Entering directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
/bi...kea 2.4.1 fails to `make install` with python 3.12:
```
...
make[4]: Entering directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
make[5]: Entering directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
/bin/mkdir -p '/home/ncopa/aports/main/kea/pkg/kea/usr/sbin'
/bin/mkdir -p '/home/ncopa/aports/main/kea/pkg/kea/usr/lib/python3.12/site-packages/kea'
/usr/bin/install -c kea-shell '/home/ncopa/aports/main/kea/pkg/kea/usr/sbin'
/usr/bin/install -c -m 644 kea_conn.py kea_connector3.py '/home/ncopa/aports/main/kea/pkg/kea/usr/lib/python3.12/site-packages/kea'
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp'
make[5]: *** [Makefile:528: install-pkgpythonPYTHON] Error 1
make[5]: Leaving directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
make[4]: *** [Makefile:740: install-am] Error 2
make[4]: Leaving directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
make[3]: *** [Makefile:577: install-recursive] Error 1
make[3]: Leaving directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin/shell'
make[2]: *** [Makefile:464: install-recursive] Error 1
make[2]: Leaving directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src/bin'
make[1]: *** [Makefile:462: install-recursive] Error 1
make[1]: Leaving directory '/home/ncopa/aports/main/kea/src/kea-2.4.1/src'
make: *** [Makefile:649: install-recursive] Error 1
```
From https://docs.python.org/3/whatsnew/3.12.html
> The asynchat, asyncore, and imp modules have been removed, along with several unittest.TestCase method aliases.https://gitlab.isc.org/isc-projects/kea/-/issues/3025Database initialization if empty db detected.2024-03-01T18:42:14ZMarcin GodzinaDatabase initialization if empty db detected.When setting up the quick docker Kea environment, I encountered a problem with an inconvenient step of manually preparing the database to work with Kea.
The docker environment discourages manual involvement in running containers.
Most o...When setting up the quick docker Kea environment, I encountered a problem with an inconvenient step of manually preparing the database to work with Kea.
The docker environment discourages manual involvement in running containers.
Most other systems I used set up a database automatically when an empty system is detected.
Examples: Nextcloud, Wordpress, nginx, tomcat, mosquito, homeassistant and many more.
This feature would be handy, but not required.kea2.5.6Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/2957dhcpdb_create.pgsql erroneously creates dhcp4_server_modification_ts index on...2024-03-22T13:05:49ZJohn W. O'Briendhcpdb_create.pgsql erroneously creates dhcp4_server_modification_ts index on dhcp6_server table---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
dhcpdb_create.pgsql erroneously creates the dhcp4_server_modification_ts index on the dhcp6_server table
**To Reproduce**
Steps to reproduce the b...---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
dhcpdb_create.pgsql erroneously creates the dhcp4_server_modification_ts index on the dhcp6_server table
**To Reproduce**
Steps to reproduce the behavior:
1. Initialize a PostgreSQL database using dhcpdb_create.pgsql
2. Inspect the dhcp4_server_modification_ts index
3. See that it is associated with the dhcp6_server table
**Expected behavior**
A clear and concise description of what you expected to happen:
The dhcp4_server_modification_ts index should be associated with the dhcp4_server table.
**Environment:**
- Kea version: 2.2.0
- OS: FreeBSD 13.2-RELEASE amd64
- Compiled with pgsql backend
- Loaded hooks: pgsql_cb
**Additional Information**
```
kea=> \di dhcp4_server_modification_ts
List of relations
Schema | Name | Type | Owner | Table
--------+------------------------------+-------+-------+--------------
public | dhcp4_server_modification_ts | index | kea | dhcp6_server
(1 row)
```
This appears to have been introduced as a [copy/paste error in version 7.0 of the schema](https://gitlab.isc.org/isc-projects/kea/-/blob/Kea-2.3.8/src/share/database/scripts/pgsql/dhcpdb_create.pgsql#L1398). I could identify no correspond bug in the MySQL schema.
**Contacting you**
* SMS/Signal: (available upon request)
* GitHub/GitLab: neirbowj
* Mastodon: [@neirbowj@mastodon.online](https://mastodon.online/@neirbowj)kea2.5.8https://gitlab.isc.org/isc-projects/kea/-/issues/2855kea-admin lease-upload (2.2.0) invokes kea-lfc without -4 or -6 resulting in ...2023-07-17T13:58:21ZMarco Munarimar23+w.isc.org@allerta.itkea-admin lease-upload (2.2.0) invokes kea-lfc without -4 or -6 resulting in misleading error (Unknown argument) if no dhcp version was specified to kea-admin---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
After reading the (concise) documentation of `kea-admin` https://kea.readthedocs.io/en/kea-2.2.0/arm/admin.html
and the command line output reporte...---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
After reading the (concise) documentation of `kea-admin` https://kea.readthedocs.io/en/kea-2.2.0/arm/admin.html
and the command line output reported below, I expected to have briefly understood how to use the `lease-upload` command,
as for example `kea-admin lease-upload pgsql -u kea -n database_name -i lease4file.csv` gave instead error "Unknown argument."
```kea-admin 2.2.0
This is a kea-admin script that conducts administrative tasks on
the Kea installation.
Usage: /usr/local/sbin/kea-admin COMMAND BACKEND [parameters]
COMMAND: Currently supported operations are:
- db-init: Initializes new database. Useful for first time installation.
- db-version: Checks version of the existing database schema. Useful
- for checking database version when preparing for an upgrade.
- db-upgrade: Upgrades your database schema.
- lease-dump: Dumps current leases to a memfile-ready CSV file.
- lease-upload: Uploads leases from a CSV file to the database.
- stats-recount: Recounts lease statistics.
BACKEND - one of the supported backends: memfile|mysql|pgsql
PARAMETERS: Parameters are optional in general, but may be required
for specific operations.
-h or --host hostname - specifies a hostname of a database to connect to
-P or --port port - specifies the TCP port to use for the database connection
-u or --user name - specifies username when connecting to a database
-p or --password [password] - specifies a password for the database connection;
if omitted from the command line,
then the user will be prompted for a password
-n or --name database - specifies a database name to connect to
-d or --directory - path to upgrade scripts (default: /usr/local/share/kea/scripts)
-v or --version - print kea-admin version and quit.
-x or --extra - specifies extra argument(s) to pass to the database command
Parameters specific to lease-dump, lease-upload:
-4 to dump IPv4 leases to file
-6 to dump IPv6 leases to file
-i or --input to specify the name of file from which leases will be uploaded
-o or --output to specify the name of file to which leases will be dumped
-y or --yes - assume yes on overwriting temporary files
```
**To Reproduce**
Steps to reproduce the behavior:
1. Prepare Kea daemon dhcpv4 using pgsql as in the following config
```
"Dhcp4": {
//...
"hosts-database": {
"type": "postgresql",
"name": "database_name",
"user": "kea",
"password": "bugreporting",
"host": "localhost",
"port": 5432
}
```
start the previously initialized PosgreSQL database service and the kea service.
(My environment was OpenBSD 7.3 where I installed PostgreSQL and kea from ports
but is probably unrelated)
2. Prepare a valid lease4file.csv (as from /var/lib/kea/kea-leases4.csv)
3. Run:
`kea-admin lease-upload pgsql -u kea -n database_name -i lease4file.csv`
4. See error, it says "Unknown argument"
5. wander what it is (`kea-admin` invokes `kea-lfc` with or without the `-4` or `-6` argument as `kea-admin` was executed by the user)
`kea-admin` doesn't document clearly that either `-4` or `-6` is necessary for the `lease-upload` command, and when not specified it doesn't care to invoke `kea-lfc` which pretend such argument without saying that clearly either).
**Expected behavior**
At least should say "missing argument" (dhcp version) and the documentation or the code should specify that the `kea-admin lease-upload` command needs either -4 or -6, because such information is detected by the file nor by the configuration
**Environment:**
- kea-dhcp4 -V:
```
2.2.0
tarball
linked with:
log4cplus 1.2.2
LibreSSL 3.7.2
database:
PostgreSQL backend 13.0, library 150002
Memfile backend 2.1
```
- OS: OpenBSD 7.3
- Which features were compiled in (in particular which backends): port package kea-2.2.0p0-postgresql
- If/which hooks where loaded in: left as default = no hooks/libraries configured yet
**Additional Information**
**Contacting you**
How can ISC reach you to discuss this matter further? If you do not specify any means such as e-mail, jabber id or a telephone, we may send you a message on github with questions when we have them.
I specified the email address while registering in gitlab.isc.org, this requirement of contact details seems to me obsolete, or I might say
you can contact me by email. I'm able to write the code to fix the issue which affects new users, not anymore neither me because I did learn the expected (by the command) way to use the command (by debugging, not messages).kea2.4.0Piotrek ZadrogaPiotrek Zadrogahttps://gitlab.isc.org/isc-projects/kea/-/issues/2528fix bump_lib_versions to latest release requirements2023-07-17T13:58:25ZRazvan Becheriufix bump_lib_versions to latest release requirementsconsider bump from stable to stable
use 10+ for stable versions as well to support backport to multiple stable versionsconsider bump from stable to stable
use 10+ for stable versions as well to support backport to multiple stable versionskea2.3.0Razvan BecheriuRazvan Becheriuhttps://gitlab.isc.org/isc-projects/kea/-/issues/2499don't extend dhcpdb_create scripts any more2024-03-27T13:32:29ZWlodzimierz Wenceldon't extend dhcpdb_create scripts any moreWe should stop to make two paths of database creation. It leads to mistakes more work during releases additional jobs to check differences. So rather to develop scripts like `dhcpdb_create.mysql` (`dhcpdb_create.pgsql`) and upgrade scrip...We should stop to make two paths of database creation. It leads to mistakes more work during releases additional jobs to check differences. So rather to develop scripts like `dhcpdb_create.mysql` (`dhcpdb_create.pgsql`) and upgrade scripts (eg. upgrade_009_to_010.sh.in) separately we should develop just upgrade scripts which will be executed by dhcpdb_create.sh script.
It's ugly to do it this late in a process but it will make our life much easier in the future.
- [ ] as part of the refactor process, please make sure there's a VERY good reason why there's .in version that needs to be expanded during configure.next-stable-3.0https://gitlab.isc.org/isc-projects/kea/-/issues/2331Kea-Admin db-upgrade fails if using different Port for pgsql2023-07-05T10:39:19ZAlex GastKea-Admin db-upgrade fails if using different Port for pgsql---
name: Kea-Admin db-upgrade fails if using different Port for pgsql
about: Kea-Admin should respect supplied Port (-P) Parameter for doing db-upgrade
---
**Bug Description**
When doing the `db-upgrade` with `kea-admin` using a pgs...---
name: Kea-Admin db-upgrade fails if using different Port for pgsql
about: Kea-Admin should respect supplied Port (-P) Parameter for doing db-upgrade
---
**Bug Description**
When doing the `db-upgrade` with `kea-admin` using a pgsql-Backend with a port different than 5432 the update fails.
The `-P` Parameter is used and verified before but does not work in the real upgrade process.
Starting the PostgreSQL Database on the default-port and omitting the Port-Parameter the update works well.
Example:
```
kea-admin db-upgrade pgsql -h localhost -P 5435 -u kea -p "<my-fancy-password>" -n kea
Database version reported before upgrade: 8.0
Processing /usr/share/kea/scripts/pgsql/upgrade_001.0_to_002.0.sh file...
This script upgrades 1.0 to 2.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_002.0_to_003.0.sh file...
This script upgrades 2.0 to 3.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_003.0_to_003.1.sh file...
This script upgrades 3.0 to 3.1. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_003.1_to_003.2.sh file...
This script upgrades 3.1 to 3.2. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_003.2_to_003.3.sh file...
This script upgrades 3.2 to 3.3. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_003.3_to_004.0.sh file...
This script upgrades 3.3 to 4.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_004.0_to_005.0.sh file...
This script upgrades 4.0 to 5.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_005.0_to_005.1.sh file...
This script upgrades 5.0 to 5.1. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_005.1_to_006.0.sh file...
This script upgrades 5.1 to 6.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_006.0_to_006.1.sh file...
This script upgrades 6.0 to 6.1. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_006.1_to_006.2.sh file...
This script upgrades 6.1 to 6.2. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_006.2_to_007.0.sh file...
This script upgrades 6.2 to 7.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_007_to_008.sh file...
This script upgrades 7.0 to 8.0. Reported version is 8.0. Skipping upgrade.
Processing /usr/share/kea/scripts/pgsql/upgrade_008_to_009.sh file...
psql: error: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
```
**To Reproduce**
Steps to reproduce the behavior:
1. Use Kea with Lease-Backend on pgsql configured with a Port other than 5432
2. Do a software-upgrade (in my case via APT-Packages) [rem. might be another bug that the APT does not upgrade the db-schema itself]
3. Kea reports a wrong Schema-Version at startup.
4. Execute `kea-admin db-upgrade pgsql -h localhost -P 5435 -u kea -p "<my-fancy-password>" -n kea`
5. See that it detects the actual Schema-Version and then in the last step ends with "Connection refused" at Port 5432.
6. Run the PostgreSQL-Software at Port 5432
7. Use the above `kea-admin`-Command with the same `-P` Parameter
8. See that it can't detect the actual Schema and exits:
```
kea-admin db-upgrade pgsql -h localhost -P 5435 -u kea -p "AWlZgeouj5vkRkexSAND" -n kea
psql: error: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5435?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5435?
```
9. Omit the `-P`-Parameter and successfully upgrade the Schema.
10. Turn back the Database to the port used before
11. Start kea and see it running.
**Expected behavior**
The DB-Update Procedure should take full awareness of the changed port and update the database schema accordingly.
In the best case the APT update procedure should implement this step as well (for unattended updating purpose) - I'm not sure if it already does as the manual process already fails.
**Environment:**
- Kea version: 2.1.3 from Cloudsmith-Repository
- OS: Ubuntu 20.04.4 LTS, AMD64
- pgsql-Lease-Backend with Port different than 5432
**Additional Information**
Lease-Backend-Configuration:
```
"lease-database": {
"type": "postgresql",
"user": "kea",
"password": "<my-fancy-password>",
"name": "kea",
"port": 5435
},
```
As the mentioned update-script does take some parameters via `$@`-Variable kea-admin migth don't declare the `-p` or `--port` Parameter for the pgsql Backend.
Other commands like `lease-dump` do behave accordingly:
```
kea-admin lease-dump pgsql -h localhost -P 5435 -u kea -p "<my-fancy-password>" -n kea -4 -o output-dump.csv
psql: error: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
ERROR/kea-admin: lease-dump: psql call failed, exit code: 0
```
**Contacting you**
Please reach out via the contact information on my profile or via Twitter / GitHub.next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/2326are-scripts-in-sync.py matches wrong lines if the lines are similar enough2022-02-24T15:42:20ZAndrei Pavelandrei@isc.orgare-scripts-in-sync.py matches wrong lines if the lines are similar enoughThere have been some false errors reported lately. They need to be fixed to not stop good code from being merged. The problem is, the algorithm used to diff two files is best-effort. It stops on the first line that matches good enough. A...There have been some false errors reported lately. They need to be fixed to not stop good code from being merged. The problem is, the algorithm used to diff two files is best-effort. It stops on the first line that matches good enough. And sometimes that first line is not the line it should match, but a line from a different schema version.kea2.1.4Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/2293kea-admin lease-upload fails if CSV file contains duplicate leases2022-05-23T14:27:10ZAndrei Pavelandrei@isc.orgkea-admin lease-upload fails if CSV file contains duplicate leases```sh
$ kea-admin lease-upload mysql -4 -i /tmp/kea-dhcp4.csv
ERROR 1062 (23000) at line 1: Duplicate entry '167772160' for key 'PRIMARY'
$ kea-admin lease-upload pgsql -4 -i /tmp/kea-dhcp4.csv
ERROR: duplicate key value violates uniqu...```sh
$ kea-admin lease-upload mysql -4 -i /tmp/kea-dhcp4.csv
ERROR 1062 (23000) at line 1: Duplicate entry '167772160' for key 'PRIMARY'
$ kea-admin lease-upload pgsql -4 -i /tmp/kea-dhcp4.csv
ERROR: duplicate key value violates unique constraint "lease4_pkey"
DETAIL: Key (address)=(167772160) already exists.
```
Same for v6.
Duplicate leases are common when running Kea with memfile backend.
Workaround 1: start a dummy Kea server with a low `lfc-timer` e.g. 1 so that it calls kea-lfc and then use the curated `csv.2` file.
Workaround 2: call LFC yourself and then use `csv.2` file: `kea-lfc -4 -x /tmp/kea-dhcp4.csv.2 -i /tmp/kea-dhcp4.csv.1 -o /tmp/kea-dhcp4.csv.output -f /tmp/kea-dhcp4.csv.completed -p /tmp/kea-dhcp4.csv.pid -cignored-path`kea2.1.6Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/2039ability to migrate memfile leases to database leases2022-02-18T08:00:19ZAndrei Pavelandrei@isc.orgability to migrate memfile leases to database leasesThe reverse action that #2038 would take.
Something like: `kea-admin lease-import mysql -6 -o leases.csv`.
These two kea-admin commands would cover all the cases. If someone wants to migrate from MySQL to PostgreSQL they can go through...The reverse action that #2038 would take.
Something like: `kea-admin lease-import mysql -6 -o leases.csv`.
These two kea-admin commands would cover all the cases. If someone wants to migrate from MySQL to PostgreSQL they can go through CSV. That is:
```
kea-admin lease-dump mysql -6 -o leases.csv
kea-admin lease-import pgsql -6 -o leases.csv
```kea2.1.2https://gitlab.isc.org/isc-projects/kea/-/issues/2038ability to migrate database leases to memfile leases2022-02-18T08:00:19ZAndrei Pavelandrei@isc.orgability to migrate database leases to memfile leaseskea-admin does have the lease-dump action which generates a very similar CSV to the one generated and read by kea-dhcp[46] when configured to work with memfile, but it's not quite there yet. Here are differences:
`kea-admin lease-dump m...kea-admin does have the lease-dump action which generates a very similar CSV to the one generated and read by kea-dhcp[46] when configured to work with memfile, but it's not quite there yet. Here are differences:
`kea-admin lease-dump mysql`:
```csv
address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,
10.0.0.0,000C01020334,01000C01020334,7200,2021-08-17 19:00:20,1,0,0,,default,
```
Leases saved by kea-dhcp4:
```csv
address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context
10.0.0.0,00:0c:01:02:03:04,01:00:0c:01:02:03:04,7200,1629215965,1,0,0,,0,
```
Required format changes:
* hwaddr: blob "000C01020334" to colon-separated "00:0c:01:02:03:04"
* client_id: blob "01000C01020334" to colon-separated "01:00:0c:01:02:03:04"
* expire: human-readable "2021-08-17 19:00:20" to unix "1629215965"
* state: human-readable "default" to numeric "0"
And for v6:
`kea-admin lease-dump mysql`:
```csv
address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,hwtype,hwaddr_source,state,user_context
2001:db8:1:0:1::,0001000128AE81F5000C01020304,7200,2021-08-17 19:19:33,1,3600,IA_NA,1,128,0,0,,000C01020304,1,HWADDR_SOURCE_IPV6_LINK_LOCAL,default,
```
Leases saved by kea-dhcp6:
```csv
address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context
2001:db8:1:0:1::,00:01:00:01:28:ae:81:f5:00:0c:01:02:03:3f,7200,1629217233,1,3600,0,1,128,0,0,,00:0c:01:02:03:3f,0,
```
Required format changes:
* duid: blob "0001000128AE81F5000C01020304" to colon-separated "00:01:00:01:28:ae:81:f5:00:0c:01:02:03:3f"
* expire: human-readable "2021-08-17 19:19:33" to unix "1629217233"
* lease-type: human-readable "IA_NA" to numeric "1"
* hwaddr: blob "000C01020304" to colon-separated "00:0c:01:02:03:3f"
* state: human-readable "default" to numeric "0"
And there are two extra columns in the case of lease-dump. What's up with those:
* hwtype
* hwaddr_source
user-context needs to be looked at too in both cases.
The output of `kea-admin lease-dump` might differ for PostgreSQL than for MySQL.kea2.1.2Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/1912update lib dns++ python tools2021-06-03T15:37:03ZFrancis Dupontupdate lib dns++ python tools#1880 showed that even they still work the python tools used for the dns++ library should be updated:
- src/lib/dns/gen-rdatacode.py complains about a not existing (BTW for a long time) file in a not existing (this point triggers the er...#1880 showed that even they still work the python tools used for the dns++ library should be updated:
- src/lib/dns/gen-rdatacode.py complains about a not existing (BTW for a long time) file in a not existing (this point triggers the error) src/lib/dns/python directory. IMHO the corresponding code is obsolete i.e. implements a feature which has not been used since a lot of years if it was used one day...
- src/lib/util/python/gen_wiredata.py triggers a warning with python3. I added a comment at the corresponding line of code.
The documentation should be updated too: for the first script it is in the s-rdatacode entry of the Makefile. The second is in a commented entry of the src/lib/dns/tests/testdata Makefile and requires to be called in the UTC timezone when timestamps are generated as for RRSIG or TKEY RRs (I used with success the TZ environment variable).outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/1667Kea 1.6.2 on Ubuntu Server 20.04 unable to start Kea with systemctl2021-10-19T07:42:43ZJRCKea 1.6.2 on Ubuntu Server 20.04 unable to start Kea with systemctlNot sure which template to use.
Kea will not start with systemctl (and therefore at boot). It errors out with:
> Unable to open database: unable to open '/var/lib/kea-leases4.csv'
It will start just fine with keactrl
Oddly, when star...Not sure which template to use.
Kea will not start with systemctl (and therefore at boot). It errors out with:
> Unable to open database: unable to open '/var/lib/kea-leases4.csv'
It will start just fine with keactrl
Oddly, when started with keactrl if you run:
` systemctl status kea-dhcp4-server`
You get the error that it is not started due to the issue above, but `keactrl status` shows it as active.
```
# keactrl status
DHCPv4 server: active
DHCPv6 server: inactive
DHCP DDNS: inactive
Control Agent: active
Kea DHCPv4 configuration file: /etc/kea/kea-dhcp4.conf
Kea DHCPv6 configuration file: /etc/kea/kea-dhcp6.conf
Kea DHCP DDNS configuration file: /etc/kea/kea-dhcp-ddns.conf
Kea Control Agent configuration file: /etc/kea/kea-ctrl-agent.conf
keactrl configuration file: /etc/kea/keactrl.conf
ERROR/keactrl: Configuration file for Kea does not exist: /etc/kea/kea-dhcp6.conf.
```
I am not using DHCP for IPv6 so that error is expected.
```
# ps -aux | grep "kea"
_kea 2337 0.0 1.0 41620 18956 ? Ss 01:23 0:00 /usr/sbin/kea-ctrl-agent -c /etc/kea/kea-ctrl-agent.conf
root 2398 0.0 1.0 41232 19732 pts/0 S 01:24 0:00 /usr/sbin/kea-dhcp4 -c /etc/kea/kea-dhcp4.conf -d
```
```
# systemctl status kea-dhcp4-server
● kea-dhcp4-server.service - Kea IPv4 DHCP daemon
Loaded: loaded (/lib/systemd/system/kea-dhcp4-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-01-23 01:23:44 PST; 6min ago
Docs: man:kea-dhcp4(8)
Process: 2361 ExecStart=/usr/sbin/kea-dhcp4 -c /etc/kea/kea-dhcp4.conf (code=exited, status=1/FAILURE)
Main PID: 2361 (code=exited, status=1/FAILURE)
Jan 23 01:23:44 en-dhcp systemd[1]: Started Kea IPv4 DHCP daemon.
Jan 23 01:23:44 en-dhcp kea-dhcp4[2361]: 2021-01-23 01:23:44.130 INFO [kea-dhcp4.dhcp4/2361] DHCP4_STARTING Kea DHCPv4 server version 1.6.2 starting
Jan 23 01:23:44 en-dhcp kea-dhcp4[2361]: 2021-01-23 01:23:44.132 ERROR [kea-dhcp4.dhcp4/2361] DHCP4_CONFIG_LOAD_FAIL configuration error using file: /etc/kea/kea-dhcp4.conf, reason: Unable to open database: unable to open '/var/lib/kea-leases4.csv'
Jan 23 01:23:44 en-dhcp kea-dhcp4[2361]: 2021-01-23 01:23:44.132 ERROR [kea-dhcp4.dhcp4/2361] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/etc/kea/kea-dhcp4.conf': Unable to open database:unable to open '/var/lib/kea-leases4.csv'
Jan 23 01:23:44 en-dhcp systemd[1]: kea-dhcp4-server.service: Main process exited, code=exited, status=1/FAILURE
Jan 23 01:23:44 en-dhcp systemd[1]: kea-dhcp4-server.service: Failed with result 'exit-code'.
```
So it's running, but not running? `/var/lib/kea-lease4.csv` does exist, and I verified that it is not a permissions issue by setting it to 777 (rwxrwxrwx), but I get the same error as above.
I have also tried running `keactrl stop` followed by `systemctl start kea-dhcp4-server` and get the same error as above. If I remove the lease file from the conf file (ie set persist to false), then it works and starts up fine. But I need those leases to persist in case of a reboot or power failure etc.
Lastly, my config
```
{ "Dhcp4":
{
"interfaces-config": { "interfaces": [ "enp1s0f0","sub_int1","sub_int2" ] },
"lease-database": {
"type": "memfile",
"persist": true,
"name": "/var/lib/kea-leases4.csv",
"lfc-interval": 3600
},
"valid-lifetime": 43200,
"renew-timer": 28800,
"rebind-timer": 2000,
"echo-client-id": false,
"match-client-id": true,
"authoritative": true,
"subnet4":
[
{
"subnet": "10.10.0.0/16",
"pools": [ { "pool": "10.10.60.1 - 10.10.69.255" } ],
"option-data": [
{ "name": "domain-name-servers", "data": "IP1, IP2>". },
{ "name": "routers", "data": "GW_IP" }
]
},
{
"subnet": "10.12.0.0/16",
"pools": [ { "pool": "10.12.60.0 - 10.12.69.255" } ],
"option-data": [
{"name": "domain-name-servers", "data": "IP" },
{"name": "routers", "data": "GW_IP" }
]
}
],
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"output": "/path/to/log/file.log",
"maxver": 8,
"maxsize": 204800,
"flush": true,
"pattern": "%d{%j %H:%M:%S.%q} %c %m\n"
}
],
"severity": "INFO"
}
]
}
}
```Kea1.9-backloghttps://gitlab.isc.org/isc-projects/kea/-/issues/1663TLS support in kea-shell2021-03-25T18:53:31ZTomek MrugalskiTLS support in kea-shellOnce #1661 and #1662 are done, the next step is to extend ``kea-shell`` to be able to connect to TLS socket. We don’t need python 2 support anymore. It’s ok to replace the existing kea-shell code as loNg as the new code is able to do bot...Once #1661 and #1662 are done, the next step is to extend ``kea-shell`` to be able to connect to TLS socket. We don’t need python 2 support anymore. It’s ok to replace the existing kea-shell code as loNg as the new code is able to do both http and https connections.
Similar to earlier tickets, we may try to reuse code from keys-secure-shell done in #1619, although the tool should be called kea-shell.kea1.9.6Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/1653non-friendly error messages in shell scripts. regression2021-06-24T12:55:53ZAndrei Pavelandrei@isc.orgnon-friendly error messages in shell scripts. regressionBefore the big shell script changes:
```
$ kea-admin db-init
ERROR/kea-admin: missing backend
<usage is printed>
```
Now:
```
$ kea-admin db-init
line 698: 1: unbound variable
```Before the big shell script changes:
```
$ kea-admin db-init
ERROR/kea-admin: missing backend
<usage is printed>
```
Now:
```
$ kea-admin db-init
line 698: 1: unbound variable
```kea1.9.9Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/1602Script to check for duplicate includes in Kea2020-12-30T13:59:32ZAndrei Pavelandrei@isc.orgScript to check for duplicate includes in KeaAlready done in [qa-dhcp#244](https://gitlab.isc.org/isc-private/qa-dhcp/-/issues/244) & [qa-dhcp!89](https://gitlab.isc.org/isc-private/qa-dhcp/-/merge_requests/89), but it would be nice for this to be added to `tools` in Kea instead, s...Already done in [qa-dhcp#244](https://gitlab.isc.org/isc-private/qa-dhcp/-/issues/244) & [qa-dhcp!89](https://gitlab.isc.org/isc-private/qa-dhcp/-/merge_requests/89), but it would be nice for this to be added to `tools` in Kea instead, so that we can check it in Gitlab CI. More checks! :see_no_evil: :hear_no_evil: :speak_no_evil:
From original issue:
It would be nice to have a script that detects duplicate includes which are never, ever useful.
Unless you're including in the middle of a function or something similar which is valid C++, but not commendable C++.kea1.9.4Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/1574make shell tests and shell scripts more robust2021-01-28T10:33:49ZAndrei Pavelandrei@isc.orgmake shell tests and shell scripts more robustMainly I would like to add `set -eu` on all shell scripts so that they don't fail silently i.e. with a success error code e.g. like they did in [ut-basic#119](https://jenkins.isc.org/job/kea-dev/job/ut-basic/119/).
```
[2020-11-23T02:06...Mainly I would like to add `set -eu` on all shell scripts so that they don't fail silently i.e. with a success error code e.g. like they did in [ut-basic#119](https://jenkins.isc.org/job/kea-dev/job/ut-basic/119/).
```
[2020-11-23T02:06:45.668Z] Executing kea-shell (echo | /home/jenkins/workspace/kea-dev/ut-basic/src/bin/shell/kea-shell --host 127.0.0.1 --port 8081 --auth-user pet --auth-password meow list-commands > /home/jenkins/workspace/kea-dev/ut-basic/src/bin/shell/tests/shell-stdout.txt)
[2020-11-23T02:06:45.668Z] sh: fail: unknown operand
```
For the same test `shell_process_tests.sh`, on my computer, it runs in bash since it's missing a shebang so I get a different error:
```
Executing kea-shell (echo | /home/andrei/work/isc/kea/src/bin/shell/kea-shell --host 127.0.0.1 --port 8081 --auth-user pet --auth-password meow list-commands > /home/andrei/work/isc/kea/src/bin/shell/tests/shell-stdout.txt)
/home/andrei/work/isc/kea/src/bin/shell/tests/basic_auth_tests.sh: line 119: [: ==: unary operator expected
```
Regardless, the test passes even though there is an undefiend variable there.
Adding a `#!/bin/sh` shebang to all scripts is another action I would like to take.
And adding all scripts to Gitlab CI.
And so on...kea1.9.3Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/1204Add the version type (i.e. stable or development) in ChangeLog headers.2020-05-21T08:20:28ZFrancis DupontAdd the version type (i.e. stable or development) in ChangeLog headers.Reference #1184 for making the version type more explicit.Reference #1184 for making the version type more explicit.kea1.7.8Francis DupontFrancis Duponthttps://gitlab.isc.org/isc-projects/kea/-/issues/1169update release checklist gitlab issue template2020-06-19T08:36:40ZMichal Nowikowskiupdate release checklist gitlab issue templatekea1.7.9Michal NowikowskiMichal Nowikowskihttps://gitlab.isc.org/isc-projects/kea/-/issues/1085Updated git hook2020-01-24T17:15:45ZTomek MrugalskiUpdated git hookImporting git hook from Stork. The only functional change here is that the hook doesn't add issue number if a number is detected in the commit message already.Importing git hook from Stork. The only functional change here is that the hook doesn't add issue number if a number is detected in the commit message already.kea1.7.4