jenkinsci/azure-storage-plugin

Post-build action "Upload artifacts to Azure Storage" fails after updating from to 355.v4da08e72a251

silverl opened this issue · 4 comments

Version report

Jenkins and plugins versions report:

Jenkins: 2.277.4
OS: Windows 10 - 10.0
---
ace-editor:1.1
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactdeployer:1.2
audit-trail:3.8
authentication-tokens:1.4
azure-ad:157.v2d3d5782a602
azure-commons:1.1.3
azure-credentials:182.v3ccd4a755864
azure-keyvault:122.v72c88cfc0c2b
azure-sdk:7.va79ea0a60157
block-queued-job:0.2.0
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.24.6
blueocean-commons:1.24.6
blueocean-config:1.24.6
blueocean-core-js:1.24.6
blueocean-dashboard:1.24.6
blueocean-display-url:2.4.1
blueocean-events:1.24.6
blueocean-executor-info:1.24.6
blueocean-git-pipeline:1.24.6
blueocean-github-pipeline:1.24.6
blueocean-i18n:1.24.6
blueocean-jira:1.24.6
blueocean-jwt:1.24.6
blueocean-personalization:1.24.6
blueocean-pipeline-api-impl:1.24.6
blueocean-pipeline-editor:1.24.6
blueocean-pipeline-scm-api:1.24.6
blueocean-rest-impl:1.24.6
blueocean-rest:1.24.6
blueocean-web:1.24.6
blueocean:1.24.6
bootstrap4-api:4.6.0-3
bouncycastle-api:2.20
branch-api:2.6.4
build-name-setter:2.2.0
build-timeout:1.20
caffeine-api:2.9.1-23.v51c4e2c879c8
checks-api:1.7.0
cloudbees-bitbucket-branch-source:2.9.8
cloudbees-folder:6.15
cobertura:1.16
code-coverage-api:1.3.2
command-launcher:1.6
conditional-buildstep:1.4.1
config-file-provider:3.8.0
configuration-as-code:1.51
convert-to-pipeline:1.0
copyartifact:1.46
credentials-binding:1.24
credentials:2.3.19
cvs:2.18
display-url-api:2.3.4
docker-commons:1.17
docker-java-api:3.1.5.2
docker-plugin:1.2.2
docker-workflow:1.26
dtkit-api:3.0.0
durable-task:1.36
echarts-api:5.1.0-2
email-ext:2.82
envinject-api:1.7
envinject:2.4.0
external-monitor-job:1.7
favorite:2.3.3
file-operations:1.11
font-awesome-api:5.15.3-2
generic-webhook-trigger:1.72
ghprb:1.42.2
git-client:3.7.1
git-parameter:0.9.13
git-server:1.9
git:4.7.1
github-api:1.123
github-autostatus:3.6.2
github-branch-source:2.10.4
github-pullrequest:0.3.0
github:1.33.1
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
http_request:1.9.0
icon-shim:3.0.0
jackson2-api:2.12.3
jacoco:3.1.1
javadoc:1.6
jdk-tool:1.5
jenkins-design-language:1.24.6
jira:3.2.1
jjwt-api:0.11.2-9.c8b45b8bb173
jobConfigHistory:2.27
jquery-detached:1.2.1
jquery:1.12.4-1
jquery3-api:3.6.0-1
jsch:0.1.55.2
junit:1.49
ldap:2.6
lockable-resources:2.10
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.6
matrix-project:1.18
maven-plugin:3.10
mercurial:2.15
metrics:4.0.2.7
momentjs:1.1.1
msbuild:1.30
nant:1.4.3
nodejs:1.4.0
nuget:1.0
nunit:0.27
okhttp-api:3.14.9
pam-auth:1.6
parameterized-trigger:2.40
pipeline-build-step:2.13
pipeline-github-lib:1.0
pipeline-github:2.7
pipeline-graph-analysis:1.10
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.8.4
pipeline-model-definition:1.8.4
pipeline-model-extensions:1.8.4
pipeline-npm:0.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.8.4
pipeline-stage-view:2.19
pipeline-utility-steps:2.7.1
plain-credentials:1.7
plugin-util-api:2.2.0
popper-api:1.16.1-2
powershell:1.5
promoted-builds:3.9.1
publish-over:0.22
pubsub-light:1.14
purge-build-queue-plugin:1.0
rake:1.8.0
ranorex-integration:1.0.2
rebuild:1.32
resource-disposer:0.15
run-condition:1.5
scm-api:2.6.4
script-security:1.76
slack:2.47
snakeyaml-api:1.27.0
sse-gateway:1.24
ssh-credentials:1.18.1
ssh-slaves:1.31.5
structs:1.23
throttle-concurrents:2.2
timestamper:1.13
tmpcleaner:1.3
token-macro:2.15
trilead-api:1.0.13
variant:1.4
windows-azure-storage:351.v1aa8afb7af77
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:2.42
workflow-basic-steps:2.23
workflow-cps-global-lib:2.19
workflow-cps:2.90
workflow-durable-task-step:2.38
workflow-job:2.40
workflow-multibranch:2.23
workflow-scm-step:2.12
workflow-step-api:2.23
workflow-support:3.8
ws-cleanup:0.39
xunit:3.0.2
  • What Operating System are you using (both controller, and any agents involved in the problem)?
Windows 10 Professional

Reproduction steps

Create an Azure Storage File Share account (note: this is NOT blob storage, it's a File Share).

Add credentials to Jenkins.

Configure a post-build action to upload a build product from the workspace like so:

2021-05-12 14_55_20-Clipboard

In our case, the largest file we were attempting to upload was 109 MB. There were 9 distinct files being uploaded.

Results

Expected result:

Files uploaded to Azure Storage file share.

Actual result:

The following exception was thrown. (Note, the exception says "downloading" but we were uploading)

Build "15.0.326.10" ready to deploy to a target.
ERROR: AzureStorage - Error occurred while downloading from Azure - buildserviceapi:Failed uploading file
com.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException: Failed uploading file
	at com.microsoftopentechnologies.windowsazurestorage.service.UploadService.uploadCloudFile(UploadService.java:571)
	at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$FileUploadThread.run(UploadService.java:119)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: com.azure.storage.file.share.models.ShareStorageException: Status code 413, "?<?xml version="1.0" encoding="utf-8"?><Error><Code>RequestBodyTooLarge</Code><Message>The request body is too large and exceeds the maximum permissible limit.
RequestId:0ebdcc36-801a-00e5-074d-479aa7000000
Time:2021-05-12T16:39:23.6599746Z</Message><MaxLimit>4194304</MaxLimit></Error>"
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.azure.core.http.rest.RestProxy.instantiateUnexpectedException(RestProxy.java:337)
	at com.azure.core.http.rest.RestProxy.lambda$ensureExpectedStatus$5(RestProxy.java:376)
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125)
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)
	at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached(MonoCacheTime.java:328)
	at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext(MonoCacheTime.java:345)
	at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2397)
	at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onSubscribe(MonoCacheTime.java:284)
	at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:191)
	at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53)
	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)
	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
	at reactor.core.publisher.MonoCacheTime.subscribeOrReturn(MonoCacheTime.java:134)
	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
	at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:130)
	at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:118)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:220)
	at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:130)
	at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:184)
	at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)
	at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:128)
	at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:259)
	at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
	at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:389)
	at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:396)
	at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:452)
	at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:684)
	at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:94)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1534)
	at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1295)
	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1332)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:508)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:447)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more
	Suppressed: java.lang.Exception: #block terminated with an error
		at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
		at reactor.core.publisher.Mono.block(Mono.java:1703)
		at com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout(StorageImplUtils.java:128)
		at com.azure.storage.file.share.ShareFileClient.uploadWithResponse(ShareFileClient.java:973)
		at com.azure.storage.file.share.ShareFileClient.uploadWithResponse(ShareFileClient.java:942)
		at com.microsoftopentechnologies.windowsazurestorage.service.UploadService.uploadCloudFile(UploadService.java:562)
		at com.microsoftopentechnologies.windowsazurestorage.service.UploadService$FileUploadThread.run(UploadService.java:119)
		at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
		at java.util.concurrent.FutureTask.run(Unknown Source)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
		... 1 more
AzureStorage - Error occurred while downloading from Azure - buildserviceapi:Failed uploading file
ERROR: AzureStorage - Error occurred while uploading to Azure - buildserviceapi
com.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException: Only 7/8 files are successfully uploaded.
	at com.microsoftopentechnologies.windowsazurestorage.service.UploadService.execute(UploadService.java:539)
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:455)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
	at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
	at hudson.model.Build$BuildExecution.post2(Build.java:177)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
	at hudson.model.Run.execute(Run.java:1932)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
ERROR: Step ‘Upload artifacts to Azure Storage’ aborted due to exception: 
com.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException: Only 7/8 files are successfully uploaded.
	at com.microsoftopentechnologies.windowsazurestorage.service.UploadService.execute(UploadService.java:539)
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:455)
Caused: java.io.IOException: AzureStorage - Error occurred while uploading to Azure - buildserviceapi
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:485)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
	at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
	at hudson.model.Build$BuildExecution.post2(Build.java:177)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
	at hudson.model.Run.execute(Run.java:1932)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
timja commented

This is fixed upstream in Azure/azure-sdk-for-java#21000, (it will need minor code changes to adjust to it once released but looks straightforward)

Was merged 2 days ago, I suggest downgrading for now, I've tried to work around it but I'm hitting another issue with something using a newer version of reactor-core, and azure file sdk not being compatible with it (it is compatible on master)

Thanks. Yes, we downgraded already and we're fine for now.

hi all,
have same issue
@timja just for clarify, maybe you have some ETA for this issue ?

timja commented

Looks like it's been released, so now just need to upgrade to the new APIs