file-operations-plugin
file-operations-plugin copied to clipboard
File Download fails - FATAL: Cannot invoke "String.startsWith(String)" because "rel" is null
Jenkins and plugins versions report
Jenkins: 2.479.1
OS: Linux - 6.1.112-124.190.amzn2023.x86_64
Java: 17.0.13 - Amazon.com Inc. (OpenJDK 64-Bit Server VM)
---
file-operations:321.vd98ef0161b_7e
What Operating System are you using (both controller, and any agents involved in the problem)?
Linux
Reproduction steps
stage('Download') {
steps {
script {
sh "mkdir downloads"
fileOperations([
fileDownloadOperation(url: 'https://...', targetLocation: 'downloads/')
])
}
}
}
Expected Results
File should be downloaded
Actual Results
[Pipeline] sh 17:38:01 + mkdir downloads [Pipeline] fileOperations 17:38:01 File Download Operation: 17:38:01 FATAL: Cannot invoke "String.startsWith(String)" because "rel" is null 17:38:01 FATAL: Cannot invoke "String.startsWith(String)" because "rel" is null [Pipeline] } [Pipeline] // script [Pipeline] }
Anything else?
No response
Are you interested in contributing a fix?
Yes
I confirm I can reproduce when testing this PR: https://github.com/jenkinsci/file-operations-plugin/pull/144
Not sure if it's a regression because of 2.479 or if it's something that never worked
The stacktrace is
hudson.remoting.ProxyException: hudson.AbortException: File Operations failed.
at PluginClassLoader for file-operations//sp.sd.fileoperations.FileOperationsBuilder.perform(FileOperationsBuilder.java:52)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at PluginClassLoader for workflow-basic-steps//org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101)
at PluginClassLoader for workflow-basic-steps//org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)
at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Possible duplicate of https://github.com/jenkinsci/file-operations-plugin/issues/129
Not sure if the origin if file-operations-plugin or a workflow plugin issue. There is NO startsWith in this plugin
This work weel with freestyle. So it must be a regression or downstream breaking change somewhere else
Thanks @jonesbusy for looking into the issue. I looked into the code as well, it seems something outside of the plugin code.
Use the help form. You must enter all the parameters to perform the action you need.
sh 'mkdir -p downloads' fileOperations([ fileDownloadOperation(userName: '', password: '', proxyHost: '', proxyPort: '', targetFileName: 'wiremock.jar', url: 'https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/3.10.0/wiremock-standalone-3.10.0.jar', targetLocation: 'downloads/',) ])