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

Exception thrown when using variable in Mercurial Repo URL

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • mercurial-plugin
    • None
    • Mercurial Plugin 1.51, Jenkins 1.598, Tomcat 7.0.54, RHEL6.5

      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)
      

          [JENKINS-27316] Exception thrown when using variable in Mercurial Repo URL

          Kyle Leinen added a comment -

          Your assumption is correct. SCM polling is not enabled in this job.

          The job in question does not participate in polling as it is a "one-off" job, which uses Mercurial's distributed nature to harness our Jenkins instance's processing power for building changesets that are on a developer's local machine and not necessarily on the central Mercurial server.

          Kyle Leinen added a comment - Your assumption is correct. SCM polling is not enabled in this job. The job in question does not participate in polling as it is a "one-off" job, which uses Mercurial's distributed nature to harness our Jenkins instance's processing power for building changesets that are on a developer's local machine and not necessarily on the central Mercurial server.

          Jesse Glick added a comment -

          https://wiki.jenkins-ci.org/display/JENKINS/Pretested+Integration+Plugin might be helpful to you. It used to be integrated with the Mercurial plugin. That was apparently split off into a separate plugin, but I do not know where that went! ref.: https://github.com/jenkinsci/pretested-integration-plugin/commit/b2bab1d8614294d11e02f92c4dd47257aa689f09

          Jesse Glick added a comment - https://wiki.jenkins-ci.org/display/JENKINS/Pretested+Integration+Plugin might be helpful to you. It used to be integrated with the Mercurial plugin. That was apparently split off into a separate plugin, but I do not know where that went! ref.: https://github.com/jenkinsci/pretested-integration-plugin/commit/b2bab1d8614294d11e02f92c4dd47257aa689f09

          Kyle Leinen added a comment -

          Looks like a really cool plugin, but it never mentions supporting Mercurial, only Git. Not sure it will work for our workflow as the changes being requested for build are not necessarily being integrated. Some of them are engineering or experimental "try-this" changes.

          Kyle Leinen added a comment - Looks like a really cool plugin, but it never mentions supporting Mercurial, only Git. Not sure it will work for our workflow as the changes being requested for build are not necessarily being integrated. Some of them are engineering or experimental "try-this" changes.

          Jesse Glick added a comment -

          Anyway according to https://github.com/jenkinsci/pretested-integration-plugin/commit/b2bab1d8614294d11e02f92c4dd47257aa689f09#commitcomment-10395601 the Mercurial support was abandoned, too bad.

          You may be able to set up projects using a plugin depending on the Multi-Branch API plugin, which supports Mercurial. Thus if you pushed feature branches to your repo, they would automatically get their own subprojects with independent build history, and full polling support.

          Jesse Glick added a comment - Anyway according to https://github.com/jenkinsci/pretested-integration-plugin/commit/b2bab1d8614294d11e02f92c4dd47257aa689f09#commitcomment-10395601 the Mercurial support was abandoned, too bad. You may be able to set up projects using a plugin depending on the Multi-Branch API plugin, which supports Mercurial. Thus if you pushed feature branches to your repo, they would automatically get their own subprojects with independent build history, and full polling support.

          Kyle Leinen added a comment -

          We currently managed all of our feature branches through the usage of our Job DSL scripting (which we are peeking at the Workflow plugin set for a next revision of that). What our one-off jobs allow for is to have changesets built that don't exist on our central server. This allows for developers to get some CI system time on their changeset without having to create a specific branch and job for their feature. Just to give a view of scale here, if we had to create a branch build for every story we have in flight, we would have over 200 branch build for just one of our projects. Currently we restrict our branch builds to project teams, which still is around 30.

          Anyways, if being able to "hide" or disable this warning is difficult or not in the direction you want to take, no worries there. We have been thinking of writing a script that parses out and removes that warning from the logs via a cron script. That way it can still be generated but we can throw it away since it is noise for us, but maybe not for others.

          Kyle Leinen added a comment - We currently managed all of our feature branches through the usage of our Job DSL scripting (which we are peeking at the Workflow plugin set for a next revision of that). What our one-off jobs allow for is to have changesets built that don't exist on our central server. This allows for developers to get some CI system time on their changeset without having to create a specific branch and job for their feature. Just to give a view of scale here, if we had to create a branch build for every story we have in flight, we would have over 200 branch build for just one of our projects. Currently we restrict our branch builds to project teams, which still is around 30. Anyways, if being able to "hide" or disable this warning is difficult or not in the direction you want to take, no worries there. We have been thinking of writing a script that parses out and removes that warning from the logs via a cron script. That way it can still be generated but we can throw it away since it is noise for us, but maybe not for others.

          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.

          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.

          Steve McClellan added a comment - Pull request: https://github.com/jenkinsci/mercurial-plugin/pull/68

          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!

          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!

          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.

          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.

          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

          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

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

              Created:
              Updated:
              Resolved: