gocd-s3-artifact-plugin icon indicating copy to clipboard operation
gocd-s3-artifact-plugin copied to clipboard

The publish plugin is failing when publishing nested directories to s3.

Open zach-dunton-sf opened this issue 5 years ago • 6 comments

The publish plugin is failing when publishing nested directories to s3.

The directory structure looks like:

./artifact_store
   /deploy
     file.yml

This is the error message:

[go] The plugin sent a response that could not be understood by Go. Plugin returned with code '500' and the following response: 'Failed to publish Artifact[id=Artefact, storeId=S3, artifactPlanConfig={"Source":"artifact_store","Destination":"${CI_APP_NAME}/${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}/${GO_JOB_NAME}"}]: Unable to calculate MD5 hash: /go/pipelines/camera-connector-dev/artifact_store/deploy (Is a directory)'

zach-dunton-sf avatar Nov 07 '19 16:11 zach-dunton-sf

I also got burned by this. Switching back to local disk artifact manager until this can be resolved.

Vye avatar Nov 23 '20 20:11 Vye

Hi Both, thanks for reporting the issue.

Any chance that you would be able to raise a PR with a fix?

tomzo avatar Nov 24 '20 09:11 tomzo

We ended up just adding dummy files in each directory.

zach-dunton-sf avatar Nov 24 '20 10:11 zach-dunton-sf

Hi @zach-dunton-sf, so is there an error only when there is an empty directory in the structure that you are uploading? In your original message, there was file.yml in the deploy directory.

tomzo avatar Nov 24 '20 10:11 tomzo

Unfortunately we're not using GoCD right now so I don't have much more input on this. Maybe @Vye has more information.

Edited: I may not be remembering correctly, and removed potentially misleading information.

zach-dunton-sf avatar Nov 24 '20 10:11 zach-dunton-sf

My guess would be this needs to be recursive https://github.com/Diogomrol/gocd-s3-artifact-plugin/blob/60a4a8f539eed9d4580a651a461379c4f56f5f50/src/main/java/diogomrol/gocd/s3/artifact/plugin/model/AntDirectoryScanner.java#L12

If I get some time this week, I may take another look at it.

zach-dunton-sf avatar Nov 24 '20 10:11 zach-dunton-sf