Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27316

Exception thrown when using variable in Mercurial Repo URL

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
      Mercurial Plugin 1.51, Jenkins 1.598, Tomcat 7.0.54, RHEL6.5
    • Similar Issues:

      Description

      We have one-off jobs configured to allow for building of changesets from a user's local repository, which means that the repo URL is not a static entity, but instead a parameter to the job. We also have jobs that are triggered to poll for changes by our Hg server.

      This works great, except that the url setting's value does not interact well with the polling functionality of the Mercurial plugin. Everytime our Hg server tells Jenkins to poll for changes, all of our one-off configurations throw exceptions to the jenkins log that look like the following:

      Mar 10, 2015 10:43:46 AM hudson.plugins.mercurial.MercurialStatus handleNotifyCommit
      INFO: for foocomponent.wr5-arm: http://scm.foocompany.com/hg/foocomponent/ vs. ${REP
      O_URL}
      Mar 10, 2015 10:43:46 AM hudson.plugins.mercurial.MercurialStatus looselyMatches
      SEVERE: could not parse repository uri ${REPO_URL}
      java.net.URISyntaxException: Illegal character in path at index 1: ${REPO_URL}
              at java.net.URI$Parser.fail(Unknown Source)
              at java.net.URI$Parser.checkChars(Unknown Source)
              at java.net.URI$Parser.parseHierarchical(Unknown Source)
              at java.net.URI$Parser.parse(Unknown Source)
              at java.net.URI.<init>(Unknown Source)
              at hudson.plugins.mercurial.MercurialStatus.looselyMatches(MercurialStatus.java:60)
              at hudson.plugins.mercurial.MercurialStatus.handleNotifyCommit(MercurialStatus.java:105)
              at hudson.plugins.mercurial.MercurialStatus.doNotifyCommit(MercurialStatus.java:75)
              at sun.reflect.GeneratedMethodAccessor4421.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:298)
              at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
              at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
              at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
              at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:391)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
              at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
              at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:95)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
              at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
              at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:198)
              at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:176)
              at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:85)
              at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:99)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
              at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              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:135)
              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 jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
              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 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          we are peeking at the Workflow plugin set for a next revision of that

          Workflow is not a substitute for Job DSL. They are more or less orthogonal.

          changesets built that don't exist on our central server

          This is something that could be supported as a “branch source” in the Multi-Branch API, I think. (For example, the Git implementation has support for pull requests, which are hosted in a distinct repository.) Someone needs to write that branch source but I think it is a relatively minor exercise—the API does not require in-depth Jenkins plugin expertise.

          if we had to create a branch build

          That is the point of the Multi-Branch API: the creation of the subprojects (and their “garbage collection”) is automated.

          difficult or not in the direction you want to take

          No, this is a valid bug report, I was just offering tangential suggestions based on your use case. I am not promising to implement it (assuming you are not a CloudBees support customer), but a pull request would be welcome.

          Show
          jglick Jesse Glick added a comment - we are peeking at the Workflow plugin set for a next revision of that Workflow is not a substitute for Job DSL. They are more or less orthogonal. changesets built that don't exist on our central server This is something that could be supported as a “branch source” in the Multi-Branch API, I think. (For example, the Git implementation has support for pull requests, which are hosted in a distinct repository.) Someone needs to write that branch source but I think it is a relatively minor exercise—the API does not require in-depth Jenkins plugin expertise. if we had to create a branch build That is the point of the Multi-Branch API: the creation of the subprojects (and their “garbage collection”) is automated. difficult or not in the direction you want to take No, this is a valid bug report, I was just offering tangential suggestions based on your use case. I am not promising to implement it (assuming you are not a CloudBees support customer), but a pull request would be welcome.
          Show
          stevem Steve McClellan added a comment - Pull request: https://github.com/jenkinsci/mercurial-plugin/pull/68
          Hide
          stevem Steve McClellan added a comment -

          We deployed https://jenkins.ci.cloudbees.com/job/plugins/job/mercurial-plugin/165/org.jenkins-ci.plugins$mercurial/ to our ci-cert system and verified it resolved the excessive logging issue. What is the status of merging https://github.com/jenkinsci/mercurial-plugin/pull/68? Thanks!

          Show
          stevem Steve McClellan added a comment - We deployed https://jenkins.ci.cloudbees.com/job/plugins/job/mercurial-plugin/165/org.jenkins-ci.plugins$mercurial/ to our ci-cert system and verified it resolved the excessive logging issue. What is the status of merging https://github.com/jenkinsci/mercurial-plugin/pull/68? Thanks!
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Steve McClellan
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialStatus.java
          src/test/java/hudson/plugins/mercurial/MercurialStatusTest.java
          http://jenkins-ci.org/commit/mercurial-plugin/dc23cfe5628492acddd6823534b309efa2ea1b24
          Log:
          [FIXED JENKINS-27316] Remove excessive stack traces in log
          Using an environment variable in an Mercurial Repo parameter filled the error log with excessive stack traces, in spite of the parameter being valid for passing on to child jobs.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Steve McClellan Path: src/main/java/hudson/plugins/mercurial/MercurialStatus.java src/test/java/hudson/plugins/mercurial/MercurialStatusTest.java http://jenkins-ci.org/commit/mercurial-plugin/dc23cfe5628492acddd6823534b309efa2ea1b24 Log: [FIXED JENKINS-27316] Remove excessive stack traces in log Using an environment variable in an Mercurial Repo parameter filled the error log with excessive stack traces, in spite of the parameter being valid for passing on to child jobs.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialStatus.java
          src/test/java/hudson/plugins/mercurial/MercurialStatusTest.java
          http://jenkins-ci.org/commit/mercurial-plugin/e21525c917a7b1cc2152299b423b417ec7a9fd2e
          Log:
          Merge pull request #68 from mcclellansws/master

          [FIXED JENKINS-27316] Remove excessive stack traces in log

          Compare: https://github.com/jenkinsci/mercurial-plugin/compare/88c2c0cbff4f...e21525c917a7

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/MercurialStatus.java src/test/java/hudson/plugins/mercurial/MercurialStatusTest.java http://jenkins-ci.org/commit/mercurial-plugin/e21525c917a7b1cc2152299b423b417ec7a9fd2e Log: Merge pull request #68 from mcclellansws/master [FIXED JENKINS-27316] Remove excessive stack traces in log Compare: https://github.com/jenkinsci/mercurial-plugin/compare/88c2c0cbff4f...e21525c917a7

            People

            • Assignee:
              jglick Jesse Glick
              Reporter:
              kmleinen Kyle Leinen
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: