Coda File System

Re: unable to connect to internal server

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Mon, 24 Jul 2000 13:14:26 -0400
On Mon, Jul 24, 2000 at 10:07:25AM -0400, Bradley W. Langhorst wrote:
> Jan Harkes wrote:
> > It could be that `strange', your server, has a problem in /etc/hosts.
> > To be precise, the following line:
> > 
> >     127.0.0.1 localhost strange.langhorst.com
> > 
> > Things go wrong because gethostbyname("strange.langhorst.com") returns
> > 127.0.0.1 and this is then returned in the volume lookups (i.e. it is
> > stored in the VRDB and VLDB files). The client is then able to find the
> > volume, GetRootVolume and GetVolInfo succeed. But attaching to the
> > volume fails, because it cannot reach a server at 127.0.0.1.
> > 
> > Jan
> Sorry to be thick if I've got this all confused...
> Seems to me that what should happen is that the client
> successfully determines the IP address of the server by looking at the
> hosts file (there is no local DNS).

It did, otherwise the GetRootVolume call wouldn't have succeeded.

> the hosts file looks like this:
> 127.0.0.1	bwlnote	localhost.localdomain localhost
	        ^^^^^^^
	    BAD!!!!!
> ...
> 192.168.0.6	strange.langhorst.com strange
> 
> So why would the client be trying to reach a server at 127.0.0.1 when it
> knows that strange is the server and that its address is 192.168.0.6?  

Ok, the client knows how to contact the `volume location service'
running as part of the server. Now when a volume is created, we build
the Volume Replication Database (VRDB), and the Volume Location Database
(VLDB), _on the server_. These files contain the mappings of volumes to
servers, something like:

VRDB:
rootvolume -> rootvolume.0
repvol     -> repvol.0, repvol.1
...

VLDB:
rootvolume.0 -> 192.168.0.6
repvol.0     -> 192.168.0.6
repvol.1     -> 192.168.0.7
...

(actually, I believe the VRDB stores those ip-addresses as well).

Now how did the server come up with the ip-address to put in the VLDB?
myipaddress = gethostbyname(hostname()), so when that call returns the
localhost address on your server, the VLDB will contain:

rootvolume.0 -> 127.0.0.1

So the client contacts 129.168.0.6, and asks for the location of
rootvolume and get's back... rootvolume.0 @ 127.0.0.1, then the client
tries to connect to the server running at 127.0.0.1... ooops

> Incidentally, I've added bwlnote to strange's(server's) hosts file so it
> can resolve 192.168.0.3now. This does produce one interesting new
> behavior (I think we're getting to the root of the problem).  I now get

Ehhh, you might need to be able to resolve the client on the servers,
because the server tries to set up an RPC2 connection back to the client
to send callback messsages. Although it shouldn't really need it because
the server already knows the ip-address, it might still try to do a
blocking gethostbyaddr to get the `pretty name' to display in log
messages.

> The server logs look identical all that I can tell has changed is the
> addition of the error messages giving me info on the failure to find
> Volume name.

There should be a file /vice/db/ROOTVOLUME which is used to find the
name of the volume to mount on /coda.

Jan
Received on 2000-07-24 13:16:52