Hi Andres, On 04/06/22 at 15:13 -0400, Andres Salomon wrote: > Thanks for the report. I can't reproduce this, though. > > The code in question is this: > > > /* > * Get the host name and its IP address. Convert the IP address to dotted > * ASCII form. > */ > if (gethostname(hnm, sizeof(hnm) - 1)) { > cem = "ERROR!!! can't get this host's name"; > goto print_errno; > } > hnm[sizeof(hnm) - 1] = '\0'; > if (!(hp = gethostbyname(hnm))) { > (void) snprintf(buf, bufl - 1, "ERROR!!! can't get IP address for > %s", > hnm); > buf[bufl - 1] = '\0'; > > > It seems like gethostbyname() is failing, which presumably is a > misconfiguration on the part of the build host (probably something in > /etc/hosts?). I'm pretty sure local hostname forward and reverse lookups > don't violate policy 4.9 "required targets must not attempt network access, > except, via the loopback interface", but correct me if I'm wrong. > > I've attached the build log and the diff between our build logs, just in > case that's helpful (although you're using sbuild and I'm not, so the diff > isn't very readable).
This is not related to the build attempting network access (I don't check against this, so even if it did require network access, the build would work just fine). What happens in AWS is: - the hostname is ip-10-84-234-245 (for example) - /etc/hosts contains (on the host) 127.0.1.1 ip-10-84-234-245.eu-central-1.compute.internal ip-10-84-234-245 - schroot does not copy the host's /etc/hosts to the chroot, because the chroot is configured (using sbuild-create-chroot) to use the 'sbuild' schroot profile, which does not include 'hosts' in /etc/schroot/sbuild/nssdatabases As a result, if the hostname cannot be resolved using DNS but only using NSS (/etc/hosts), then it cannot be resolved inside the chroot. I fixed my chroot setup script so that 'hosts' get copied from host, and confirmed that lsof now builds fine. I let you decide whether you want to close this bug, or turn it into a severity:minor "FTBFS when hostname cannot be resolved". I am not aware of other packages failing to build in the AWS environment because of this issue, so it might be worth keeping track of with a bug. Lucas