getdnsapi / stubby

Stubby is the name given to a mode of using getdns which enables it to act as a local DNS Privacy stub resolver (using DNS-over-TLS).
https://dnsprivacy.org/dns_privacy_daemon_-_stubby/
BSD 3-Clause "New" or "Revised" License
1.18k stars 99 forks source link

Stuppy service not starting #252

Closed ajaikumarnadar closed 4 years ago

ajaikumarnadar commented 4 years ago

whenever I try to start the stubby service.. I get the following errors in logs

Sun Jun 7 13:12:09 2020 daemon.err stubby[14322]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_by_id: symbol not found Sun Jun 7 13:12:09 2020 daemon.err stubby[14322]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_free: symbol not found Sun Jun 7 13:12:09 2020 daemon.err stubby[14322]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_set_default: symbol not found Sun Jun 7 13:12:09 2020 daemon.err stubby[14322]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_finish: symbol not found Sun Jun 7 13:12:09 2020 daemon.err stubby[14322]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_load_builtin_engines: symbol not found

Please help !

saradickinson commented 4 years ago

Looks like stubby cannot find the libgetdns library at run time: 1) Are you sure libgetdns exists in that location 2) can you run ldd on the stubby executable 3) Can you clarify what OS you are on and how you installed and built both stubby and getdns?

ajaikumarnadar commented 4 years ago
1.
root@X-WRT:~# ls -al /usr/lib/libgetdns.so.10
lrwxrwxrwx    1 root     root            19 Jun  7 12:28 /usr/lib/libgetdns.so.10 -> libgetdns.so.10.1.2

2.
root@X-WRT:/# ldd /usr/sbin/stubby
        /lib/ld-musl-mipsel-sf.so.1 (0x77f03000)
        libyaml-0.so.2 => /usr/lib/libyaml-0.so.2 (0x77edf000)
        libgetdns.so.10 => /usr/lib/libgetdns.so.10 (0x77e83000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x77e5f000)
        libc.so => /lib/ld-musl-mipsel-sf.so.1 (0x77f03000)
        libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x77dd4000)
        libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x77bb0000)
Error relocating /usr/lib/libgetdns.so.10: ENGINE_by_id: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_free: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_set_default: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_finish: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_load_builtin_engines: symbol not found

3. I am running stubby in X-WRT, a OpenWRT based firmware. It has package manager opkg by which I installed the stubby packages and other dependencies might have got installed automatically.

Thanks for your reply :)

ajaikumarnadar commented 4 years ago

Also getdns version is 1.5.2-2

johndickinson commented 4 years ago

Can you confirm that /usr/lib/libgetdns.so.10.1.2 exists?

ajaikumarnadar commented 4 years ago

Hi John,

Below is the ls command output for your reference.

root@X-WRT:~# ls -al /usr/lib/libgetdns.so.10.1.2
-rwxr-xr-x    1 root     root        310791 Jun  5 01:51 /usr/lib/libgetdns.so.10.1.2
root@X-WRT:~# ls -al /usr/lib/libgetdns.so.10
lrwxrwxrwx    1 root     root            19 Jun  7 12:28 /usr/lib/libgetdns.so.10 -> libgetdns.so.10.1.2
johndickinson commented 4 years ago

I have never used OpenWRT but have you tried running ldconfig as root?

ajaikumarnadar commented 4 years ago

my default login is actually root..

and there is no package and command named ldconfig in openwrt.

johndickinson commented 4 years ago

Turns out I do have access to OpenWRT but via Luci and I didn't remember. There is no ldconfig or any build tools. I imagine that the code was cross compiled to run on OpenWRT and so I expect some kind of packaging error. I notice that the symbols not found all come from OpenSSL. I wonder if the issue is the version of OpenSSL that getdns is compiled against???? Can you try ldd /usr/lib/libgetdns.so.10.1.2

ajaikumarnadar commented 4 years ago
root@X-WRT:~# ldd /usr/lib/libgetdns.so.10.1.2
        ldd (0x77e61000)
        libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x77d7a000)
        libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x77b56000)
        libc.so => ldd (0x77e61000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x77b32000)
Error relocating /usr/lib/libgetdns.so.10.1.2: ENGINE_by_id: symbol not found
Error relocating /usr/lib/libgetdns.so.10.1.2: ENGINE_free: symbol not found
Error relocating /usr/lib/libgetdns.so.10.1.2: ENGINE_set_default: symbol not found
Error relocating /usr/lib/libgetdns.so.10.1.2: ENGINE_finish: symbol not found
Error relocating /usr/lib/libgetdns.so.10.1.2: ENGINE_load_builtin_engines: symbol not found
johndickinson commented 4 years ago

Have you tried reinstalling getdns and stubby? It worked here: https://forum.openwrt.org/t/stubby-issues-out-of-nowhere/36814/2

ajaikumarnadar commented 4 years ago

Even after reinstall of both getdns and stubby, still I am getting same error.

root@X-WRT:~# stubby
Error relocating /usr/lib/libgetdns.so.10: ENGINE_by_id: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_free: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_set_default: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_finish: symbol not found
Error relocating /usr/lib/libgetdns.so.10: ENGINE_load_builtin_engines: symbol not found
saradickinson commented 4 years ago

To be honest, this looks like a packaging issue for OpenWRT.... you might be better off contacting someone who has worked on that stubby package e.g. @jonathanunderwood (https://github.com/jonathanunderwood)?

jonathanunderwood commented 4 years ago

I package stubby for OpenWRT, but have no sight into X-WRT (in fact, I never knew about it until just now!). This looks like something X-WRT specific, given that stubby is working fine for many users in OpenWRT.

ajaikumarnadar commented 4 years ago

Actually, X-WRT is a fork of OpenWRT firmware. (https://github.com/x-wrt/x-wrt)

@ptpt52 is founder / developer of X-WRT.

@saradickinson Thanks for your guidance :)

saradickinson commented 4 years ago

@jonathanunderwood thanks for the response :-)

@ajaikumarnadar hope you can resolve this with the X-WRT folks!

ajaikumarnadar commented 4 years ago

I tried reaching the developer of X-WRT for help, but he's unable to help with this...

I think the issue that I am facing is very much related to the below link...

https://github.com/getdnsapi/getdns/issues/401

If you have a look at the above link, common keywords that match with my issue are "ENGINE_by_id", "ENGINE_load_builtin_engines", etc.

Sat Jul  4 14:24:37 2020 daemon.err stubby[29374]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_by_id: symbol not found
Sat Jul  4 14:24:37 2020 daemon.err stubby[29374]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_free: symbol not found
Sat Jul  4 14:24:37 2020 daemon.err stubby[29374]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_set_default: symbol not found
Sat Jul  4 14:24:37 2020 daemon.err stubby[29374]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_finish: symbol not found
Sat Jul  4 14:24:37 2020 daemon.err stubby[29374]: Error relocating /usr/lib/libgetdns.so.10: ENGINE_load_builtin_engines: symbol not found
Sat Jul  4 14:24:37 2020 daemon.info procd: Instance stubby::stubby s in a crash loop 9 crashes, 0 seconds since last crash