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

Running maven job through socks proxy results in a Malformed reply from SOCKS server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None

      Set up a socks proxy using ssh from the jenkins server to another server you wish to use the internet connection of.

      ssh -v -D 8080 ipproxy@other.server

      Set the following in your maven_opts on the jenkins job.
      -DsocksProxyHost=127.0.0.1 -DsocksProxyPort=8080

      Job Fails with the following exception.

      Exception in thread "main" java.net.SocketException: Malformed reply from SOCKS server
      at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:129)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:502)
      at java.net.Socket.connect(Socket.java:579)
      at java.net.Socket.connect(Socket.java:528)
      at java.net.Socket.<init>(Socket.java:425)
      at java.net.Socket.<init>(Socket.java:208)
      at org.jvnet.hudson.maven3.agent.Maven3Main.main(Maven3Main.java:130)
      at org.jvnet.hudson.maven3.agent.Maven3Main.main(Maven3Main.java:65)
      ERROR: Failed to launch Maven. Exit code = 1
      Finished: FAILURE

      exurpt of code in org.jvnet.hudson.maven3.agent.Maven3Main

      String mavenRemoteUseInetEnvVar = System.getenv( "MAVEN_REMOTE_USEINET" );

      boolean mavenRemoteUseInet = Boolean.parseBoolean( mavenRemoteUseInetEnvVar );

      if(mavenRemoteUseInet)

      { InetAddress host = InetAddress.getLocalHost(); String hostname = host.getHostName(); System.out.println( "use inet address " + hostname ); s = new Socket(hostname,tcpPort); }

      else
      s = new Socket((String)null,tcpPort);

            Unassigned Unassigned
            fergus_nelson Fergus Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: