java.net.BindException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • i have a single Sun box with 2 users. Each user is assigned a hudson slave on the same machine. i keep those two environments distinct because one is used for "CI builds" and the other to trigger "automated installation of our product". Keeping them separated allows me to do some damage control if, for example an automated installation came to get out of it's $WORKSPACE. Now to my problem : after reverifying, it seems that it affects the slavestatus listener : both point to the same machine (yet on different login account) with the same 3141 port. I suppose there is no way for it to know who's who. Feb 11, 2010 3:23:37 PM com.youdevise.hudson.slavestatus.SlaveListener call INFO: Slave-status listener starting Feb 11, 2010 3:23:37 PM com.youdevise.hudson.slavestatus.SlaveListener$1 run SEVERE: Could not listen on port java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.<init>(ServerSocket.java:185) at java.net.ServerSocket.<init>(ServerSocket.java:97) at com.youdevise.hudson.slavestatus.SocketHTTPListener.waitForConnection(SlaveListener.java:129) at com.youdevise.hudson.slavestatus.SlaveListener$1.run(SlaveListener.java:63) at com.youdevise.hudson.slavestatus.Daemon.go(Daemon.java:16) at com.youdevise.hudson.slavestatus.SlaveListener.call(SlaveListener.java:83) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
    via by mmorizot,
  • i have a single Sun box with 2 users. Each user is assigned a hudson slave on the same machine. i keep those two environments distinct because one is used for "CI builds" and the other to trigger "automated installation of our product". Keeping them separated allows me to do some damage control if, for example an automated installation came to get out of it's $WORKSPACE. Now to my problem : after reverifying, it seems that it affects the slavestatus listener : both point to the same machine (yet on different login account) with the same 3141 port. I suppose there is no way for it to know who's who. Feb 11, 2010 3:23:37 PM com.youdevise.hudson.slavestatus.SlaveListener call INFO: Slave-status listener starting Feb 11, 2010 3:23:37 PM com.youdevise.hudson.slavestatus.SlaveListener$1 run SEVERE: Could not listen on port java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.<init>(ServerSocket.java:185) at java.net.ServerSocket.<init>(ServerSocket.java:97) at com.youdevise.hudson.slavestatus.SocketHTTPListener.waitForConnection(SlaveListener.java:129) at com.youdevise.hudson.slavestatus.SlaveListener$1.run(SlaveListener.java:63) at com.youdevise.hudson.slavestatus.Daemon.go(Daemon.java:16) at com.youdevise.hudson.slavestatus.SlaveListener.call(SlaveListener.java:83) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
    via by mmorizot,
  • [20:02] <roxspring> grrr - just noticed that the hudson has put the slaves offline [20:02] <roxspring> am getting this sort of thing an awful lot lately [20:07] <roxspring> typical slave logs go like this: (see below) [20:08] <roxspring> then the slave services won't start up "Error 1067: The process terminated unexpectedly" [20:09] <roxspring> seemingly another rejected connection [20:11] <@kohsuke> I know this issue [20:11] <@kohsuke> It's because Hudson thinks the slave is still connected even though it's not any more [20:11] <@kohsuke> We need to fix this [20:11] <@kohsuke> roxspring: if you can file a ticket, that would be great. {noformat} 15-Mar-2010 14:35:01 hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel channel java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at hudson.remoting.Channel$ReaderThread.run(Channel.java:856) 15-Mar-2010 14:35:01 hudson.remoting.Request$2 run SEVERE: Failed to send back a reply java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.io.BufferedOutputStream.write(Unknown Source) at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source) at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(Unknown Source) at java.io.ObjectOutputStream.writeFatalException(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at hudson.remoting.Channel.send(Channel.java:417) at hudson.remoting.Request$2.run(Request.java:282) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:58) at java.lang.Thread.run(Unknown Source) 15-Mar-2010 14:35:01 hudson.remoting.jnlp.Main$CuiListener status INFO: Terminated {noformat} then the server starts up again {noformat} 15-Mar-2010 14:35:51 hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking 15-Mar-2010 14:35:51 hudson.remoting.jnlp.Main$CuiListener status INFO: Connected 15-Mar-2010 14:35:52 com.youdevise.hudson.slavestatus.SlaveListener call INFO: Slave-status listener starting 15-Mar-2010 14:35:52 com.youdevise.hudson.slavestatus.SlaveListener$1 run SEVERE: Could not listen on port java.net.BindException: Address already in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at com.youdevise.hudson.slavestatus.SocketHTTPListener.waitForConnection(SlaveListener.java:129) at com.youdevise.hudson.slavestatus.SlaveListener$1.run(SlaveListener.java:63) at com.youdevise.hudson.slavestatus.Daemon.go(Daemon.java:16) at com.youdevise.hudson.slavestatus.SlaveListener.call(SlaveListener.java:83) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:58) at java.lang.Thread.run(Unknown Source) 17-Mar-2010 16:14:42 hudson.remoting.jnlp.Main$CuiListener <init> INFO: Hudson agent is running in headless mode. {noformat} Then when connecting... {noformat} 17-Mar-2010 16:14:42 hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking 17-Mar-2010 16:14:42 hudson.remoting.jnlp.Main$CuiListener error SEVERE: The server rejected the connection: hb-slave-trunk1 is already connected to this master. Rejecting this connection. java.lang.Exception: The server rejected the connection: hb-slave-trunk1 is already connected to this master. Rejecting this connection. at hudson.remoting.Engine.run(Engine.java:191) {noformat}
    via by roxspring,
  • [20:02] <roxspring> grrr - just noticed that the hudson has put the slaves offline [20:02] <roxspring> am getting this sort of thing an awful lot lately [20:07] <roxspring> typical slave logs go like this: (see below) [20:08] <roxspring> then the slave services won't start up "Error 1067: The process terminated unexpectedly" [20:09] <roxspring> seemingly another rejected connection [20:11] <@kohsuke> I know this issue [20:11] <@kohsuke> It's because Hudson thinks the slave is still connected even though it's not any more [20:11] <@kohsuke> We need to fix this [20:11] <@kohsuke> roxspring: if you can file a ticket, that would be great. {noformat} 15-Mar-2010 14:35:01 hudson.remoting.Channel$ReaderThread run SEVERE: I/O error in channel channel java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at hudson.remoting.Channel$ReaderThread.run(Channel.java:856) 15-Mar-2010 14:35:01 hudson.remoting.Request$2 run SEVERE: Failed to send back a reply java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.io.BufferedOutputStream.write(Unknown Source) at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source) at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(Unknown Source) at java.io.ObjectOutputStream.writeFatalException(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at hudson.remoting.Channel.send(Channel.java:417) at hudson.remoting.Request$2.run(Request.java:282) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:58) at java.lang.Thread.run(Unknown Source) 15-Mar-2010 14:35:01 hudson.remoting.jnlp.Main$CuiListener status INFO: Terminated {noformat} then the server starts up again {noformat} 15-Mar-2010 14:35:51 hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking 15-Mar-2010 14:35:51 hudson.remoting.jnlp.Main$CuiListener status INFO: Connected 15-Mar-2010 14:35:52 com.youdevise.hudson.slavestatus.SlaveListener call INFO: Slave-status listener starting 15-Mar-2010 14:35:52 com.youdevise.hudson.slavestatus.SlaveListener$1 run SEVERE: Could not listen on port java.net.BindException: Address already in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at com.youdevise.hudson.slavestatus.SocketHTTPListener.waitForConnection(SlaveListener.java:129) at com.youdevise.hudson.slavestatus.SlaveListener$1.run(SlaveListener.java:63) at com.youdevise.hudson.slavestatus.Daemon.go(Daemon.java:16) at com.youdevise.hudson.slavestatus.SlaveListener.call(SlaveListener.java:83) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:58) at java.lang.Thread.run(Unknown Source) 17-Mar-2010 16:14:42 hudson.remoting.jnlp.Main$CuiListener <init> INFO: Hudson agent is running in headless mode. {noformat} Then when connecting... {noformat} 17-Mar-2010 16:14:42 hudson.remoting.jnlp.Main$CuiListener status INFO: Handshaking 17-Mar-2010 16:14:42 hudson.remoting.jnlp.Main$CuiListener error SEVERE: The server rejected the connection: hb-slave-trunk1 is already connected to this master. Rejecting this connection. java.lang.Exception: The server rejected the connection: hb-slave-trunk1 is already connected to this master. Rejecting this connection. at hudson.remoting.Engine.run(Engine.java:191) {noformat}
    via by roxspring,
  • pgServer Shutdown?
    via by Chris Tusa,
  • CnxManagerTest.testWorkerThreads See attachment, this is the first time I've seen this test fail, and it's failed 2 out of the last three test runs. Notice (attachment) once this happens the port never becomes available. {noformat} 2011-03-02 15:53:12,425 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11245:NIOServerCnxn$Factory@251] - Accepted socket connection from /172.29.6.162:51441 2011-03-02 15:53:12,430 - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11245:NIOServerCnxn@639] - Exception causing close of session 0x0 due to java.io.IOException: ZooKeeperServer not running 2011-03-02 15:53:12,430 - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11245:NIOServerCnxn@1435] - Closed socket connection for client /172.29.6.162:51441 (no session established for client) 2011-03-02 15:53:12,430 - WARN [QuorumPeer:/0:0:0:0:0:0:0:0:11241:Follower@82] - Exception when following the leader java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:375) at org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:63) at org.apache.zookeeper.server.quorum.QuorumPacket.deserialize(QuorumPacket.java:84) at org.apache.jute.BinaryInputArchive.readRecord(BinaryInputArchive.java:108) at org.apache.zookeeper.server.quorum.Learner.readPacket(Learner.java:148) at org.apache.zookeeper.server.quorum.Learner.registerWithLeader(Learner.java:267) at org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:66) at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:645) 2011-03-02 15:53:12,431 - INFO [QuorumPeer:/0:0:0:0:0:0:0:0:11241:Follower@165] - shutdown called java.lang.Exception: shutdown Follower at org.apache.zookeeper.server.quorum.Follower.shutdown(Follower.java:165) at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:649) 2011-03-02 15:53:12,432 - INFO [QuorumPeer:/0:0:0:0:0:0:0:0:11241:QuorumPeer@621] - LOOKING 2011-03-02 15:53:12,432 - INFO [QuorumPeer:/0:0:0:0:0:0:0:0:11241:FastLeaderElection@663] - New election. My id = 0, Proposed zxid = 0 2011-03-02 15:53:12,433 - INFO [WorkerReceiver Thread:FastLeaderElection@496] - Notification: 0 (n.leader), 0 (n.zxid), 2 (n.round), LOOKING (n.state), 0 (n.sid), LOOKING (my state) 2011-03-02 15:53:12,433 - INFO [WorkerReceiver Thread:FastLeaderElection@496] - Notification: 0 (n.leader), 0 (n.zxid), 2 (n.round), LOOKING (n.state), 0 (n.sid), LOOKING (my state) 2011-03-02 15:53:12,433 - INFO [WorkerReceiver Thread:FastLeaderElection@496] - Notification: 0 (n.leader), 0 (n.zxid), 2 (n.round), LOOKING (n.state), 0 (n.sid), LOOKING (my state) 2011-03-02 15:53:12,633 - INFO [WorkerReceiver Thread:FastLeaderElection@496] - Notification: 0 (n.leader), 0 (n.zxid), 2 (n.round), LOOKING (n.state), 0 (n.sid), LOOKING (my state) 2011-03-02 15:53:12,633 - INFO [QuorumPeer:/0:0:0:0:0:0:0:0:11245:QuorumPeer@655] - LEADING 2011-03-02 15:53:12,636 - INFO [QuorumPeer:/0:0:0:0:0:0:0:0:11245:Leader@54] - TCP NoDelay set to: true 2011-03-02 15:53:12,638 - INFO [QuorumPeer:/0:0:0:0:0:0:0:0:11245:ZooKeeperServer@151] - Created server with tickTime 1000 minSessionTimeout 2000 maxSessionTimeout 20000 datadir /var/lib/hudson/workspace/CDH3-ZooKeeper-3.3.3_sles/build/test/tmp/test9001250572426375869.junit.dir/version-2 snapdir /var/lib/hudson/workspace/CDH3-ZooKeeper-3.3.3_sles/build/test/tmp/test9001250572426375869.junit.dir/version-2 2011-03-02 15:53:12,639 - ERROR [QuorumPeer:/0:0:0:0:0:0:0:0:11245:Leader@133] - Couldn't bind to port 11245 java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.<init>(ServerSocket.java:185) at java.net.ServerSocket.<init>(ServerSocket.java:97) at org.apache.zookeeper.server.quorum.Leader.<init>(Leader.java:131) at org.apache.zookeeper.server.quorum.QuorumPeer.makeLeader(QuorumPeer.java:512) at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:657) {noformat}
    via by Patrick Hunt,
    • java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.<init>(ServerSocket.java:185) at java.net.ServerSocket.<init>(ServerSocket.java:97) at com.youdevise.hudson.slavestatus.SocketHTTPListener.waitForConnection(SlaveListener.java:129) at com.youdevise.hudson.slavestatus.SlaveListener$1.run(SlaveListener.java:63) at com.youdevise.hudson.slavestatus.Daemon.go(Daemon.java:16) at com.youdevise.hudson.slavestatus.SlaveListener.call(SlaveListener.java:83) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

    Users with the same issue

    linxiaolong
    1 times, last one,
    jedcua
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    39 more bugmates