<div dir="ltr">This may be more appropriate for the MAAS mailing list after all. The reason I originally sent it to juju was that line added to /etc/hosts, which I think was done by juju (see at the end of the email)<br><br>

<div class="gmail_quote"><br><div dir="ltr">Sorry for the confusing subject line.<div><br></div><div>This is the issue:</div><div><div>2013-11-07 13:47:02 UTC FATAL:  no pg_hba.conf entry for host "10.0.5.100", user "landscape", database "landscape-standalone-main", SSL off</div>


<div>2013-11-07 13:47:02 UTC DETAIL:  Client IP address resolved to "10-0-5-100.maaslocal", forward lookup not checked.</div></div><div><br></div><div>My landscape unit (kmkxr.maaslocal) cannot talk to postgresql.</div>


<div><br></div><div>pg_hba.conf:</div><div><div>host all all kmkxr.maaslocal md5</div></div><div><br></div><div>connecting machine is <a href="http://10.0.5.100" target="_blank">10.0.5.100</a>:</div><div># host 10.0.5.100<br>

</div><div><div>
100.5.0.10.in-addr.arpa domain name pointer 10-0-5-100.maaslocal.</div></div><div><br></div><div><div># host kmkxr.maaslocal</div><div>kmkxr.maaslocal is an alias for 10-0-5-100.maaslocal.</div><div>10-0-5-100.maaslocal has address 10.0.5.100</div>


</div><div><br></div><div>Postgresql does a reverse lookup on the connecting IP, which gives it the name "10-0-5-100.maaslocal". That doesn't match the entry in pg_hba.conf (kmkxr.maaslocal), and the connection is rejected.</div>


<div><br></div><div>The "kmkxr.maaslocal" string came from the juju relation "private-address" key:</div><div><br></div><div><div>postgresql/0:db-admin-relation-changed % relation-get</div><div>private-address: kmkxr.maaslocal</div>


</div><div><br></div><div>On that kmkxr machine /etc/hosts has this entry:</div><div><div># Added by cloud-init on Thu, 07 Nov 2013 13:11:18 +0000</div><div>127.0.1.1<span style="white-space:pre-wrap">   </span>kmkxr.maaslocal kmkxr</div>


</div><div><br></div><div>And:</div><div><div>root@kmkxr:~# hostname -f</div><div>kmkxr.maaslocal</div><div><br></div></div><div>I'm guessing that's why private-address was set to kmkxr.maaslocal (although "address" implies an IP to me, not a fqdn).</div>


<div><br></div><div>If I remove that entry from /etc/hosts:</div><div><div>root@kmkxr:~# hostname -f</div><div>10-0-5-100.maaslocal</div></div><div><br></div><div>As I understand it, maas pre-generates all possible A and PTR records for the network it was given, and adds CNAMEs as machines get provisioned. In this case, kmkxr.maaslocal is a CNAME, but at the same time it was added to /etc/hosts.</div>


<div><br></div><div>So, I don't know where the bug is. I'm tempted to say we shouldn't add that /etc/hosts entry since everything is in DNS handled by maas.</div><div><br></div><div>In any case, the postgresql charm can't get the unit's connecting IP from the relation data unless it's explicitly set.</div>


</div>
</div><br></div>