Hi,

For completeness, the issue was a typo:

        "Dhcp4": {
                "hooks-libraries": [{
                        "library": "/usr/local/lib/hooks/libdhcp_flex_id.so",
                        "parameters": {
—>                                “identifer-expression": "relay4[1].hex"
                        }
                }],

However, running -t said syntax was OK.

I guess this is a bug in the -t switch for kea-dhcp4?

> On Sep 6, 2017, at 8:59 AM, Jason Lixfeld <[email protected]> wrote:
> 
> Oh, I’m sorry - I guess perhaps I should include some system specific info? :/
> 
> root@build:/var/log/kea# uname -a
> Linux build 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 
> GNU/Linux
> root@build:/var/log/kea# cat /etc/debian_version
> 9.1
> root@build:/var/log/kea#
> 
> Out from ./configure:
> 
>       Kea source configure results:
>    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> 
> Package:
>  Name:            kea
>  Version:         1.2.0
>  Extended version:1.2.0 (tarball)
>  OS Family:       Linux
>  Using GNU sed:   yes
>  Premium package: yes
> 
> C++ Compiler:
>  CXX:             g++
>  CXX_VERSION:     g++ (Debian 6.3.0-18) 6.3.0 20170516
>  CXX_STANDARD:    201402
>  DEFS:            -DHAVE_CONFIG_H
>  CPPFLAGS:         -DOS_LINUX  -I$(top_srcdir)/ext/coroutine 
> -DBOOST_ASIO_HEADER_ONLY -DBOOST_ASIO_DISABLE_THREADS=1 
> -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED
>  CXXFLAGS:        -g -O2
>  LDFLAGS:          -lpthread
>  KEA_CXXFLAGS:     -Wall -Wextra -Wnon-virtual-dtor -Wwrite-strings 
> -Woverloaded-virtual -Wno-sign-compare -pthread 
> -Wno-missing-field-initializers -fPIC
> 
> Python:
>  PYTHON_VERSION:  not needed (because kea-shell is disabled)
> 
> Boost:
>  BOOST_VERSION:   1.62
>  BOOST_INCLUDES:
>  BOOST_LIBS:
> 
> OpenSSL:
>  CRYPTO_VERSION:  OpenSSL 1.1.0f  25 May 2017
>  CRYPTO_CFLAGS:
>  CRYPTO_INCLUDES:
>  CRYPTO_LDFLAGS:
>  CRYPTO_LIBS:     -lcrypto
> 
> Botan: no
> 
> Log4cplus:
>  LOG4CPLUS_VERSION: 1.1.2
>  LOG4CPLUS_INCLUDES: -I/usr/include
>  LOG4CPLUS_LIBS:  -L/usr/lib -L/usr/lib64 -llog4cplus
> 
> Flex/bison:
>  FLEX:  flex
>  BISON: bison -y
> 
> MySQL:
>  no
> 
> PostgreSQL:
>  PGSQL_VERSION:   PostgreSQL 9.6.3
>  PGSQL_CPPFLAGS:  -DFRONTEND -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE 
> -I/usr/include/libxml2 -I/usr/include/tcl8.6 -I/usr/include/postgresql 
> -I/usr/include/postgresql/9.6/server
>  PGSQL_LIBS:      -L/usr/lib/x86_64-linux-gnu -lpq
> 
> Cassandra CQL:
>  no
> 
> Developer:
>  Enable Debugging: no
>  Google Tests: no
>  Valgrind: not found
>  C++ Code Coverage: no
>  Logger checks: no
>  Generate Documentation: no
>  Parser Generation: no
>  Kea-shell: no
> 
>> On Sep 6, 2017, at 8:49 AM, Jason Lixfeld <[email protected]> wrote:
>> 
>> I tend to fumble around debugging stuff like this, so forgive me if I’m not 
>> doing what you ask; I really have no idea how :)
>> 
>> What I was able to piece together was starting up with LD_DEBUG=all :
>> 
>> root@build:/var/log/kea# LD_DEBUG=all /usr/local/sbin/kea-dhcp4 -c 
>> /usr/local/etc/kea/kea.conf -d &> kea2.log
>> 
>> Chopping through that log file, I found this:
>> 
>> 2017-09-06 07:33:28.874 ERROR [kea-dhcp4.hooks/46864] HOOKS_LOAD_ERROR 
>> 'load' function in hook library /usr/local/lib/hooks/libdhcp_flex_id.so 
>> returned error 1
>> 
>> Following that back up the logfile I found this:
>> 
>> 2017-09-06 07:33:28.874 ERROR [kea-dhcp4.flex-id/46864] 
>> FLEX_ID_EXPRESSION_NOT_DEFINED Expression (identifier-expression) is not 
>> defined.
>> 
>> And following that back up further still, I found this:
>> 
>> /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup error: 
>> undefined symbol: subnet4_select (fatal)
>> 
>> So then I pulled out anything related to that particular error for the 
>> flex_id library:
>> 
>> root@build:/var/log/kea# grep "/usr/local/lib/hooks/libdhcp_flex_id.so: 
>> error:" kea2.log
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: buffer4_receive (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: buffer4_send (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: context_create (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: context_destroy (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: control_command_receive (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease4_decline (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease4_expire (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease4_recover (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease4_release (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease4_renew (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease4_select (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease6_expire (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease6_rebind (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease6_recover (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease6_renew (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: lease6_select (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: pkt4_receive (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: pkt4_send (fatal)
>>    46864:    /usr/local/lib/hooks/libdhcp_flex_id.so: error: symbol lookup 
>> error: undefined symbol: subnet4_select (fatal)
>> 
>> What confuses me though, is that by cherry picking the first undefined 
>> symbol itself from the log file, it appears to be there, so I’m not sure why 
>> it’s not able to look it up:
>> 
>> root@build:/var/log/kea# grep buffer4_receive kea2.log
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/hooks/libdhcp_flex_id.so [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-dhcp++.so.5 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-asiolink.so.4 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-dns++.so.0 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-cc.so.2 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-hooks.so.3 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-log.so.3 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-eval.so.5 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-threads.so.1 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-util.so.2 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-exceptions.so.0 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/lib/x86_64-linux-gnu/libgcc_s.so.1 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/lib/x86_64-linux-gnu/libpthread.so.0 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/lib/x86_64-linux-gnu/libc.so.6 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/local/lib/libkea-cryptolink.so.2 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/lib/x86_64-linux-gnu/libdl.so.2 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/lib/x86_64-linux-gnu/libm.so.6 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/usr/lib/x86_64-linux-gnu/liblog4cplus-1.1.so.9 [0]
>>    46864:    symbol=buffer4_receive;  lookup in 
>> file=/lib64/ld-linux-x86-64.so.2 [0]
>> 
>> Also, I’m confused about how the LD_LIBRARY_PATH issue would cause runtime 
>> issues.  Wouldn’t the hook fail to compile in the first place, or is 
>> LD_LIBRARY_PATH required at runtime?
>> 
>> Notwithstanding, I found this:
>> 
>> https://kea.isc.org/ticket/3741
>> 
>> Which suggests that while even though the startup error is different, 
>> running ldconfig after make install works, if required, however in my case, 
>> that didn’t do much of anything.
>> 
>> So any other insight appreciated :)
>> 
>>> On Sep 6, 2017, at 3:47 AM, Francis Dupont <[email protected]> wrote:
>>> 
>>> Try to get the HOOKS_OPEN_ERROR which returns errors from dlopen().
>>> Note the main reason to get dlopen to not find DSOs is to forget to
>>> set LD_LIBRARY_PATH...
>>> 
>>> Regards
>>> 
>>> Francis Dupont <[email protected]>
>> 
>> _______________________________________________
>> Kea-users mailing list
>> [email protected]
>> https://lists.isc.org/mailman/listinfo/kea-users
> 
> _______________________________________________
> Kea-users mailing list
> [email protected]
> https://lists.isc.org/mailman/listinfo/kea-users

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

Reply via email to