Created
July 13, 2020 18:21
-
-
Save kamermans/886d063933790d4cfb2ea417f2e6399a to your computer and use it in GitHub Desktop.
Nested Varnish directors errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vcl 4.0; | |
import directors; | |
backend alpha { .host = "192.168.0.101"; } | |
backend bravo { .host = "192.168.0.102"; } | |
sub vcl_init { | |
new primary_director = directors.random(); | |
primary_director.add_backend(alpha, 1.0); | |
new secondary_director = directors.random(); | |
secondary_director.add_backend(bravo, 1.0); | |
new fallback_director = directors.fallback(); | |
fallback_director.add_backend(primary_director); | |
fallback_director.add_backend(secondary_director); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ varnishd -F -f test.vcl | |
Error: | |
Message from VCC-compiler: | |
Symbol not found: 'primary_director' (expected type BACKEND): | |
('test.vcl' Line 15 Pos 35) | |
fallback_director.add_backend(primary_director); | |
----------------------------------################-- | |
('test.vcl' Line 15 Pos 5) -- ('test.vcl' Line 15 Pos 34) | |
fallback_director.add_backend(primary_director); | |
----##############################------------------ | |
Running VCC-compiler failed, exited with 2 | |
VCL compilation failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ varnishd -F -f test.vcl | |
Error: | |
Message from VCC-compiler: | |
Expression has type INSTANCE, expected BACKEND | |
('/etc/varnish/test.vcl' Line 15 Pos 35) -- (Pos 50) | |
fallback_director.add_backend(primary_director); | |
----------------------------------################-- | |
Expected argument: BACKEND (unnamed argument) | |
While compiling function call: | |
('/etc/varnish/test.vcl' Line 15 Pos 5) -- (Pos 50) | |
fallback_director.add_backend(primary_director); | |
----##############################################-- | |
Running VCC-compiler failed, exited with 2 | |
VCL compilation failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment