Closed cosimo closed 5 months ago
Your dockerfile does not show getdns
being installed, which is required for resolver objects, see README.rst. I agree that the error message could be more helpful, though.
The vcc file gets translated into RST which, in turn, gets installed as the man page. It is intended as the reference documentation. If you are missing anything I would appreciate contributions to it or, alternatively, more concrete questions which are currently unanswered.
For usage examples, you might also want to look at the test cases for resolver and service.
Thanks @nigoroll for the pointers.
The docker build doesn't have libgetdns, but the ubuntu 20.04 runtime environment has the libgetdns10
package installed. I now included the lib in the docker build. I expected the .so file to use libgetdns but I don't see that:
root@75da4023b00c:/# ldd /tmp/libvmod-dynamic/src/.libs/libvmod_dynamic.so
linux-vdso.so.1 (0x00007fff565a2000)
libvarnishapi.so.3 => /lib/libvarnishapi.so.3 (0x00007fccbcea0000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fccbce7d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fccbcc8b000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fccbcbfa000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fccbcaab000)
/lib64/ld-linux-x86-64.so.2 (0x00007fccbcef9000)
Will investigate a bit more.
UPDATE: I probably need libgetdns-dev to be installed in the docker container...
Did you install the -dev
package as documented?
UPDATE: crossed with the update to the previous message.
I managed to get past the Object resolver not initialized
using the libvmod_dynamic.so built correctly with libgetdns.
Still can't get the SRV record lookup working correctly... I must be doing something wrong. Closing this at least, the original problem is solved.
I updated the Dockerfile so it builds a correct libvmod_dynamic.so at least. That might be useful to others.
This needs an error message improvement.
Regarding your SRV record lookup, do you use .service()
?
.backend()
in your example is wrong, I thought you might have tried it out of desperation that .service()
did not work, so I did not point this out separately.
Hey @nigoroll, I did just a few minutes ago manage to get the SRV lookup to work, I used the ./src/tests/service/*.vtc
files as reference, and there I saw I should have used the .service()
function.
I will test this a bit now, trying out the different parameters, etc...
Hi!
I'm trying to use libvmod_dynamic with varnish 7.4:
This is on Ubuntu 20.04, and I've build
libvmod_dynamic.so
using this Dockerfile: https://gist.github.com/cosimo/314e441313426a93bdfd3438059e44f9My runtime environment is varnish 7.4.3-1~focal on Ubuntu 20.04.6 TLS x86_64 from the
https://packagecloud.io/varnishcache/varnish74/ubuntu/ focal main
debian repository.The relevant VCL code is:
When starting up varnish, I'm getting the following error:
Have looked at the documentation in the
vmod_dynamic.vcc
but I haven't really understood the reason why the resolver object is not initialized.Other things I've noticed:
varnishadm backend.list -j
I see that the backends seem to be considered sick, as in:ttl_from = dns
option, the error message mentioned that I need to use aresolver
, which I am indeed doing.make check
from inside the Docker container build, 1 test is failing. Here's the output I'm seeing:Would you have any guidance, or examples of usage of libvmod-dynamic? I haven't found much doing web searches or checking other repositories on github.
Thanks!