[Varnish] #357: Varnish exits quietly when arguments to -a or -T resolves to multiple, similar IP addresses

Varnish varnish-bugs at projects.linpro.no
Tue Oct 21 11:59:46 CEST 2008


#357: Varnish exits quietly when arguments to -a or -T resolves to multiple,
similar IP addresses
----------------------+-----------------------------------------------------
 Reporter:  ssm       |       Owner:  phk
     Type:  defect    |      Status:  new
 Priority:  normal    |   Milestone:     
Component:  varnishd  |     Version:  2.0
 Severity:  normal    |    Keywords:     
----------------------+-----------------------------------------------------
 = Summary =

 When a hostname used as an argument for -a or -t resolves to multiple,
 similar, IP addresses, varnish exits at start with return code 0, and no
 error message.

 = Environment =

 Observed on Linux 2.6.

 This was observed when the name "localhost" resolved to multiple similar
 addresses.  Not exactly a common scenario, hopefully.

 /etc/hosts contained the following information for "localhost":

 {{{
 127.0.0.1 localhost
 127.0.0.1 localhost.localdomain localhost
 }}}

 When starting without "-d", the exit code is "0", and no error messages
 are printed.  No varnish processes are running before or after these
 commands have been run.
 {{{
 # /usr/sbin/varnishd -P  /var/run/varnishd.pid -a localhost:6081 -T
 127.0.0.1:6082 -b 127.0.0.1:8080 -u varnish -g varnish
 storage_file: filename: ./varnish.R7z0le (unlinked) size 715 MB.
 Using old SHMFILE

 # /usr/sbin/varnishd -P  /var/run/varnishd.pid -a 127.0.0.1:6081 -T
 localhost:6082 -b 127.0.0.1:8080 -u varnish -g varnish
 storage_file: filename: ./varnish.atOxPT (unlinked) size 715 MB.
 Using old SHMFILE
 }}}

 = Debugging =

 With debugging, a bit more information is available, at least for the
 management address:

 == debug: service address ==
 The -a address resolves to multiple (similar) IP addresses.  Exit code
 here is "0".
 {{{
 # /usr/sbin/varnishd -d -P  /var/run/varnishd.pid -a localhost:6081 -T
 127.0.0.1:6082 -b 127.0.0.1:8080 -u varnish -g varnish
 storage_file: filename: ./varnish.6FMb2V (unlinked) size 715 MB.
 Using old SHMFILE
 New Pid 11375

 Debugging mode, enter "start" to start child
 start
 child (11376) Started
 Pushing vcls failed: CLI communication error
 Child (11376) said Closed fds: 3 5 7 11 12 14 15
 Child (11376) said Child starts
 Child (11376) said managed to mmap 750772224 bytes of 750772224
 Child (11376) said Ready
 unlink ./vcl.1P9zoqAU.so
 k 1 rev 16
 #
 }}}

 == debug: management address ==
 The -T address resolves to multiple (similar) IP addresses. Exit code here
 is "0".
 {{{
 # /usr/sbin/varnishd -d -P  /var/run/varnishd.pid -a 127.0.0.1:6081 -T
 localhost:6082 -b 127.0.0.1:8080 -u varnish -g varnish
 storage_file: filename: ./varnish.avOhWv (unlinked) size 715 MB.
 Using old SHMFILE
 New Pid 11529

 bind(): Address already in use
 Assert error in mgt_cli_telnet(), mgt_cli.c line 478:
   Condition(sock >= 0) not true.
   errno = 98 (Address already in use)
 k 1 rev 16
 #
 }}}

 == debug: backend address ==

 For completeness, I tried with the backend address as well.  The exit code
 here is "2", and an error message is printed.  This is expected behaviour.

 The -b address resolves to multiple (similar) IP addresses.
 {{{
 # /usr/sbin/varnishd -d -P  /var/run/varnishd.pid -a 127.0.0.1:6081 -T
 127.0.0.1:6082 -b localhost:8080 -u varnish -g varnish
 Backend host "localhost": resolves to multiple IPv4 addresses.
 Only one address is allowed.
 Please specify which exact address you want to use, we found these:
         127.0.0.1
         127.0.0.1
 (input Line 2 Pos 13)
     .host = "localhost";
 ------------###########-

 In backend specification starting at:
 (input Line 1 Pos 1)
 backend default {
 #######----------

 VCL compilation failed
 #
 }}}

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/357>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list