[HAP-946] artifactory server object seems to ignore the bypassProxy setting by downloading in a pipeline Created: 10/Jul/17  Updated: 14/Nov/17  Resolved: 27/Sep/17

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: 2.12.0
Fix Version/s: 2.13.0

Type: Bug Priority: Normal
Reporter: Alexej Pissarev Assignee: Eyal Ben Moshe
Resolution: Fixed Votes: 1
Labels: None
Environment:

Artifactory 5.3.0 on the artifactory Server
Jenkins core Version 2.67
Pipeline Jenkins plugin Version 2.5


Issue Links:
Duplicate
duplicates HAP-961 Bypass proxy is not honored when runn... Resolved

 Description   

Download artifacts with an artifactory server object in a Jenkins Pipeline doesn't work in the Version 2.12.0 anymore.

Here is the error message:
...
[Pipeline] artifactoryDownload
Error occurred for request CONNECT <artifactory Server dns alias>:443 HTTP/1.1. Received status code 503 and message: Service Unavailable.
Attempting retry #1
Received status code 503 and message: Service Unavailable.
...

Both the Jenkins Server and the artifactory Server are in an Intranet that is why the Proxy Server is deactivated here.
We download artifacts in a Pipeline Jenkins Job with an artifactory Server object created in a groovy script:
...
def artifactoryRootURL = "https://<artifactory server>:443/artifactory/"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: <user id>, passwordVariable: 'artifactoryUserPassword', usernameVariable: 'artifactoryUserName']])

{ artifactoryServer = Artifactory.newServer url: artifactoryRootURL, username: artifactoryUserName, password: artifactoryUserPassword }

artifactoryServer.setBypassProxy(true)
def downloadSpec = """{
"files": [

{ "pattern": "<repository>/<artifact id>/<version>/*.zip", "target": "<workspace folder>/<download folder>/" }

]
}"""
def buildInfo = artifactoryServer.download(downloadSpec)
...

After downgrading to the plugin version 2.11. it works again.

Some additional Information:

  • same error message after Setting bypassProxy to false (setBypassProxy(false))
  • no problems by uploading of artifacts with similar code (setBypassProxy(true) too)
  • similar error message by uploading of artifacts after setting bypassProxy to false
  • the flag "Bypass HTTP Proxy" in the global artifactory plugin configuration seems to work: "Test Connection" shows "Found Artifactory 5.3.0" if it is set and "Error occurred while requesting version information: Service Unavailable" if not


 Comments   
Comment by Alexej Pissarev [ 15/Aug/17 ]

any plans to fix this issue? Currently we cannot upgrade this plugin in our jenkins instances and are pinned down to the version 2.11., because both the jenkins servers and the artifactory server are in the company intranet and the communication via proxy server doesn't work. Thanks in advance for any information!

Comment by Eyal Ben Moshe [ 15/Aug/17 ]

Hi Alexej Pissarev,
We actually published a snapshot version with a fix for this issue.
We'd appreciate your feedback for it. See the details in the following Jira ticket:
https://www.jfrog.com/jira/browse/HAP-961

Comment by Alexej Pissarev [ 17/Aug/17 ]

Hi @Eyal Ben Moshe,
the snapshot version (downloaded from https://oss.jfrog.org/artifactory/oss-snapshot-local/org/jenkins-ci/plugins/artifactory/2.12.3-SNAPSHOT/artifactory-2.12.3-20170809.123654-2.hpi) brings the same error message: "Error occurred for request CONNECT <artifactory server alias>:443 HTTP/1.1. Received status code 503 and message: Service Unavailable"
The job works again after downgrading to the version 2.11.

Comment by Dima Nevelev (Inactive) [ 22/Aug/17 ]

Hi Alexej Pissarev,
Thank you for reporting this.
We made another fix (the commit can be found here: https://github.com/JFrogDev/jenkins-artifactory-plugin/commit/2b948e03466ea48fee3a7bd04b71d273a3ffa546).
A snapshot version can be downloaded from here: https://oss.jfrog.org/artifactory/oss-snapshot-local/org/jenkins-ci/plugins/artifactory/2.12.3-SNAPSHOT/artifactory-2.12.3-20170822.085407-5.hpi.
Please let us know if this fix the issue.

Comment by Alexej Pissarev [ 22/Aug/17 ]

Hi @DimaN,
thank you for the fix - it seems to fix this problem!
I was able both upload and download artifacts from resp. from the internal artifactory server (as described in this ticket)

Generated at Tue Dec 10 17:31:21 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.