> On Tue, Oct 17, 2017 at 12:15 AM, Sam Hague <[email protected]> wrote:
>
> any idea if this is an infra issue? looks like this is hitting multiple 
> projects:
>
> java.net.UnknownHostException: centos7-java-builder-2c-8g-7805: 
> centos7-java-builder-2c-8g-7805: Name or service not known
>
>>   My openflowplugin patch is failing with the below error.
>>
>>   Suspecting some infra issue, any pointers?
>>
>>   https://jenkins.opendaylight.org/releng/job/openflowplugin-v
>> erify-oxygen-mvn33-openjdk8/325/console


Hello Faseela, Sam:

Based on suggestions from [1.] this issue is because the nodes require a
"$(IP)\t$(hostname)" entry in /etc/hosts file. The Java API in question
requires hostname (and not `localhost`) therefore returns a
"java.net.UnknownHostException: Name or service not known" without the
entry in /etc/hosts. Is this issue seen with other jobs running on
different flavors (Ubuntu 16.04)?

I verified that the present image and the previous working image have no
difference in /etc/hosts or nssswitch.conf configurations, while
something seems to have been updated in the newer images.

1. CentOS 7 - java-builder - 20170807-2145 (previously working image)

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4
localhost4.localdomain4 ::1         localhost localhost.localdomain
localhost6 localhost6.localdomain6

#hostname -f
hostname: Name or service not known

2. CentOS 7 - java-builder - 20171017-0146 (recent image)
# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4
localhost4.localdomain4 ::1         localhost localhost.localdomain
localhost6 localhost6.localdomain6

#hostname -f
hostname: Name or service not known

Based on my investigation we can go with one of the workarounds for java
builder images:

1. Modify /etc/hosts directly: Testing OF verify job in [2.] with
modifying /etc/hosts, (with a one-liner script in builder section) does
work and verify jobs goes through successfully. However, this can be
done only through startup scripts [3.] and not during image build image
since the hostname (is dependent on the flavor and resources associated
with the label on Jenkins configuration) and IP is available only at
runtime, may not be recommended.

2.  The better alternative is the update "/etc/nss-switch.conf" and
append the hosts: line with "myhostname", which ensures that the system
binds the hostname to the assigned IP, without any changes required to
/etc/hosts.

I think 2. might be better since we can fix this in image build time,
but am also open other suggestions. Please review change in [4.].

[1.] https://stackoverflow.com/questions/33028842/
unknownhostexception-name-or-service-not-known
[2.]
https://jenkins.opendaylight.org/sandbox/job/openflowplugin-verify-oxygen-mvn33-openjdk8/3/
[3.]
https://github.com/opendaylight/releng-builder/blob/master/jenkins-scripts/builder.sh
[4.] https://git.opendaylight.org/gerrit/64497

Thanks,
Anil


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
openflowplugin-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev

Reply via email to