-
Bug
-
Resolution: Fixed
-
Minor
My symptom is when I click promote I get the following output:
Started by user XXX@mydomain.com
Building on master in workspace /var/lib/jenkins/jobs/Package for Release /workspace
Promoting JOB BEING PROMOTED
provisoning config files...
And it sits there...
A snapshot of the stack trace is:
at org.jenkinsci.plugins.configfiles.ConfigFiles.getByIdOrNull(ConfigFiles.java:82)
at org.jenkinsci.plugins.configfiles.ConfigFiles.getByIdOrNull(ConfigFiles.java:103)
at org.jenkinsci.plugins.configfiles.ConfigFiles.getByIdOrNull(ConfigFiles.java:114)
at org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFileUtil.provisionConfigFiles(ManagedFileUtil.java:81)
at org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep.perform(ConfigFileBuildStep.java:61)
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:405)
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:347)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1729)
at hudson.model.Run.run(Run.java:1688)
at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:286)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
This method: getByIdOrNull at the plugin version I'm on (config files provider: 2.15.1) is the following:
public static <T extends Config> T getByIdOrNull(@Nullable ItemGroup itemGroup, @NonNull String configId) { while (itemGroup != null) { if (folderPluginInstalled() && itemGroup instanceof AbstractFolder) { final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); ConfigFileStore store = folder.getProperties().get(FolderConfigFileProperty.class); if (store != null) { Config config = store.getById(configId); if (config != null) { return (T) config; } } } if (itemGroup instanceof Item) { itemGroup = Item.class.cast(itemGroup).getParent(); } if (itemGroup instanceof Jenkins) { // we are on top scope... return (T) GlobalConfigFiles.get().getById(configId); } else { continue; } } return null; }
After attaching the debugger I've found that the reason I'm getting this behaviour is because this method does not return.
It just loops around and around.
The real type of the passed in itemGroup is hudson.plugins.promoted_builds.JobPropertyImpl
- Folder Plugins is installed but itemGroup is not an instance of AbstractFolder
- JobPropertyImpl is not an instance of Item
- JobPropertyImpl is not an instance of Jenkins either.
So this method will never return.
What is more is the configId that is passed in is valid as if I call GlobalConfigFiles.get().getById(configId); I get back what I expect.
I suspect that 3rd condition probably needs to be relaxed a little...
- is related to
-
JENKINS-40728 Invalid class cast in Disk Usage Plugin when ItemGroup is not a TopLevelItem
- Resolved
-
JENKINS-41049 java.lang.IllegalArgumentException: can not determine current context/parent for: XXXX/promotion of type class hudson.plugins.promoted_builds.JobPropertyImpl
- Closed
- links to