title: Failed to create the file while downloading zip file with CURL on Jenkins slave
body: <p>I am using Jenkins Pipline and Groovy script to download a zip on slave machine of jenkins.</p>
  <p>Following is my code:</p>
  <pre><code>pipeline {
  
      agent { label '&lt;my slave label&gt;' }
      stage('Download') {
              steps {
                  script {                
                      def url = &quot;&lt;server url&gt;&quot;
                      def processDownload = ['bash', '-c', &quot;curl -g -k --noproxy \&quot;*\&quot; -o &lt;output-dir&gt; \&quot;${url}\&quot;&quot;].execute()
                      processDownload.waitFor()
                      def processUnzip = ['bash', '-c', &quot;7z e lwbs.zip&quot;].execute()
                      processUnzip.waitFor()     
                  }      
              }
      }
  }
  </code></pre>
  <p><strong>I am getting following error:</strong></p>
  <blockquote>
  <p>Warning: Failed to create the file  Warning:</p>
  <p>output-dir/newFile.zip: No such file or directory</p>
  </blockquote>
  <p><strong>I have checked following:</strong></p>
  <ol>
  <li>When I use the same <code>curl</code> command using command prompt, it run's successfully.</li>
  <li>I have also ensured that proper user permissions are granted to
  allow jenkins to write to this directory.</li>
  <li><strong>The directory exists</strong> and there are no spaces in the directory url</li>
  <li>There is enough disk space available on slave</li>
  <li>Server URL and certificates are correct</li>
  <li>Many SO but none mentions issue on <code>jenkins slave</code></li>
  </ol>
  <p>Is there anything I am missing?</p>
  <p>Any help is appreciated. Thank you.</p>