Credentials indentation problem during jenkins.yaml importation
See original GitHub issueEnvironment
- Jenkins version 2.176.1
- Plugin version: 1.21
- OS : VM Windows Server 2019 Standard - 64 bit
Description
I’m writing my first Jenkins CasC configuration file. When I try to apply it, I’ve got the following error message and I don’t understand how to resolve it :
Item isn't a Sequence
io.jenkins.plugins.casc.ConfiguratorException: Item isn't a Sequence
at io.jenkins.plugins.casc.model.CNode.asSequence(CNode.java:22)
at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:342)
at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:288)
at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:353)
at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:288)
at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$6(ConfigurationAsCode.java:672)
at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:634)
Caused: io.jenkins.plugins.casc.ConfiguratorException: credentials: error configuring 'credentials' with class com.cloudbees.plugins.credentials.casc.CredentialsRootConfigurator configurator
jenkins.yaml credential part
I put directly the passwords value as strings
# Credentials used by Jenkins and by jenkins projects
credentials:
system:
domainCredentials:
credentials:
- usernamePassword:
scope: GLOBAL
id: "username1"
username: 'username1'
password: "password1"
description: "RD"
- usernamePassword:
scope: GLOBAL
id: "username2"
username: 'username2'
password: "password2"
description:
- usernamePassword:
scope: GLOBAL
id: "username3"
username: 'username3'
password: "password3"
description: "gitlab RD user"
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Configuring a Jenkins Pipeline using a YAML file
We needed to build a new CI that could, at least, address the following: Projects must be built using Docker.
Read more >Create and Configure Jobs and Pipelines Using YAML
It must be indented to the same level as the parent field. To indent, always use spaces, not tabs. Make sure that number...
Read more >The `.gitlab-ci.yml` file - GitLab Docs
yml in the root of your repository, which contains the CI/CD configuration. In the .gitlab-ci.yml file, you can define: The scripts you want...
Read more >jenkinsci/configuration-as-code-plugin - Gitter
package io.jenkins.plugins.casc.impl.secrets; import edu.umd.cs.findbugs.annotations. ... Is your indentation set properly? yaml is very querky about that.
Read more >29. Troubleshooting Tower - Ansible Documentation
Nginx web server errors are logged in the httpd error log. ... Is your YAML file correctly indented? ... Indentation level is significant...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Credentials are a bit funky on indenting it has to be 4 space indented after
- credentials:
Perfect, issue solved ! I wrote it with 4 spaced tab just as you did. I’ve got now a security error but it should be another topic subject