Closed IlyaKiselevKolibri closed 3 years ago
could you add a sample pipeline?
Sure! Please find below:
pipeline {
agent {
label "label"
}
stages {
stage('Upload') {
steps {
script {
sh("mkdir -p ./folder1 && mkdir -p folder2")
sh("touch ./folder1/file && touch ./folder2/file")
azureUpload storageCredentialId: StorageAccount1Credentials,
storageType: "blobstorage",
containerName: "containername",
filesPath: "folder1/*",
virtualPath: ""
azureUpload storageCredentialId: StorageAccount2Credentials,
storageType: "blobstorage",
containerName: "containername",
filesPath: "folder2/*",
virtualPath: ""
}
}
}
}
}
thanks I'll try check this out tomorrow
I think there might be something missing from the test pipeline?
It passes, am I missing something?
So the problem is not with the uploading part, but when you try to download the artifacts from https://
what do you do to get that Action? I don't seem to have it
Nothing specific to be honest, I just reproduced the error quickly by running docker run --rm -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
, installing Azure Storage plugin, adding 2 azure storage credentials via Jenkins Global settings, then added the above pipeline and I can see this action in build results. The URL in this case is http://localhost:8080/job/jenkins_docker_azure_download_test/5/Azure/
Here is a plugin version that I used in the above example, if it helps:
Also here are the direct download links from the above example:
Thanks, reproduced.
I also hit another issue when running it on an agent, do you not hit this? (I've fixed the agent issue locally fairly trivial).
ERROR: AzureStorage - Error occurred while uploading to Azure - timtestvmagentsssd
com.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException: Fail to upload individual files to blob
at com.microsoftopentechnologies.windowsazurestorage.service.UploadToBlobService.uploadIndividuals(UploadToBlobService.java:151)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService.execute(UploadService.java:720)
at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:438)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.microsoftopentechnologies.windowsazurestorage.service.UploadService
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadOnSlave.invoke(UploadService.java:373)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadOnSlave.invoke(UploadService.java:346)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3317)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:119)
... 1 more
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to agent
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.FilePath.act(FilePath.java:1159)
at hudson.FilePath.act(FilePath.java:1148)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadToBlobService.uploadIndividuals(UploadToBlobService.java:142)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService.execute(UploadService.java:720)
at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:438)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.microsoftopentechnologies.windowsazurestorage.service.UploadService
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadOnSlave.invoke(UploadService.java:370)
... 11 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.microsoftopentechnologies.windowsazurestorage.service.UploadService
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadThread.execute(UploadService.java:597)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadThread.call(UploadService.java:515)
at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$UploadThread.call(UploadService.java:423)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
@IlyaKiselevKolibri this PR fixes it: https://github.com/jenkinsci/azure-storage-plugin/pull/185
reading the code I think the same file name different contents across accounts may not work, so I'll test that and either adjust or ship depending on result. Out of time on this for now will get back to it later
Wow, that was super fast, thanks a lot!
Regarding the above exception - I didn't hit anything similar yet.
Version report
Jenkins and plugins versions report:
Reproduction steps
Results
Expected result:
All the artifacts can be downloaded.
Actual result:
The only available artifacts are from the first storage account (it looks like the same signature is being used for both storage accounts). When you try to download the artifacts from the second storage account, there is an error:
Please find the screenshots attached: