lockable-resources-plugin
lockable-resources-plugin copied to clipboard
JCasC warning log for LockableResource#build
During Jenkins startup I get:
WARNING i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class org.jenkins.plugins.lockableresources.LockableResource#build: type is abstract but not Describable.
=> Extracted/moved the problem from (very generic issue) https://github.com/jenkinsci/configuration-as-code-plugin/issues/536
New Jenkins Lockable Resources plugin release v2.6 thankfully also supports JCasC now =>
2019-10-16 09:50:27.953+0000 [id=76] WARNING i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class org.jenkins.plugins.lockableresources.LockableResource#build: type is abstract but not Describable.
By the way: Is adding such comments helpful at all (to you/anyone)? Or is it just feeling like unnecessary spam?
I ran into this error. I was using an identical value for the name, and label properties. Using a unique string for each seemed to clear up the problem...
Well, mine are not identical, but admittedly quite similar (with same prefix)?
...
unclassified:
lockableResourcesManager:
declaredResources:
- name: "PhpStorm#1"
labels: "PhpStorm"
- name: "PhpStorm#2"
labels: "PhpStorm"
- name: "pipeline-jobs-folder-write-access"
@reinholdfuereder so upon closer inspection, my resolution might have come from disabling the Matrix auth plugin. Before I fixed things, I saw this in the YAML output:
globalCredentialsConfiguration:
queueItemAuthenticator:
authenticators:
- global:
strategy: |-
FAILED TO EXPORT
org.jenkinsci.plugins.authorizeproject.GlobalQueueItemAuthenticator#strategy: io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'useApitoken' from org.jenkinsci.plugins.authorizeproject.strategy.SpecificUsersAuthorizationStrategy@194c6bda
at io.jenkins.plugins.casc.Attribute._getValue(Attribute.java:461)
at io.jenkins.plugins.casc.Attribute.getValue(Attribute.java:235)
at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:289)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
at io.vavr.control.Option.map(Option.java:392)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:316)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
at io.vavr.control.Option.map(Option.java:392)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:257)
at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:183)
at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:114)
at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.lambda$describe$3(GlobalConfigurationCategoryConfigurator.java:107)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:107)
at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:33)
After changng the label from MEMCHECK to LIMITER, and switching temporarily to logged in users have permission to everything, I was able to export a YAML config without any ugliness. I got this for my semaphore (aka lockable resource):
unclassified:
lockableResourcesManager:
declaredResources:
- description: "A placebo resource used limit how many memcheck jobs are run simultaneously."
labels: "LIMITER"
name: "MEMCHECK"
I didn;t realize until I saw your post that it had moved to unclassified, but based on this, I think that is where it should be.