Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins_credentials credentials_list crashes when there is a not supported credential already created #932

Open
fcgravalos opened this issue Oct 22, 2019 · 0 comments

Comments

@fcgravalos
Copy link

fcgravalos commented Oct 22, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.14
  • Ruby: 2.4.5
  • Distribution: Debian 9 - Stretch
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

hiera_hash('jenkins_credentials').each |$k, $v| {
    jenkins_credentials { "${k}":
      ensure => $v['ensure'],
      domain => $v['domain'],
      impl => $v['impl'],
      scope => $v['scope'],
      description => $v['description'],
      username => $v['username'],
      password => $v['password'],
      secret => $v['secret'],
      passphrase => $v['passphrase'],
      private_key => $v['private_key']
    }
  }

What are you seeing

Error: Could not prefetch jenkins_credentials provider 'cli': Execution of '/bin/cat /usr/share/jenkins/puppet_helper.groovy | /usr/bin/java -jar /usr/share/jenkins/jenkins-cli.jar -s http://localhost:8080 -logger WARNING -auth @/tmp/jenkins_credentials_for_puppet groovy = credentials_list_json' returned 1: ERROR: Unexpected exception occurred while performing groovy command.
UnsupportedCredentialsClass: unsupported com.datapipe.jenkins.vault.credentials.VaultAppRoleCredential@8c1f3e84
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
	at Actions$_credentials_list_json_closure2.doCall(RemoteClass:570)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at groovy.lang.Closure.call(Closure.java:414)
	at groovy.lang.Closure.call(Closure.java:430)
[ ... ]

What behaviour did you expect instead

it will get the list of credentials that only the module supports and that's it.

Output log

Same above

Any additional information you'd like to impart

We use heavily hashicorp-vault credentials plugin, but we need some credentials as well to bootstrap jenkins.

Those bootstrapping ones I was deploying them using this puppet module, but since the module does not support vault plugin, I had to create this one manually and caused the module to crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant