[BUG] Proxy Configuration
See original GitHub issueDescription Greetings, after the anouncement of this plugins support during the Jenkins World 18 I thought I would give it a go and try to replace some of my groovy scripts I used to set up the Jenkins servers at work, but now I ran into an issue that I assume is a bug. As we use a proxy-server at work, which needs to be set in Jenkins too, I tried to configure it via CasC but failed with practicalt the same outcome each time. (for details see below) And as ther is no official demo available yet to follow, for setting the proxy, I had to interrpret the documentation provided by the plugin itself, so it may verry well be that i misinterpreted the documentation and that this is no bug at all. Anyway, thanks for reading and please have a look at the details of my report below.
Summary Intention to set company proxy via CasC-plugin, but reseving a StringOutOfBBoundsException each time the block to set the proxy is present in the config.yml file.
Steps to Reproduce Attempt to set any proxy server via the CasC-plugin
Expected Results Setting the proxy-server for Jenkins to use
Actual Results Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
More Info config.yml proxy setting:
plugins:
proxy:
name: "http://<proxy.address>"
port: 8080
Jenkins Output:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.readShrinkwrapFile(PluginManagerConfigurator.java:328)
at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.configurePlugins(PluginManagerConfigurator.java:144)
at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.configure(PluginManagerConfigurator.java:93)
at io.jenkins.plugins.casc.plugins.PluginManagerConfigurator.configure(PluginManagerConfigurator.java:58)
at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$configureWith$6(ConfigurationAsCode.java:634)
at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:606)
at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:634)
at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:540)
at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:270)
at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:262)
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:1066)
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:1100)
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.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:250)
(also tried .yml blocks)
plugins:
proxy:
name: "<proxy.address>"
port: 8080
sites:
- id: "default"
url: "https://updates.jenkins.io/update-center.json"
The documentation generated by the plugin that I followed:
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
plugin management is enabled by setting a
plugin
element in your YAML file, and for legacy reasons Jenkins proxy settings are hosted by the PluginManager. JCasC plugin management require you to define explicit versions for plugins you want to install, to enforce reproducibility, so from this point of view your plugins.txt file is invalid (admittedly we should offer a better error message)thanks for your answer, guess ill keep my 1 groovy script to set the proxy 😉 at container startup.
anyway thnks for handeling my report!