Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73398

Artifactory Artifact Manager is not compatible with HashiCorp Vault secrets

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Minor Minor
    • other
    • None
    • Jenkins 2.452.2, Artifactory Artifact Manager 108.veb_6efeb_c992b_, HashiCorp Vault 368.v48134f694db_f

      After setting up the Artifactory Artifact Manager plugin with credentials from the HashiCorp Vault plugin, an exception is thrown when attempting to archive a file.

      Jul 03, 2024 10:52:06 AM io.jenkins.plugins.artifactory_artifacts.ArtifactoryArtifactManager$UploadToArtifactoryStorage invoke
      SEVERE: Unable to upload files to Artifactory
      java.lang.IllegalStateException: java.lang.IllegalStateException: Vault plugin has not been configured.
              at com.datapipe.jenkins.vault.credentials.common.VaultHelper.getVaultSecretKey(VaultHelper.java:109)
              at com.datapipe.jenkins.vault.credentials.common.AbstractVaultBaseStandardCredentials.getVaultSecretKeyValue(AbstractVaultBaseStandardCredentials.java:87)
              at com.datapipe.jenkins.vault.credentials.common.VaultUsernamePasswordCredentialImpl.getUsername(VaultUsernamePasswordCredentialImpl.java:63)
              at io.jenkins.plugins.artifactory_artifacts.ArtifactoryClient.buildArtifactory(ArtifactoryClient.java:201)
              at io.jenkins.plugins.artifactory_artifacts.ArtifactoryClient.<init>(ArtifactoryClient.java:30)
              at io.jenkins.plugins.artifactory_artifacts.ArtifactoryClient.<init>(ArtifactoryClient.java:34)
              at io.jenkins.plugins.artifactory_artifacts.ArtifactoryArtifactManager$UploadToArtifactoryStorage.invoke(ArtifactoryArtifactManager.java:345)
              at io.jenkins.plugins.artifactory_artifacts.ArtifactoryArtifactManager$UploadToArtifactoryStorage.invoke(ArtifactoryArtifactManager.java:333)
              at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3613)
              at hudson.remoting.UserRequest.perform(UserRequest.java:211)
              at hudson.remoting.UserRequest.perform(UserRequest.java:54)
              at hudson.remoting.Request$2.run(Request.java:377)
              at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
              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 hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:137)
              at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.IllegalStateException: Vault plugin has not been configured.
              at com.datapipe.jenkins.vault.credentials.common.VaultHelper.getVaultSecret(VaultHelper.java:47)
              at com.datapipe.jenkins.vault.credentials.common.VaultHelper.getVaultSecretKey(VaultHelper.java:98)
              ... 17 more

      Of note too is that this exception trace is only shown in the agent's log and not in the controller's log, which made this tricky to track down.

      The issue here appears to be that the plugin is only retrieving the values from the credentials after it's been transferred to the agent, where the global configuration required for the Vault plugin is not present.

          [JENKINS-73398] Artifactory Artifact Manager is not compatible with HashiCorp Vault secrets

          Hi,

          Please reopen the issue on the issue tracker the plugin is using. It's GitHub like specified on the plugin page https://plugins.jenkins.io/artifactory-artifact-manager/

           

          Thanks

          Valentin Delaye added a comment - Hi, Please reopen the issue on the issue tracker the plugin is using. It's GitHub like specified on the plugin page https://plugins.jenkins.io/artifactory-artifact-manager/   Thanks

          jonesbusy, oh, I missed that. Thanks for letting me know. I'm opening some PRs to fix it now anyway.

          Michael Tughan added a comment - jonesbusy , oh, I missed that. Thanks for letting me know. I'm opening some PRs to fix it now anyway.

            jonesbusy Valentin Delaye
            mtughan Michael Tughan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: