Need help with java.net.UnknownHostException

4,331 views
Skip to first unread message

Pierre Retoille

unread,
Dec 18, 2011, 6:45:20 AM12/18/11
to jenkins...@googlegroups.com
Hello,

I experience a strange problem with Jenkins.
I am currently running Jenkins version 1.443 but the problem occurs since about 3 months independently from the versions of Jenkins.
Jenkins is running on Ubuntu in a kvm virtual machine. Before Jenkins worked correctly for a long time. The error appeared after the virtual machine was by accident started twice at the same time. This probably corrupted some configuration files.

The actual error is as follows:
When I try to update a plugin from within Jenkins and I click on download I get the error  " java.net.UnknownHostException: updates.jenkins-ci.org "

It seems as if Jenkins can not resolve the address of the update server.
  • Überprüfe Zugang zum Internet
  • Überprüfe Zugang zu jenkins-ci.org-Server
  • Hostname updates.jenkins-ci.org konnte nicht aufgelöst werden. Eventuell sollten Sie einen HTTP-Proxy konfigurieren?
  • java.net.UnknownHostException: updates.jenkins-ci.org
    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
    	at java.net.Socket.connect(Socket.java:546)
    	at java.net.Socket.connect(Socket.java:495)
    	at sun.net.NetworkClient.doConnect(NetworkClient.java:178)
    	at sun.net.www.http.HttpClient.openServer(HttpClient.java:409)
    	at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
    	at sun.net.www.http.HttpClient.<init>(HttpClient.java:240)
    	at sun.net.www.http.HttpClient.New(HttpClient.java:321)
    	at sun.net.www.http.HttpClient.New(HttpClient.java:338)
    	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:935)
    	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)
    	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:801)
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
    	at hudson.model.UpdateCenter$UpdateCenterConfiguration.testConnection(UpdateCenter.java:736)
    	at hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCenter(UpdateCenter.java:585)
    	at hudson.model.UpdateCenter$ConnectionCheckJob.run(UpdateCenter.java:883)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:679) 
    

There is no Proxy set up and no proxy is necessary on this machine to access the Internet.
I have reinstalled Jenkins, I have reinstalled Java but the error remains.
If I try to ping updates.jenkins-ci.org from the server everything works fine.
If I try to download files from updates.jenkins-ci.org using wget or firefox everything works fine as well.

Could someone please give me a hint, what might be the source of the error. Also I appreciate a hint what else I should check. Or how I should proceed to figure out what is going wrong.

thank you very much

Pierre

Pierre Retoille

unread,
Dec 20, 2011, 5:00:16 AM12/20/11
to jenkins...@googlegroups.com
Is there nobody who can help me with that issue?

Should I send this message better to the developers mailing list?

Pierre

Nord, James

unread,
Dec 20, 2011, 5:30:36 AM12/20/11
to jenkins...@googlegroups.com

Check your systems (ubuntu) configured host name resolver.  (DNS is configured and working correctly  /etc/resolve.conf IIRC.   Run “getent hosts updates.jenkins-ci.org” from a terminal and see if that works – if not I would ask on the Ubuntu forums)

 

It is more likely your host is incorrectly setup than Jenkins is incorrect.

 

/James




**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************

Mark Waite

unread,
Dec 20, 2011, 7:52:53 AM12/20/11
to jenkins...@googlegroups.com
I don't know if this is related to your issue, but I had networking problems which required that I force Java to only use IPv4 networking on some Debian installations.  There is a command line argument that you might try to see if that helps with the problem:

JAVA_ARGS="-Djava.net.preferIPv4Stack=true"

On my Debian machine, that is in a comment in the file /etc/default/jenkins.

Mark Waite


From: Pierre Retoille <pierre....@hotmail.fr>
To: jenkins...@googlegroups.com
Sent: Tuesday, December 20, 2011 3:00 AM

Subject: Re: Need help with java.net.UnknownHostException

Pierre Retoille

unread,
Dec 20, 2011, 12:17:24 PM12/20/11
to jenkins...@googlegroups.com
In my Jenkins configuration file the named line was commented out.
When I enabled it, there was no change in the network behavior though.

Thank you anyway for your help.
Pierre

Pierre Retoille

unread,
Dec 20, 2011, 12:26:41 PM12/20/11
to jenkins...@googlegroups.com
On 20.12.2011 11:30, Nord, James wrote:

Check your systems (ubuntu) configured host name resolver.  (DNS is configured and working correctly  /etc/resolve.conf IIRC.   Run “getent hosts updates.jenkins-ci.org” from a terminal and see if that works – if not I would ask on the Ubuntu forums)

Thanks for this hint.
In fact the file /etc/resolv.conf had as user and group mysql and the rights were set as 0660. Therefore the network worked correctly for user root but not for user jenkins.
I changed the owner to root:root and the right to 0644. Now the network works for all users and the Jenkins updates are working again.

Thanks a lot
Pierre
Reply all
Reply to author
Forward
0 new messages