jenkinsci / file-operations-plugin

File Operations as Build Step in Jenkins
https://plugins.jenkins.io/file-operations
33 stars 31 forks source link

File Download fails - FATAL: Cannot invoke "String.startsWith(String)" because "rel" is null #143

Open rmkanda opened 9 hours ago

rmkanda commented 9 hours ago

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

jonesbusy commented 9 hours ago

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)
jonesbusy commented 9 hours ago

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

Image Image

rmkanda commented 8 hours ago

Thanks @jonesbusy for looking into the issue. I looked into the code as well, it seems something outside of the plugin code.