Expected block end but found block mapping start

(Or anyone else so informed for that matter, it's a little cryptic with just a 'Outdated.' x)

Mads Nielsen

@MadsNielsen

I think it's because @ndeloof moved the matrix auth integration to the support plugin, pending real integration in the matrix plugin.

@x10an14 But matrix auth works with RC1 and the support module installed

securityRealm: local: allowsSignup: false users: - id: demoAdmin password: ${adminpw:-passw0rd} authorizationStrategy: globalMatrix: grantedPermissions: - "Overall/Read:anonymous" - "Job/Read:anonymous" - "View/Read:anonymous" - "Overall/Administer:authenticated"

New syntax for permissions, but otherwise the same

@MadsNielsen Thank you! =D I'll take a gander at the support module then, when I upgrade to RC1 =)

Mads Nielsen

@MadsNielsen

Yea @x10an14 you need the support plugin for the best experience :)

Jon Brohauge

@jonbrohauge

Just migrated from 0.11 to 1.0-rc1 ( and support)... I got a crash and burn on jenkins Any heads up on which items under there that have been changed?

SEVERE: Failed ConfigurationAsCode.init java.lang.Error: java.lang.reflect.InvocationTargetException 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:1068) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) 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) Caused by: 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) ... 8 more Caused by: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:505) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:534) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:521) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:433) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:169) at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:161) ... 13 more Caused by: io.jenkins.plugins.casc.ConfiguratorException: Item isn't a Scalar at io.jenkins.plugins.casc.model.CNode.asScalar(CNode.java:28) at io.jenkins.plugins.casc.impl.configurators.PrimitiveConfigurator.configure(PrimitiveConfigurator.java:45) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:292) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:218) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:94) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:99) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:43) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:299) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:234) at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$6(ConfigurationAsCode.java:534) at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:499) ... 18 more

I can read the gist of it: Item isn't a Scalar but which Item...

same here : upgraded JCasC (0.11 -> RC1) via Plugins management UI and boum :

java.lang.NullPointerException at io.jenkins.plugins.casc.model.Mapping.lambda$clone$0(Mapping.java:73) at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:73) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:12) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at io.jenkins.plugins.casc.model.Sequence.clone(Sequence.java:46) at io.jenkins.plugins.casc.model.Sequence.clone(Sequence.java:11) at io.jenkins.plugins.casc.model.Mapping.lambda$clone$0(Mapping.java:73) at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:73) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:12) at io.jenkins.plugins.casc.model.Mapping.lambda$clone$0(Mapping.java:73) at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:73) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:12) at io.jenkins.plugins.casc.model.Mapping.lambda$clone$0(Mapping.java:73) at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at io.jenkins.plugins.casc.model.Mapping.clone(Mapping.java:73) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:520) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:433) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:169) at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:161) 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:1068) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) 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) Caused: org.jvnet.hudson.reactor.ReactorException at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282) at jenkins.InitReactorRunner.run(InitReactorRunner.java:48) at jenkins.model.Jenkins.executeReactor(Jenkins.java:1102) at jenkins.model.Jenkins.<init>(Jenkins.java:904) at hudson.model.Hudson.<init>(Hudson.java:85) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.WebAppMain$3.run(WebAppMain.java:233) Caused: hudson.util.HudsonFail

Mads Nielsen

@MadsNielsen

right, can you share your jenkins.yml?

@yogeek That looks like the same error i had, we do not work with empty values anymore, my issue was ssh plugin with no passphrase

indeed I have

jenkins: crumbIssuer: standard: excludeClientIPFromCrumb: true

it must be it right ?

Mads Nielsen

@MadsNielsen

@yogeek Yes...that's the culprit

i used crumbIssuer: standard

that worked....not sure about that other option....

@MadsNielsen did correcting the YAML file was enough to fix the error for you ?

Mads Nielsen

@MadsNielsen

It fixed the NPE

ok so I must have other empty values elsewhere...

Mads Nielsen

@MadsNielsen

Make sure you're getting the same error

oh still have an error linked to the same file... do you keep the sub-value 'excludeClientIpFromCrumb' like this ?

jenkins: crumbIssuer: "standard" excludeClientIPFromCrumb: true

@yogeek I have the same syntax and no issues with RC1, even though @MadsNielsen mentioned some problems above...
But that error means that you messed up with formatting somewhere...

Jon Brohauge

@jonbrohauge

@yogeek That's gonna fail... Just had the same error

Also, I think @MadsNielsen example will only work if you have no any excludeClientIPFromCrumb: true...

So, your initial snippet should work

Mads Nielsen

@MadsNielsen

Yeah...i just tried the same snippet and it works

so @yogeek double check your jenkins.yaml

Jon Brohauge

@jonbrohauge

Just looked at my

authorizationStrategy: globalMatrix: grantedPermissions: permissions: [..]

Think they might be off, and that's causing my troubles...

Mads Nielsen

@MadsNielsen

@jonbrohauge Yep. That is the old syntax

Jon Brohauge

@jonbrohauge

Did a quick and dirty update to my jenkins.yaml, and it certainly appears that it'll work (again) once I have fiddled with permissions...

Mads Nielsen

@MadsNielsen

We'll see if it's possible to come up with better error messages.

Jon Brohauge

@jonbrohauge

Argh... Jobs->url: ....
ERROR: script not yet approved for use

Crap... Need to fix those as well...

Anyone willing and able to take a gander at my jenkins.yaml / output error? I'm getting a nullpointerexception during startup =(

Jon Brohauge

@jonbrohauge

Create an issue

Mads Nielsen

@MadsNielsen

@x10an14 remember to include stuff like jenkins version in the issue

@sshepel @MadsNielsen Just tried both syntax and error in both :

jenkins: crumbIssuer: standard: excludeClientIPFromCrumb: true

=> NullPointerExeception

jenkins: crumbIssuer: "standard" excludeClientIPFromCrumb: true

=>

jenkins_1 | Caused by: while parsing a block mapping jenkins_1 | in /var/jenkins_home/casc_configs/csrf.yml, line 2, column 3: jenkins_1 | crumbIssuer: "standard" jenkins_1 | ^ jenkins_1 | expected <block end>, but found '<block mapping start>' jenkins_1 | in /var/jenkins_home/casc_configs/csrf.yml, line 3, column 5: jenkins_1 | excludeClientIPFromCrumb: true jenkins_1 | ^

Mads Nielsen

@MadsNielsen

@yogeek Yeah, i think it was a false problem, your original setting should work fine.

ok so the NPE may come from another config

@yogeek is this a complete yaml?

As I mentioned before, you probaly have some formatting issues in yaml

@sshepel all my conf is splitted into several YAML files, and this is the one for csrf config

Jon Brohauge

@jonbrohauge

@yogeek Yup... I have the exact same crumbIssuer that you have... My issue ended up being somewhere totally else... lousy changes in permissions... mumble

ok will look into that, thx !

Toplist

Latest post

TAGs