Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rmkanda opened this issue Nov 19, 2024 · 4 comments

Comments

@rmkanda
Copy link

rmkanda commented Nov 19, 2024

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
Copy link
Contributor

I confirm I can reproduce when testing this PR: #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
Copy link
Contributor

Possible duplicate of #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
Copy link
Author

rmkanda commented Nov 19, 2024

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

@JReyesPetroil
Copy link

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/',)
])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants