question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ConfiguratorException when using casc credentials with 1.0-beta-13/14

See original GitHub issue

When starting jenkinsfile-runner with credentials present in the casc yaml, an exception occurs during launch:

2020-07-28 11:42:58.176+0000 [id=28]    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
io.jenkins.plugins.casc.ConfiguratorException: No configurator for the following root elements credentials
        at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713)
        at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:755)
        at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:740)
        at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:616)
        at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:298)
        at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:290)
Caused: java.lang.reflect.InvocationTargetException
        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 hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
Caused: java.lang.Error
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
        at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1131)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

The configuration yaml:

credentials:
  system:
    domainCredentials:
      - credentials:
          - UsernamePasswordCredentialsImpl:
              scope: GLOBAL
              id: sample_credential
              username: sample_user
              password: sample_password

This constellation still worked with beta-12.

Am I missing some config change or required plugin?

plugins.txt

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
oleg-nenashevcommented, Oct 7, 2020

Sorry, I missed the previous message due to my vacation @bparzella . I will try to take a look

1reaction
bparzellacommented, Sep 4, 2020

So I did some more testing and I created a minimal example that reproduces the error for me.

Background: in my use case the pipeline uses credentials, which are defined in the casc yaml.

So if I have the casc plugin present in the plugins.txt (which was okay before beta 13), I get the error I reported initially. This is how the attached example is set up.

If I remove the casc plugin from the plugins.txt, there seems to be an issue, loading the credentials from the casc yaml:

[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in d:\UserData\z0046afz\src\jfr_test\workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: sample_credential
Finished: FAILURE

(This error is the same in beta 12.)

To reproduce this error with the example, simply remove casc from the plugins.txt.

The Example: A script for downloading the JFR jar is present in the install folder, the jfr_test.bat runs JFR with plugins, config and Jenkinsfile.

jfr_test.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found