Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8992

Jenkins chooses reserved port for communication with agent

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None

      I use Jenkins 1.397.
      When I start jobs on slaves (jnlp-slaves and windows-service-slaves) sometimes I get following error, so that I have to restart the build multiple times until the exception does not appear.

      [ak4.main.branch-4.3-M1-BSF] $ java -Xmx1024M -Dfile.encoding=Cp850 -cp C:\Jenkins\maven-agent.jar;C:\Jenkins\classworlds.jar hudson.maven.agent.Main "C:\Program Files (x86)\Entwicklung\apache-maven-2.1.0" C:\Users\mkr.ARCHIKART\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\22feb5d4-6a7aca32 C:\Jenkins\maven-interceptor.jar 80 C:\Jenkins\maven2.1-interceptor.jar
      Exception in thread "main" java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(Unknown Source)
      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at hudson.maven.agent.Main.main(Main.java:124)
      at hudson.maven.agent.Main.main(Main.java:62)

      When it succeeds there messages like:

      [ak4.main.branch-4.3-M1-BSF] $ java -Xmx1024M -Dfile.encoding=Cp850 -cp C:\Jenkins\maven-agent.jar;C:\Jenkins\classworlds.jar hudson.maven.agent.Main "C:\Program Files (x86)\Entwicklung\apache-maven-2.1.0" C:\Users\mkr.ARCHIKART\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\22feb5d4-6a7aca32 C:\Jenkins\maven-interceptor.jar 55046 C:\Jenkins\maven2.1-interceptor.jar

      As I understand the logs, the Jenkins slave is instructed to communicate with Jenkins server on Port 80. But on port 80 there is another application running on the maschine, that contains Jenkins server.
      So possible solutions would be to retry with another port, configure a list of ports to be avoided or configure a range of ports to be used.

            Unassigned Unassigned
            namue namue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: