Closed aujasm1 closed 1 year ago
Forgot to mention that we're running: Jenkins 2.375.1 Azure Artifact Manager 115.vb0d5da76bb49
The code for that is around here: https://github.com/jenkinsci/azure-artifact-manager-plugin/blob/65f5565c2e917ad0b868dd61721c7385e48b5477/src/main/java/com/microsoft/jenkins/artifactmanager/AzureArtifactManager.java#L87-L123
From a quick read it all seems supported and it definitely used to work but I haven't tried this in awhile.
mmmm...ok....thank you Tim
I can see from the code that checkConfig calls Utils.containTokens(containerName).
containTokens then does a regex match using Constants.TOKEN_FORMAT:
public static boolean containTokens(String text) {
if (StringUtils.isBlank(text)) {
return false;
}
return text.matches(**Constants.TOKEN_FORMAT**);
}
Can you tell me where is this constant? I could not locate in Constants.java (alongside Utils.java). I'm wondering if this will give a clue to why its not detecting the ENV var properly?
nvm, I think I found it at:
public static final String TOKEN_FORMAT = "\\$([A-Za-z0-9_]+|\\{[A-Za-z0-9_]+\\})";
which seems ok......what part of the process does the ENV var lookup?
Is it another plugin that should be doing the replacement of the JOB_NAME var ref?
Jenkins and plugins versions report
Environment
```text Paste the output here ```What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 20.04
Reproduction steps
java.net.URISyntaxException: Illegal character in path at index 54: https://epiphanybuildartifacts.blob.core.windows.net/${JOB_NAME} at java.base/java.net.URI$Parser.fail(URI.java:2913) at java.base/java.net.URI$Parser.checkChars(URI.java:3084) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3166) at java.base/java.net.URI$Parser.parse(URI.java:3114) at java.base/java.net.URI.(URI.java:600)
at java.base/java.net.URI.create(URI.java:881)
Caused: java.lang.IllegalArgumentException: Illegal character in path at index 54: https://epiphanybuildartifacts.blob.core.windows.net/${JOB_NAME}
at java.base/java.net.URI.create(URI.java:883)
at com.azure.storage.blob.BlobContainerAsyncClient.(BlobContainerAsyncClient.java:147)
at com.azure.storage.blob.BlobServiceAsyncClient.getBlobContainerAsyncClient(BlobServiceAsyncClient.java:163)
at com.azure.storage.blob.BlobServiceClient.getBlobContainerClient(BlobServiceClient.java:77)
at com.microsoft.jenkins.artifactmanager.Utils.getBlobContainerReference(Utils.java:139)
at com.microsoft.jenkins.artifactmanager.AzureArtifactManager.archive(AzureArtifactManager.java:141)
Caused: java.io.IOException
at com.microsoft.jenkins.artifactmanager.AzureArtifactManager.archive(AzureArtifactManager.java:162)
at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:258)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:101)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)
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(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 java.base/java.lang.Thread.run(Thread.java:829)
Finished: FAILURE
Expected Results
I was expecting the plugin to write artifacts to a container in Azure Storage with a name equal to the name of the job in Jenkins.
Actual Results
I receive the exception noted above.
Anything else?
No response