Search code examples
jenkinscurlposttimeoutjenkins-declarative-pipeline

Curl 28 timeout when trying to upload a file to sharepoint through a curl request in a Jenkins Pipeline


Uploading a zip file to sharepoint with a curl request in Jenkins pipeline, timing out with "curl: (28) Connection timed out after 300905 milliseconds"

I have tried reformatting the request and changing syntax in Jenkins but no joy. I have a "curl -X GET request" above the "curl -X POST request" that works fine.

post{
  always {
    junit '**/TestReports/*.xml'
  }
  success {
      script {
        sh "curl -X GET request" //this request works
        sh "curl -X POST 'http://00.0.0.00:0000/sharepoint?relativePath=Shared%20Documents%2FService%20Docs%2Fv9.0&teamSite=Web%20Services' -H 'accept: */*' -H 'Content-Type: multipart/form-data' -F 'file=@Test Tracer Web Services - Interface Specification v9.0.zip;'"
      }
    }
}

The curl request works outside of jenkins but not as part of the script. Any help would be much appreciacted


Solution

  • This issue occurred as Jenkins could not access the IP address I was using for the sharepoint. I used remote desktop and verified it wasn't working. I then changed to an alternative IP address and it works now.