varnishcache-friends / libvmod-geoip2

Varnish VMOD to query MaxMind GeoIP2 DB files
BSD 2-Clause "Simplified" License
39 stars 17 forks source link

Varnish fails to start on import geoip2; #30

Closed LaravelFreelancerNL closed 5 years ago

LaravelFreelancerNL commented 5 years ago

Hi,

When I try to import the geoip2 vmod Varnish will fail on a restart.

libvmod_geoip2 files are present in proper vmods directory with the same grants as other vmods.

I can import std for example without issues.

Do you have any idea how to fix this?

OS: Debian Stretch Varnish version: 6.1.1 libvmod-geoip2 branch: master/devel

start of the vcl:

vcl 4.1;

import std;
import geoip2;

Error:

● varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2018-12-22 12:24:08 CET; 8s ago
  Process: 31118 ExecStart=/usr/sbin/varnishd -a :6081 -f /etc/varnish/default.vcl -s malloc,256m (code=exited, status=255)
 Main PID: 30871 (code=exited, status=0/SUCCESS)

Dec 22 12:24:08 s2 varnishd[31118]:         dlerror: (null)
Dec 22 12:24:08 s2 varnishd[31118]: ('/etc/varnish/default.vcl' Line 4 Pos 8)
Dec 22 12:24:08 s2 varnishd[31118]: import geoip2;
Dec 22 12:24:08 s2 varnishd[31118]: -------######-
Dec 22 12:24:08 s2 varnishd[31118]: Running VCC-compiler failed, exited with 2
Dec 22 12:24:08 s2 varnishd[31118]: VCL compilation failed
Dec 22 12:24:08 s2 systemd[1]: varnish.service: Control process exited, code=exited status=255
Dec 22 12:24:08 s2 systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Dec 22 12:24:08 s2 systemd[1]: varnish.service: Unit entered failed state.
Dec 22 12:24:08 s2 systemd[1]: varnish.service: Failed with result 'exit-code
fgsch commented 5 years ago

You need to use the oldstable branch for 4.1/6.0 as described in the README. Please give it a try and let me know if that fixes your problem.

LaravelFreelancerNL commented 5 years ago

Thanks for the quick response.

Just tried oldstable with the same results.

(varnishd -V varnishd (varnish-6.1.1 revision 2f2387038a7b9aca4c31c0f839cda3b7ab3391c0))

fgsch commented 5 years ago

The correct branch for 6.1 is master. I was a bit hasty when replied, sorry. A few questions:

LaravelFreelancerNL commented 5 years ago

no problem.

Tests are passing:

============================================================================
Testsuite summary for libvmod-geoip2 1.2.0
============================================================================
# TOTAL: 5
# PASS:  5
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

Compile & install:

  1. ./autogen.sh
  2. ./configure
  3. make
  4. make check
  5. make install

While trying different branches I did a make clean & make uninstall in between.

fgsch commented 5 years ago

Ok. Do you have multiple varnish installed? What about libmaxminddb? Are you using packages? Can you provide the config.log from running configure?

Can you also try a fresh checkout (or running git clean -f -x -d)?

LaravelFreelancerNL commented 5 years ago

Ok. Do you have multiple varnish installed? Yes thank you very much. There were some remnants of a previous install messing with the paths.

Problem solved, the geoip works marvellously!

Happy holidays and thanks for all the help!

fgsch commented 5 years ago

Thanks for letting me know. Glad everything is working now. Happy holidays for you too!