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

Not uploading files to Azure #206

Closed
italoveloso89 opened this issue Dec 3, 2021 · 8 comments
Closed

Not uploading files to Azure #206

italoveloso89 opened this issue Dec 3, 2021 · 8 comments

Comments

@italoveloso89
Copy link

italoveloso89 commented Dec 3, 2021

Plugins:
Azure AD Plugin - 185.v3b416408dcb1
Azure Artifact Manager plugin - 97.v074e1332e88d
Azure CLI Plugin - 0.9
Azure Credentials - 198.vf9c2fdfde55c
Azure SDK API Plugin - 70.v63f6a95999a7
Azure Storage plugin - 365.vf41653c43b01
Azure VM Agents - 799.va4c741108611

Jenkins version: 2.303.3

Hi guys,
I'm trying to upload my build files to Azure. But I can't upload, it appears this error(below):
I have already included my credentials(Azure account storage):
image

Also, I configured credentials (Azure Service Principal)

java.lang.ClassCastException: class com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.setBlobProperties() expects class com.microsoftopentechnologies.windowsazurestorage.AzureBlobProperties but received class java.util.ArrayList
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:492)
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.injectSetters(DescribableModel.java:429)
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:331)
09:41:47  Caused: java.lang.IllegalArgumentException: Could not instantiate {blobProperties=[], containerName=sampleproject, filesPath=**/*.zip, storageCredentialId=TestUploadArtifactsAzure, storageType=blobstorage} for com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)
09:41:47  	at org.jenkinsci.plugins.structs.describable.UninstantiatedDescribable.instantiate(UninstantiatedDescribable.java:208)
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:466)
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:409)
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:329)
09:41:47  Caused: java.lang.IllegalArgumentException: Could not instantiate {delegate=@azureUpload(blobProperties=[],containerName=sampleproject,filesPath=**/*.zip,storageCredentialId=TestUploadArtifactsAzure,storageType=blobstorage)} for org.jenkinsci.plugins.workflow.steps.CoreStep
09:41:47  	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:302)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:498)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
09:41:47  	at jdk.internal.reflect.GeneratedMethodAccessor1932.invoke(Unknown Source)
09:41:47  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:47  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
09:41:47  	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
09:41:47  	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
09:41:47  	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
09:41:47  	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
09:41:47  	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
09:41:47  	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
09:41:47  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
09:41:47  	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
09:41:47  	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
09:41:47  	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
09:41:47  Caused: java.lang.IllegalArgumentException: Failed to prepare azureUpload step
09:41:47  	at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:500)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
09:41:47  	at jdk.internal.reflect.GeneratedMethodAccessor1932.invoke(Unknown Source)
09:41:47  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:47  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
09:41:47  	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
09:41:47  	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
09:41:47  	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
09:41:47  	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
09:41:47  	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
09:41:47  	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
09:41:47  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
09:41:47  	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
09:41:47  	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
09:41:47  	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
09:41:47  	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
09:41:47  	at hudson.scm.WorkflowScript.run(WorkflowScript:384)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:666)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:395)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:393)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:665)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:288)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:544)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:543)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:276)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:443)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:442)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:275)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:481)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock(ModelInterpreter.groovy:480)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:274)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:586)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:585)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:272)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(ModelInterpreter.groovy:356)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput(ModelInterpreter.groovy:355)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:261)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:618)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:617)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:259)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:443)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:442)
09:41:47  	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:254)
09:41:47  	at ___cps.transform___(Native Method)
09:41:47  	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
09:41:47  	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
09:41:47  	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
09:41:47  	at jdk.internal.reflect.GeneratedMethodAccessor309.invoke(Unknown Source)
09:41:47  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:47  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
09:41:47  	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
09:41:47  	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
09:41:47  	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
09:41:47  	at jdk.internal.reflect.GeneratedMethodAccessor293.invoke(Unknown Source)
09:41:47  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:47  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
09:41:47  	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
09:41:47  	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
09:41:47  	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
09:41:47  	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
09:41:47  	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
09:41:47  	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
09:41:47  	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
09:41:47  	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:402)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:314)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:278)
09:41:47  	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
09:41:47  	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
09:41:47  	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
09:41:47  	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
09:41:47  	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
09:41:47  	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
09:41:47  	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
09:41:47  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
09:41:47  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
09:41:47  	at java.base/java.lang.Thread.run(Thread.java:834)
09:41:47  Finished: FAILURE

This is a part of code in groovy script (upload files), I want to upload all files that have .zip from the build to Azure:

stage('Upload Files')
        {
            when
            {
                expression { UploadToAZ == true }
            }
            steps
            {
                azureUpload blobProperties: [], containerName: 'sampleproject', filesPath: '**/*.zip', storageCredentialId: 'TestUploadArtifactsAzure', storageType: 'blobstorage'
            }
            post
            {
                success
                {
                    bat """IF EXIST \"%ProjectName%/Deploy\" rmdir /S /Q \"%ProjectName%/Deploy\""""
                }
                // TODO: maybe a slack notification or an email?
                /*
                failure
                {

                }*/
            }
        } 
@timja
Copy link
Member

timja commented Dec 3, 2021

Could you fill out the issue template which includes Jenkins versions and all plugins versions please?

@italoveloso89
Copy link
Author

Oh, I'm sorry.

Plugins:
Azure AD Plugin - 185.v3b416408dcb1
Azure Artifact Manager plugin - 97.v074e1332e88d
Azure CLI Plugin - 0.9
Azure Credentials - 198.vf9c2fdfde55c
Azure SDK API Plugin - 70.v63f6a95999a7
Azure Storage plugin - 365.vf41653c43b01
Azure VM Agents - 799.va4c741108611

Jenkins version: 2.303.3

@mikespartan
Copy link

mikespartan commented Jan 28, 2022

Hey @italoveloso89! I've faced the same issue! How did you resolve it?

@italoveloso89
Copy link
Author

@mikespartan, I didn't :/
I opened a new one: #209

@mikespartan
Copy link

Ok i see, but in #209 there is another trace error, I see there
Caused by: java.nio.file.AccessDeniedException: F:\P4\SampleAutomation\DeEscalationXR\Deploy\Android-Development-29967.zip

But here I have absolutely the same error as you:
java.lang.ClassCastException: class com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.setBlobProperties() expects class com.microsoftopentechnologies.windowsazurestorage.AzureBlobProperties but received class java.util.ArrayList

How you have moved forward from this particular error to #209 ?

@italoveloso89
Copy link
Author

In my syntax(Blob Properties and Meta), I forgot to include a property, in my case I included Content language( [contentLanguage: 'en-US'])

@mikespartan
Copy link

Hey @italoveloso89! You're the man! That's solved my problem! Thanks a lot! Wondering that I haven't seen anything about this property, but it matters, even in pipeline syntax there's no any help button for the "blob properties and metadata" chapter.

@timja
Copy link
Member

timja commented Jan 31, 2022

Hey @italoveloso89! You're the man! That's solved my problem! Thanks a lot! Wondering that I haven't seen anything about this property, but it matters, even in pipeline syntax there's no any help button for the "blob properties and metadata" chapter.

could you raise a documentation issue for that please. https://github.com/jenkinsci/azure-storage-plugin/issues/new?assignees=&labels=documentation&template=3-documentation.yml

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

No branches or pull requests

3 participants