• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • mercurial-plugin
    • None

      1. Enter GoogleCode browser URL that does not end with /source/
      2. Jenkins will throw the following unhandled exception:
      javax.servlet.ServletException: java.lang.RuntimeException: Failed to instantiate class hudson.plugins.mercurial.MercurialSCM from {"value":"2","installation":"Mercurial (auto-install)","source":"https://code.google.com/p/boost-maven-project/","credentialsId":"","branch":"default","modules":"","clean":false,"subdir":"","":"2","browser":{"stapler-class<span class="code-quote">":"hudson.plugins.mercurial.browser.GoogleCode","url":"https://code.google.com/p/boost-maven-project/"}}
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:735)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799)
      	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:239)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:685)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:587)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:218)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      	at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
      	at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
      	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:66)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
      	at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
      	at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227)
      	at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.RuntimeException: Failed to instantiate class hudson.plugins.mercurial.MercurialSCM from {"value":"2","installation":"Mercurial (auto-install)","source":"https://code.google.com/p/boost-maven-project/","credentialsId":"","branch":"default","modules":"","clean":false,"subdir":"","":"2","browser":{"stapler-class<span class="code-quote">":"hudson.plugins.mercurial.browser.GoogleCode","url":"https://code.google.com/p/boost-maven-project/"}}
      	at hudson.model.Descriptor.newInstance(Descriptor.java:576)
      	at hudson.plugins.mercurial.MercurialSCM$DescriptorImpl.newInstance(MercurialSCM.java:844)
      	at hudson.plugins.mercurial.MercurialSCM$DescriptorImpl.newInstance(MercurialSCM.java:818)
      	at hudson.scm.SCMS.parseSCM(SCMS.java:63)
      	at hudson.model.AbstractProject.submit(AbstractProject.java:1999)
      	at hudson.model.Project.submit(Project.java:202)
      	at hudson.model.Job.doConfigSubmit(Job.java:1136)
      	at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:784)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:297)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:160)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:95)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:685)
      	... 58 more
      Caused by: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.mercurial.MercurialSCM from {"value":"2","installation":"Mercurial (auto-install)","source":"https://code.google.com/p/boost-maven-project/","credentialsId":"","branch":"default","modules":"","clean":false,"subdir":"","":"2","browser":{"stapler-class<span class="code-quote">":"hudson.plugins.mercurial.browser.GoogleCode","url":"https://code.google.com/p/boost-maven-project/"}}
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:597)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:392)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:388)
      	at hudson.model.Descriptor.newInstance(Descriptor.java:567)
      	... 75 more
      Caused by: java.lang.IllegalArgumentException: Failed to convert the browser parameter of the constructor public hudson.plugins.mercurial.MercurialSCM(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,hudson.plugins.mercurial.browser.HgBrowser,boolean,java.lang.String)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:591)
      	... 78 more
      Caused by: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.mercurial.browser.HgBrowser from {"stapler-class":"hudson.plugins.mercurial.browser.GoogleCode","url":"https://code.google.com/p/boost-maven-project/"}
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:597)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:392)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:589)
      	... 78 more
      Caused by: java.lang.IllegalArgumentException: java.net.MalformedURLException: GoogleCode browser URL (currently: https://code.google.com/p/boost-maven-project/) must end with '/source/'
      	at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:454)
      	at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:77)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:595)
      	... 80 more
      Caused by: java.net.MalformedURLException: GoogleCode browser URL (currently: https://code.google.com/p/boost-maven-project/) must end with '/source/'
      	at hudson.plugins.mercurial.browser.GoogleCode.<init>(GoogleCode.java:28)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      	at java.lang.reflect.Constructor.newInstance(Unknown Source)
      	at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:439)
      	... 82 more
      

      Expected behavior: Display the error as a UI message without crashing.

          [JENKINS-19582] GoogleCode browser URL must end with '/source/'

          Jesse Glick added a comment -

          1.47 will already display such an error message during configuration. It would be nice to redirect you to the configuration screen when Save is clicked despite the presence of erroneous data, but as far as I know Jenkins does not offer an API to do that.

          Jesse Glick added a comment - 1.47 will already display such an error message during configuration. It would be nice to redirect you to the configuration screen when Save is clicked despite the presence of erroneous data, but as far as I know Jenkins does not offer an API to do that.

          cowwoc added a comment -

          Can we convert this issue to a feature request (to add the necessary API) and redirect to "core"?

          cowwoc added a comment - Can we convert this issue to a feature request (to add the necessary API) and redirect to "core"?

          Jesse Glick added a comment -

          Better to file a new issue and have it “block” this one. Can use the api label. I am not sure offhand what the implementation might look like.

          Jesse Glick added a comment - Better to file a new issue and have it “block” this one. Can use the api label. I am not sure offhand what the implementation might look like.

          cowwoc added a comment -

          Filed JENKINS-19584. Please reopen this issue and add the necessary linking.

          cowwoc added a comment - Filed JENKINS-19584 . Please reopen this issue and add the necessary linking.

          rsandell added a comment -

          throwing a hudson.model.Failure should according to the docs display a more user friendly error page, but when I try that in my own plugin it just displays the oops page with full stacktrace anyways.

          rsandell added a comment - throwing a hudson.model.Failure should according to the docs display a more user friendly error page, but when I try that in my own plugin it just displays the oops page with full stacktrace anyways.

          Daniel Beck added a comment -

          rsandell Same behavior in core, the Failure thrown when you upload e.g. a PNG file to Plugin Manager also shows a stack trace.

          Daniel Beck added a comment - rsandell Same behavior in core, the Failure thrown when you upload e.g. a PNG file to Plugin Manager also shows a stack trace.

            jglick Jesse Glick
            cowwoc cowwoc
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: