Status: Resolved (View Workflow)
When multibranch project contains branch with forward slash in the name (for example `feature/foobar`) corresponding Job gets name `feature%2Ffoobar` from multibranch pipeline plugin.
artifact-manager-s3 plugin later uses this name to generate object key:
As a result generated artifact will be placed in directory hierarchy like this:
However when we try to download this artifact via http url
%2F will be converted to forward slash by browser and request fails with NoSuchKey error from AWS.
When branch name doesn't contain forward slash everything works as expected
JENKINS-50591 Files and paths with ampersand cause exception
- links to
> To be clear, by “download” you mean using a browser download from within the web UI displaying artifacts, right?
No, I mean using ordinary web-browser and going directly to public S3 bucket using link manually constructed from bucket name, project name, branch name and job number.
However when branch name contains forward slash there is no artifact section on build page at all so I can't check if presigned URLs work or not. In case when branch doesn't have slashes artifact section is present and links from there works fine.
Regarding access to artifacts in S3 directly (without going via Jenkins web UI). I don't know if this is currently supported use-case but it would be nice to have (even if it requires manual link generation).
In our case I wanted to provide these links to QA-team (that don't have access to Jenkins UI) so that they could download them later for testing. Presigned URLs don't work in this situation since they only valid for limited time.
Ah, download from the S3 web UI, that is another case I did not consider.
Various Jenkins steps allow you to download an artifact from this or another build. Additionally, the https://jenkins/job/x/nnn/artifact/dir/file URL is supposed to serve a 301 redirect to a presigned URL you could use for other tools.
In my tests, archiveArtifact, stash, and unstash all work; and I can download the artifact from the AWS Console; but unarchive and opening the artifacts view in the Jenkins UI both fail due to what I think is JCLOUDS-1401.
A relatively quick fix would be to look at this guide and escape job names with other characters in JCloudsArtifactManager.onLoad, though this would be incompatible from 1.0, mix jclouds aws-s3 limitations into general code, and not solve other problems with odd filenames being archived.
FYI, the current release of the plugin from July 17th 2018, does not include this fix. I was able to download the hpi from the latest build on master here https://ci.jenkins.io/job/Plugins/job/artifact-manager-s3-plugin/job/master/ and I can verify this issue is fixed. When can we expect another official release of this plugin which includes this fix?
To be clear, by “download” you mean using a browser download from within the web UI displaying artifacts, right?
Need to verify that copyartifact / unarchive / unstash can perform downloads via presigned URL. That at least should be testable via ArtifactManagerTest.