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.

JCasC requires update center to have pluginsmetadata.json?

See original GitHub issue

Please make sure to provide following information in your issue description

  • Jenkins version: 2.150.3
  • Plugin version: 1.7
  • OS: Alpine

When specifying only update center list some odd behavior for JCasC occur.

plugins:
  sites:
  - id: "default"
    url: "https://updates.jenkins.io/update-center.json"
  - id: "jenkins-updates"
    url: "https://jenkinsupdates.mycompany.dot/update-center.json"

Here I would hope that JCasC would just configure hudson.model.UpdateCenter and nothing more.

However, it starts trying to fetch pluginmetadata.json which results in null object exception on https://jenkins.mycompany.dot page

It also unexpectedly tries to download plugins that are not even specified in the plugins block:

jenkins_1  | Feb 28, 2019 12:41:45 PM jenkins.util.JSONSignatureValidator verifySignature
jenkins_1  | INFO: JSON data source 'update site 'jenkins-updates'' does not provide a SHA-512 content checksum or signature. Looking for SHA-1.
jenkins_1  | Feb 28, 2019 12:41:45 PM hudson.model.UpdateSite updateData
jenkins_1  | INFO: Obtained the latest update center data file for UpdateSource jenkins-updates
jenkins_1  | Feb 28, 2019 12:43:14 PM hudson.model.UpdateCenter$DownloadJob run
jenkins_1  | INFO: Starting the installation of vsphere-cloud on behalf of SYSTEM
jenkins_1  | Feb 28, 2019 12:43:15 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download
jenkins_1  | INFO: Downloading vsphere-cloud
jenkins_1  | Feb 28, 2019 12:43:16 PM hudson.model.UpdateCenter$DownloadJob run
jenkins_1  | INFO: Starting the installation of git-client on behalf of SYSTEM
jenkins_1  | Feb 28, 2019 12:43:17 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download
jenkins_1  | INFO: Downloading git-client
jenkins_1  | Feb 28, 2019 12:43:19 PM hudson.model.UpdateCenter$DownloadJob run
jenkins_1  | INFO: Starting the installation of email-ext on behalf of SYSTEM
jenkins_1  | Feb 28, 2019 12:43:20 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download
jenkins_1  | INFO: Downloading email-ext
jenkins_1  | Feb 28, 2019 12:43:20 PM hudson.model.UpdateCenter$DownloadJob run
jenkins_1  | INFO: Starting the installation of xunit on behalf of SYSTEM
jenkins_1  | Feb 28, 2019 12:43:21 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download
jenkins_1  | INFO: Downloading xunit
net.sf.json.JSONException: null object
	at net.sf.json.JSONObject.verifyIsNull(JSONObject.java:2688)
	at net.sf.json.JSONObject.getString(JSONObject.java:2035)
	at hudson.model.UpdateSite$Entry.<init>(UpdateSite.java:633)
	at hudson.model.UpdateSite$Plugin.<init>(UpdateSite.java:991)
	at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.getPluginMetadata(PluginManagerConfigurator.java:296)
	at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.configurePlugins(PluginManagerConfigurator.java:177)
	at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.configure(PluginManagerConfigurator.java:92)
	at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.configure(PluginManagerConfigurator.java:58)
	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:284)
	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:657)
	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:620)
	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:657)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:642)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:545)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:275)
	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:267)
	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)
	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:1083)
	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: 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:1083)
	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:1117)
	at jenkins.model.Jenkins.<init>(Jenkins.java:921)
	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.HudsonFailedToLoad
	at hudson.WebAppMain$3.run(WebAppMain.java:250)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jetersencommented, Mar 5, 2019

tbh plugin management should be handled by Jenkins Core and provide a CLI interface and programmable java interface to manage. That’s my two cents.

Then we could deprecate this whole plugin management mess located in this repo and the Jenkins docker repo with the whole install-plugin.sh 😓

0reactions
jetersencommented, Mar 19, 2019

Yes, I just wanted to capture the reasoning for removing the plugin management in JCasC

Read more comments on GitHub >

github_iconTop Results From Across the Web

jenkinsci/configuration-as-code-plugin - Gitter
I plan to make a PR to credentials plugin next week ... plugins: sites: - id: "default" url: "https://updates.jenkins.io/update-center.json" required: ...
Read more >
Jenkins Update Sites
To configure this default update site in Jenkins, specify https://updates.jenkins.io/update-center.json in Manage Jenkins » Manage Plugins » Advanced.
Read more >
Running Jenkins Server with Configuration-As-Code
JcasC plugin requires setting an environment variable that points to location of ... url: "https://updates.jenkins.io/update-center.json".
Read more >
Getting started with Jenkins Configuration as Code - Eficode
JCasC is a Jenkins plugin that allows you to store and maintain your ... make sure to update the passing in of secrets...
Read more >
How to configure Update Center Upstream Sources?
In order to best manage your update center, you need to ensure that you track the ... I have several version of Jenkins...
Read more >

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