CapitalS
CapitalS

Reputation: 61

Jenkins on Ubuntu UnknownHostException when installing plugins

Im using a linux ubuntu 20.10 server (bare metal server on OVH) and have jenkins installed on it. I keep getting java.net.UnknownHostException: updates.jenkins.io or java.net.UnknownHostException: get.jenkins.io when trying to install plugins using the jenkins ui. The strange thing is it works occasionally after multiple attempts but most of the time the installation fails with java.net.UnknownHostException. I also get Failed to resolve host name updates.jenkins.io. Perhaps you need to configure HTTP proxy? in some cases. I assume it has the same underlying issue as the other exceptions. However i could successfully curl updates.jenkins.io.

I couldn't find anything useful on the internet. Some suggested to look into the DNS configuration but i dont know what i should be looking for exactly. There is only 1 entry in the /etc/resolv.conf nameserver 213.186.33.99.

Upvotes: 2

Views: 9641

Answers (2)

gavenkoa
gavenkoa

Reputation: 48713

Another possibility is blocked UDP DNS name resolution by firewall.

As per https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-controllers/jenkins-is-experiencing-unknownhostexception it could be disabled in favor to TCP with:

-Dhudson.DNSMultiCast.disabled=true -Dhudson.udp=-1

Upvotes: 0

CapitalS
CapitalS

Reputation: 61

I solved the problem by following this anwser: [https://unix.stackexchange.com/questions/71551/could-not-resolve-host-error][1]

Basically i added these lines to /etc/resolv.conf. `

nameserver 208.67.222.222
nameserver 208.67.220.220

nameserver 8.8.8.8
nameserver 8.8.4.4

Apparently the standard dns server provided by ovh server doesn't work correctly.

Upvotes: 4

Related Questions