[Kea-users] hooks libraries failed to validate

Eric Graham eric.graham at vantagepnt.com
Fri Jun 23 15:28:20 UTC 2023


Hi Darren,

No, Kea itself does not get recompiled. This is part of the benefit of the hooks system. Kea source / SOs need to be present to link to, but only the hook needs to be recompiled. This is why you can distribute the premium hooks as standalone packages, instead of distributing a version of Kea for every combination of hooks.

Eric Graham
DevOps Specialist
Direct: 605.990.1859
Eric.Graham at vantagepnt.com<mailto:eric.graham at vantagepnt.com>
[cid:6b2a08dc-f0d8-4382-b8eb-bb9a5bd4f0b4]
________________________________
From: Kea-users <kea-users-bounces at lists.isc.org> on behalf of Darren Ankney <darren.ankney at gmail.com>
Sent: Friday, June 23, 2023 6:22 AM
To: kea-users at lists.isc.org <kea-users at lists.isc.org>
Subject: Re: [Kea-users] hooks libraries failed to validate

CAUTION: This email originated outside the organization. Do not click any links or attachments unless you have verified the sender.
Hi all,

I must admit, I've never built a custom hook before, but wouldn't you need to make this part of the Kea source tree (as described for the premium hooks: https://kea.readthedocs.io/en/kea-2.2.0/arm/hooks.html#installing-hook-packages) and recompile Kea with the hook? The developer's guide may be useful as well: https://reports.kea.isc.org/dev_guide/



On Thu, Jun 22, 2023 at 10:31 AM Eric Graham <eric.graham at vantagepnt.com<mailto:eric.graham at vantagepnt.com>> wrote:
Ronald,

That error is a catch-all for essentially any reason your hook isn't working cleanly. Maybe you're missing a function or have some other (syntactically valid) error. Also make sure that the permissions on the SO are correct, and that it's linking correctly if you didn't compile on the server. Can you provide us a minimal (non)working example?

Eric Graham
DevOps Specialist
Direct: 605.990.1859
Eric.Graham at vantagepnt.com<mailto:eric.graham at vantagepnt.com>
[cid:188e7f8d0c233a801ca1]
________________________________
From: Kea-users <kea-users-bounces at lists.isc.org<mailto:kea-users-bounces at lists.isc.org>> on behalf of DDFR | Ronald Blaas <ronald.blaas at ddfr.nl<mailto:ronald.blaas at ddfr.nl>>
Sent: Thursday, June 22, 2023 7:43 AM
To: kea-users at lists.isc.org<mailto:kea-users at lists.isc.org> <kea-users at lists.isc.org<mailto:kea-users at lists.isc.org>>
Subject: [Kea-users] hooks libraries failed to validate

CAUTION: This email originated outside the organization. Do not click any links or attachments unless you have verified the sender.
Hi all,

Breaking my head over here.

Can't seem to figure out what I am missing here.

Trying to create a custom hook. Using https://reports.kea.isc.org/dev_guide/df/d46/hooksdgDevelopersGuide.html#hooksdgTutorial as an example.

So I have created 5 files (version.cc / library_common.h / load_unload.cc / pkt_receive.cc / pkt_send.cc)
compiled it
g++ -I /usr/include/kea -L /usr/lib -fpic -shared -o test_hook.so load_unload.cc pkt_receive4.cc pkt_send.cc version.cc -lkea-dhcpsrv -lkea-dhcp++ -lkea-hooks -lkea-log -lkea-util -lkea-exceptions

mv the "test_hook.so" to the Hooks dir for kea.

Edited the config file to include the hook.

But after restart of kea-dhcp4 services I see this error (and kea does not start)

Jun 22 14:42:29 dhcp1 kea-dhcp4[81922]: 2023-06-22 14:42:29.237 ERROR [kea-dhcp4.dhcp4/81922.140261235613312] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file '/etc/kea/kea-dhcp4.conf': hooks libraries failed to validate - library or libraries in error are: /usr/lib/x86_64-linux-gnu/kea/hooks/test_hook.so (/etc/kea/kea-dhcp4.conf:25:5)


So where did I go wrong?

Regards
--
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

Kea-users mailing list
Kea-users at lists.isc.org<mailto:Kea-users at lists.isc.org>
https://lists.isc.org/mailman/listinfo/kea-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20230623/cd8b2e34/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-fxizbljl.png
Type: image/png
Size: 16388 bytes
Desc: Outlook-fxizbljl.png
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20230623/cd8b2e34/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-dxmyvv3x.png
Type: image/png
Size: 16388 bytes
Desc: Outlook-dxmyvv3x.png
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20230623/cd8b2e34/attachment-0003.png>


More information about the Kea-users mailing list