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.

[BUG] Proxy Configuration

See original GitHub issue

Description 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: 1 2

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ndeloofcommented, Oct 9, 2018

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)

0reactions
h1dden-da3m0ncommented, Oct 15, 2018

thanks for your answer, guess ill keep my 1 groovy script to set the proxy 😉 at container startup.

anyway thnks for handeling my report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Security Bug Hunting with Proxies - Null Sweep
Web attack proxies are configured to be an intermediary between your browser and the target site, capturing all requests and responses made ...
Read more >
Fix For Unable to Connect to Proxy Server Error In Windows 10
Unable to Connect to Proxy Server in Windows 10 · 1. Disable Proxy Settings · 2. Reset Internet Options · 3. Clear Browser...
Read more >
[BUG] proxy.managed state do not configure Windows ...
When applying a proxy configuration on Windows with proxy.managed state module. The proxy configuration and registry keys are properly set, but ...
Read more >
Windows could not automatically detect network proxy settings
How to Solve the "Windows Could Not Automatically Detect Network Proxy Settings" Error · 1. Reboot Your Computer and Router · 2. Review...
Read more >
Proxy configuration details gets hidden in wifi settings. - Cisco
Symptom: Auto Proxy configuration details gets hidden in wifi settings. While relaunching network settings in the settings app, Auto Proxy ...
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