title: Jenkins hashicorp-vault-plugin empty result
body: <p>I tried the Jenkins Pipeline Example mentioned here: <a href="https://plugins.jenkins.io/hashicorp-vault-plugin" rel="nofollow noreferrer">https://plugins.jenkins.io/hashicorp-vault-plugin</a></p>
  
  <pre><code>node {
      // define the secrets and the env variables
      def secrets = [
          [$class: 'VaultSecret', path: 'secret/testing', secretValues: [
              [$class: 'VaultSecretValue', envVar: 'testing', vaultKey: 'value_one'],
              [$class: 'VaultSecretValue', envVar: 'testing_again', vaultKey: 'value_two']]],
          [$class: 'VaultSecret', path: 'secret/another_test', secretValues: [
          [$class: 'VaultSecretValue', envVar: 'another_test', vaultKey: 'value']]]
      ]
  
      // optional configuration, if you do not provide this the next higher configuration
      // (e.g. folder or global) will be used
      def configuration = [$class: 'VaultConfiguration',
                           vaultUrl: 'http://my-very-other-vault-url.com',
                           vaultCredentialId: 'my-vault-cred-id']
      // inside this block your credentials will be available as env variables
      wrap([$class: 'VaultBuildWrapper', configuration: configuration, vaultSecrets: secrets]) {
          sh 'echo $testing'
          sh 'echo $testing_again'
          sh 'echo $another_test'
      }
  }
  </code></pre>
  
  <p>So I installed hashicorp-vault-plugin 2.2.0 in Jenkins 2.173 and started a Vault (v1.1.1) Docker Container using</p>
  
  <pre><code>docker run -d --name vaulttest -p 80:8200 --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' vault
  </code></pre>
  
  <p>Next I configured a token credential within Jenkins using token "myroot"</p>
  
  <p>I created the Secrets within Vault (using the WebUI)</p>
  
  <pre><code>testing
     value_one
     value_two
  another_test
     value
  </code></pre>
  
  <p>First of all there is an error within the example: When using path "secret/testing" and "secret/another_test" the plugin fails with an error 404:</p>
  
  <pre><code>Invalid path for a versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use. If using the Vault CLI, use 'vault kv get' for this operation."
  </code></pre>
  
  <p>This can be fixed when using path "secret/data/testing" and "secret/data/another_test" (see <a href="https://issues.jenkins-ci.org/browse/JENKINS-44900" rel="nofollow noreferrer">https://issues.jenkins-ci.org/browse/JENKINS-44900</a>)</p>
  
  <p>When then calling the Job the Variables seem to be empty:</p>
  
  <pre><code>[Pipeline] sh
  + echo
  
  [Pipeline] sh
  + echo
  
  [Pipeline] sh
  + echo
  </code></pre>
  
  <p>The connection definitely works because when providing invalid credentials or invalid paths I receive errors.</p>
  
  <p>Also retrieving the Secrets directly return a valid response:</p>
  
  <pre><code>/ # vault kv get secret/testing
  ====== Metadata ======
  Key              Value
  ---              -----
  created_time     2019-04-17T05:31:23.581020191Z
  deletion_time    n/a
  destroyed        false
  version          3
  
  ====== Data ======
  Key          Value
  ---          -----
  value_one    HUGO
  value_two    BETTY
  </code></pre>
  
  <p>What am I missing here?</p>