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

[INFO] Deploying artifact not workign with http forwarding proxy

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • artifactory-plugin
    • None

      Hi,

      When I use maven integration with Artifactory, I can use artifactory to download dependencies, but in the final step to deploy the artifactory tool it always hangs. In our infrastructure we use an HTTP forwarding proxy to reach the other end point. This HTTP forwarding proxy works well at other aspects of the Jenkins integration, including the download phase where retrieved from Artifactory to Jenkins. In the Deployment phase, it simply ignores the proxy settings and tries to go directly with the respective timeout.

      FYI. I have the https_proxy configuration at the env variables, and also at the proxies section of the settings.xml

      proxies>
      <proxy>
      <id>myhttpproxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>myhost</host>
      <port>8080</port>
      <nonProxyHosts>localhost</nonProxyHosts>
      </proxy>
      </proxies>

      [INFO] Artifactory Build Info Recorder: Saving Build Info to '/xxxxxxx1/workspace/target/build-info.json'
      [INFO] Deploying artifact: https://xxxxx.xxxx./x.jar
      [ERROR] org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
      java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: xxxxxxx.jar.
      Skipping deployment of remaining artifacts (if any) and build info.
      at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts(BuildDeploymentHelper.java:287)
      at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy(BuildDeploymentHelper.java:108)
      at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded(BuildInfoRecorder.java:174)
      at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:64)
      at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:137)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
      at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
      at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      at hudson.remoting.Request$2.run(Request.java:332)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: org.apache.http.conn.HttpHostConnectException: Connection to https://repository.esi.adp.com refused
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
      at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
      at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
      at org.jfrog.build.client.PreemptiveHttpClient.execute(PreemptiveHttpClient.java:89)
      at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:199)
      at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:195)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:579)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:282)
      at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts(BuildDeploymentHelper.java:285)
      ... 30 more
      Caused by: java.net.ConnectException: Connection timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
      at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
      ... 41 more
      [ERROR] Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: Error occurred while publishing artifact to Artifactory:

          [JENKINS-38703] [INFO] Deploying artifact not workign with http forwarding proxy

          Jordi Redondo added a comment - - edited

          Hi,

          As I did read different literature about the proxy usage and results on settings.xml, I tried to test under the below three scenarios (once at time). One scenario with HTTP, other with HTTP+HTTPS and other with HTTPS only. The target URL I tried to use from Artifactory it is HTTPS.

          proxies>
          <proxy>
          <id>myhttpproxy</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>myhost</host>
          <port>8080</port>
          <nonProxyHosts>localhost</nonProxyHosts>
          </proxy>
          </proxies>

          proxies>
          <proxy>
          <id>myhttpproxy</id>
          <active>true</active>
          <protocol>https</protocol>
          <host>myhost</host>
          <port>8080</port>
          <nonProxyHosts>localhost</nonProxyHosts>
          </proxy>
          </proxies>

          proxies>
          <proxy>
          <id>myhttpproxy</id>
          <active>true</active>
          <protocol>*</protocol>
          <host>myhost</host>
          <port>8080</port>
          <nonProxyHosts>localhost</nonProxyHosts>
          </proxy>
          </proxies>

          One interesting aspect to remark. I tried to inject to artifactory by command line script section at jenkins job, and it works, but if I try from Artifactory plugin, it simply ignores the proxy and tries to artifact directly bypassing the proxy.

          Jordi Redondo added a comment - - edited Hi, As I did read different literature about the proxy usage and results on settings.xml, I tried to test under the below three scenarios (once at time). One scenario with HTTP, other with HTTP+HTTPS and other with HTTPS only. The target URL I tried to use from Artifactory it is HTTPS. proxies> <proxy> <id>myhttpproxy</id> <active>true</active> <protocol>http</protocol> <host>myhost</host> <port>8080</port> <nonProxyHosts>localhost</nonProxyHosts> </proxy> </proxies> proxies> <proxy> <id>myhttpproxy</id> <active>true</active> <protocol>https</protocol> <host>myhost</host> <port>8080</port> <nonProxyHosts>localhost</nonProxyHosts> </proxy> </proxies> proxies> <proxy> <id>myhttpproxy</id> <active>true</active> <protocol>*</protocol> <host>myhost</host> <port>8080</port> <nonProxyHosts>localhost</nonProxyHosts> </proxy> </proxies> One interesting aspect to remark. I tried to inject to artifactory by command line script section at jenkins job, and it works, but if I try from Artifactory plugin, it simply ignores the proxy and tries to artifact directly bypassing the proxy.

          Jordi Redondo added a comment -

          Any other information is needed? sorry

          Jordi Redondo added a comment - Any other information is needed? sorry

          Hello,

          I'm having a very similar issue with proxy. I've tried all possible ways of defining the proxy but Jenkins and/or the Artifactory plugin simply ignores the proxy configuration and throws the following exception.

          Caused by: java.net.UnknownHostException: my_binary_repository_hostname: unknown error
          	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
          	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907)
          	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302)
          	at java.net.InetAddress.getAllByName0(InetAddress.java:1255)
          	at java.net.InetAddress.getAllByName(InetAddress.java:1171)
          	at java.net.InetAddress.getAllByName(InetAddress.java:1105)
          	at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
          	at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278)
          	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
          	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
          	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
          	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
          	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
          	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
          	at org.jfrog.build.client.PreemptiveHttpClient.execute(PreemptiveHttpClient.java:89)
          	at org.jfrog.build.client.ArtifactoryHttpClient.getVersion(ArtifactoryHttpClient.java:136)
          	at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.verifyCompatibleArtifactoryVersion(ArtifactoryBuildInfoClient.java:298)
          

          Kıvanç Sahici added a comment - Hello, I'm having a very similar issue with proxy. I've tried all possible ways of defining the proxy but Jenkins and/or the Artifactory plugin simply ignores the proxy configuration and throws the following exception. Caused by: java.net.UnknownHostException: my_binary_repository_hostname: unknown error at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302) at java.net.InetAddress.getAllByName0(InetAddress.java:1255) at java.net.InetAddress.getAllByName(InetAddress.java:1171) at java.net.InetAddress.getAllByName(InetAddress.java:1105) at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) at org.jfrog.build.client.PreemptiveHttpClient.execute(PreemptiveHttpClient.java:89) at org.jfrog.build.client.ArtifactoryHttpClient.getVersion(ArtifactoryHttpClient.java:136) at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.verifyCompatibleArtifactoryVersion(ArtifactoryBuildInfoClient.java:298)

          Jordi Redondo added a comment -

          I contacted directly by email to Mr Eyal Ben Moshe (person assigned to the ticket) and his suggestion was to contact directly to jfrog support. That explains the lack of response at this ticket we both have problems. I followed the instructions provided by Mr Eyal Ben Moshe and emailed to support@jfrog.com

          It is a good idea if you email to support@jfrog.com reporting your problem too. If we are more people reporting the same issue, I think it will be in benefits of considering our problem as a real problem.

          Jordi Redondo added a comment - I contacted directly by email to Mr Eyal Ben Moshe (person assigned to the ticket) and his suggestion was to contact directly to jfrog support. That explains the lack of response at this ticket we both have problems. I followed the instructions provided by Mr Eyal Ben Moshe and emailed to support@jfrog.com It is a good idea if you email to support@jfrog.com reporting your problem too. If we are more people reporting the same issue, I think it will be in benefits of considering our problem as a real problem.

          Honestly, we had already reported this to Jfrog, too.

          Kıvanç Sahici added a comment - Honestly, we had already reported this to Jfrog, too.

          Jordi Redondo added a comment -

          In my internal message exchange with Support form Jfrog I also remarked this is not only to me but other people having the same. I referred to this Jira ticket

          Jordi Redondo added a comment - In my internal message exchange with Support form Jfrog I also remarked this is not only to me but other people having the same. I referred to this Jira ticket

          Kıvanç Sahici added a comment - - edited

          Kıvanç Sahici added a comment - - edited I have some good news. Please see https://www.jfrog.com/jira/browse/HAP-836 https://github.com/JFrogDev/jenkins-artifactory-plugin/commit/d4742123b9063d1b1885ffa5628424db551c7169

          Jenkins Artifactory plugin 2.8.1 has been released and the problem has been solved for me

          Kıvanç Sahici added a comment - Jenkins Artifactory plugin 2.8.1 has been released and the problem has been solved for me

          After upgrading to version 2.8.1 of the Artifactory Plugin, in case there are Artifactory servers that should not be accessed by Jenkins through the proxy, you can check the "Bypass proxy" option for those Artifactory servers in Jenkins Manage.

          Eyal Ben Moshe added a comment - After upgrading to version 2.8.1 of the Artifactory Plugin, in case there are Artifactory servers that should not be accessed by Jenkins through the proxy, you can check the "Bypass proxy" option for those Artifactory servers in Jenkins Manage.

          I had the same problem with the Artifactory Plugin 2.10.3 on Jenkins 2.46.1.

          For example when I click on the "Test Connection" button, in the "Configure System" page, there was an error message "Error occurred while requesting version information: Forbidden". Even if the checkbox "Bypass HTTP Proxy" is selected, Jenkins tries to connect with the proxy.

          Finally I've downgraded to Artifactory Plugin 2.7.2 and the connection is fine now.

          jean-baptiste renaux added a comment - I had the same problem with the Artifactory Plugin 2.10.3 on Jenkins 2.46.1. For example when I click on the "Test Connection" button, in the "Configure System" page, there was an error message "Error occurred while requesting version information: Forbidden". Even if the checkbox "Bypass HTTP Proxy" is selected, Jenkins tries to connect with the proxy. Finally I've downgraded to Artifactory Plugin 2.7.2 and the connection is fine now.

            eyalbe Eyal Ben Moshe
            redcorjo Jordi Redondo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: