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

How to generate what's needed for credentialID #40

Open
ps895r opened this issue Dec 20, 2022 · 4 comments
Open

How to generate what's needed for credentialID #40

ps895r opened this issue Dec 20, 2022 · 4 comments

Comments

@ps895r
Copy link

ps895r commented Dec 20, 2022

Describe your use-case which is not covered by existing documentation.

I'm trying to figure out how to generate the credentialID that the in-toto Jenkins plugin is looking for. Do I just need to create a secret file in Jenkins credentials? If so, is it then just doing a ssh-keygen and then adding that id_rsa file? That's what I've tried to do, but I keep getting the error in the title: Could not find credentials entry with ID 'toto'

Any help will be greatly appreciated!

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

@adityasaky
Copy link
Collaborator

Hi @ps895r, let me take a look. Thanks for opening the issue!

@adityasaky
Copy link
Collaborator

Update: @lakshya8066 is exploring this one.

@lakshya8066
Copy link
Contributor

Hi @ps895r can you post your Jenkins system logs for this error?
For me, it points to this page https://www.jenkins.io/blog/2018/03/15/jep-200-lts/ and says this file might need some changes to reconcile with this update.

@ps895r
Copy link
Author

ps895r commented Feb 9, 2023

Here is the full error I see:

I have tried using various names for credentialID. Below I tried generating a ssh key and then creating a Jenkins credential to be used as a variable. I've tried hard coding, etc. but always get some kind of similar error, which made me initially wonder if I'm just not understanding how to generate the credentialID.

java.lang.RuntimeException: Could not find credentials entry with ID 'toto' at io.jenkins.plugins.intotorecorder.InTotoWrapper.getCredentials(InTotoWrapper.java:225) at io.jenkins.plugins.intotorecorder.InTotoWrapper.<init>(InTotoWrapper.java:139) Caused: java.lang.reflect.InvocationTargetException at jdk.internal.reflect.GeneratedConstructorAccessor3713.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:330) Caused: java.lang.IllegalArgumentException: Could not instantiate {credentialId=toto, stepName=Build, transport=redis://redis} for io.jenkins.plugins.intotorecorder.InTotoWrapper at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334) at org.jenkinsci.plugins.structs.describable.UninstantiatedDescribable.instantiate(UninstantiatedDescribable.java:208) at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:466) at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:409) at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:329) Caused: java.lang.IllegalArgumentException: Could not instantiate {delegate=@in_toto_wrap(credentialId=toto,stepName=Build,transport=redis://redis)} for org.jenkinsci.plugins.workflow.steps.CoreWrapperStep at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:302) at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:499) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1295) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1150) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20) Caused: java.lang.IllegalArgumentException: Failed to prepare in_toto_wrap step at org.jenkinsci.plugins.workflow.cps.DSL.invokeDescribable(DSL.java:501) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1295) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1150) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20) at rpmBuildPipeline.call(rpmBuildPipeline.groovy:195) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:666) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:395) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:393) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage(ModelInterpreter.groovy:665) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:288) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:544) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock(ModelInterpreter.groovy:543) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:276) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:438) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83) at jdk.internal.reflect.GeneratedMethodAccessor613.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46) at com.cloudbees.groovy.cps.Next.step(Next.java:83) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:402) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:314) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:278) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) 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)

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

3 participants