kea-shell fails to start due to dependency kea_conn being in wrong location

Bug #2009959 reported by Juha Suhonen
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
isc-kea (Debian)
Fix Released
Unknown
isc-kea (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Michał Małoszewski

Bug Description

[Impact]

kea-shell fails to start on Jammy.
That issue is caused by the wrong location of kea_conn. Kea-shell tries to find python's kea_conn package from '/usr/lib/python3.10/site-packages/kea'. Python3-kea-connector installs this in /usr/lib/python3/dist-packages/kea.
The fix is to change the location of kea_conn.py and kea_connector3.py.

[Test Plan]

Make a container for testing:

$ lxc launch ubuntu-daily:jammy jammy-test
$ lxc shell jammy-test

Type in:

$ apt install kea-ctrl-agent

After it is installed, type in:

$ kea-shell

Example of failed output:

Traceback (most recent call last):
  File "/usr/sbin/kea-shell", line 27, in <module>
    from kea_conn import CARequest # CAResponse
ModuleNotFoundError: No module named 'kea_conn'

Example of successful output:

kea-shell starts without any issues

[Where problems could occur]

Since the kea-shell uses the python library from package python3-kea-connector for connecting to kea's rest API, there might be a problem connecting to kea’s rest API if there is a location change of the kea_conn package.
It is unlikely but possible that users could hardcode a valid kea_conn location. Therefore if the same user wants to install isc-kea, there is a high risk that a warning message will appear and there is a necessity to unify it by removing it and installing the package again.

-------------------------original bug report-----------------------------

kea-shell (included in package kea-ctrl-agent) uses python library from package python3-kea-connector for connecting to kea's rest api.

By default, kea-shell tries to find python's kea_conn package from '/usr/lib/python3.10/site-packages/kea' (this is hard-coded into the script). python3-kea-connector installs this in /usr/lib/python3/dist-packages/kea.

$ /usr/sbin/kea-shell
Traceback (most recent call last):
  File "/usr/sbin/kea-shell", line 27, in <module>
    from kea_conn import CARequest # CAResponse
ModuleNotFoundError: No module named 'kea_conn'

$ sudo ln -sv /usr/lib/python3/dist-packages/kea /usr/lib/python3.10/site-packages/
'/usr/lib/python3.10/site-packages/kea' -> '/usr/lib/python3/dist-packages/kea'

$ /usr/sbin/kea-shell
(starts and works as expected)

$ lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04

$ apt-cache policy kea-ctrl-agent python3-kea-connector
kea-ctrl-agent:
  Installed: 2.0.2-1
  Candidate: 2.0.2-1
  Version table:
 *** 2.0.2-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status
python3-kea-connector:
  Installed: 2.0.2-1
  Candidate: 2.0.2-1
  Version table:
 *** 2.0.2-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

Related branches

Revision history for this message
Paride Legovini (paride) wrote :

I think this has been fixed in Debian in version 2.0.2-3, and in Ubuntu Kinetic and Lunar.

isc-kea (2.0.2-3) unstable; urgency=medium

  * d/rules: configure: specify the Python site packages location.
    Related changes:
     - d/python3-kea-connector.install: update paths accordingly
    Thanks to Kilian Krause (Closes: #1014995)

 -- Paride Legovini <email address hidden> Wed, 20 Jul 2022 16:03:19 +0000

Changed in isc-kea (Ubuntu Jammy):
status: New → Triaged
Changed in isc-kea (Ubuntu):
status: New → Fix Released
Changed in isc-kea (Debian):
status: Unknown → Fix Released
Changed in isc-kea (Ubuntu Jammy):
assignee: nobody → Michał Małoszewski (michal-maloszewski99)
description: updated
description: updated
description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Juha, or anyone else affected,

Accepted isc-kea into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/isc-kea/2.0.2-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in isc-kea (Ubuntu Jammy):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Michał Małoszewski (michal-maloszewski99) wrote :

The fix works, isc-kea 2.0.2-1ubuntu0.1 fixes the bug.

I've created a jammy container using steps from the [Test Plan] section listed above in the Bug Description and inside that container..

I have installed the isc-kea that is included in the kea-ctrl-agent using:

$ apt install kea-ctrl-agent

Then checked:
$ apt policy kea-ctrl-agent

The output:

kea-ctrl-agent:
  Installed: 2.0.2-1
  Candidate: 2.0.2-1
  Version table:
 *** 2.0.2-1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

Then I have typed in:

$ kea-shell

The issue did exist:

Traceback (most recent call last):
  File "/usr/sbin/kea-shell", line 27, in <module>
    from kea_conn import CARequest # CAResponse
ModuleNotFoundError: No module named 'kea_conn'

Then I've upgraded kea-ctrl-agent:
$ apt install kea-ctrl-agent=2.0.2-1ubuntu0.1

Later I've typed in:

$ apt policy kea-ctrl-agent

 kea-ctrl-agent:
  Installed: 2.0.2-1ubuntu0.1
  Candidate: 2.0.2-1ubuntu0.1
  Version table:
 *** 2.0.2-1ubuntu0.1 500
        500 http://archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status

Finally when I typed in:

$ kea-shell

the problem did not exist, so the fix works.

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
tags: added: server-todo
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isc-kea - 2.0.2-1ubuntu0.1

---------------
isc-kea (2.0.2-1ubuntu0.1) jammy; urgency=medium

  * Fix location of the dependency kea_conn to let kea-shell start
    without any failuers (LP: #2009959)

 -- Michal Maloszewski <email address hidden> Fri, 12 May 2023 21:11:47 +0200

Changed in isc-kea (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for isc-kea has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.