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

Subversion polling not work when Repository URL value is variable - E125002: Malformed URL '${SVN_REPO_VARIABLE}'

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • subversion-plugin
    • CentOS 6 64bit master

      Jenkins ver. 1.558

      subversion plugin: 2.2
      credentials plugin: 1.10

      When I set Repository URL as variable instead of direct url(please see attachment), polling is not working. Checkout and update are working fine.

      Apr 10, 2014 10:03:17 AM hudson.scm.SubversionSCM$DescriptorImpl doCheckRevisionPropertiesSupported
      INFO: Failed to access subversion repository ${SVN_REPO}
      org.tmatesoft.svn.core.SVNException: svn: E125002: Malformed URL '${SVN_REPO}'
      at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
      at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
      at org.tmatesoft.svn.core.SVNURL.<init>(SVNURL.java:233)
      at org.tmatesoft.svn.core.SVNURL.parseURIDecoded(SVNURL.java:115)
      at hudson.scm.SubversionSCM$DescriptorImpl.doCheckRevisionPropertiesSupported(SubversionSCM.java:2185)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)

      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)
      Caused by: svn: E125002: Malformed URL '${SVN_REPO}'
      at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:171)
      at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:126)
      at org.tmatesoft.svn.core.SVNURL.<init>(SVNURL.java:232)
      ... 94 more

          [JENKINS-22568] Subversion polling not work when Repository URL value is variable - E125002: Malformed URL '${SVN_REPO_VARIABLE}'

          I wrote a test unit to confirm that this is still an issue:
          https://gist.github.com/christ66/1279fbb8aff7f6369d3e

          Steven Christou added a comment - I wrote a test unit to confirm that this is still an issue: https://gist.github.com/christ66/1279fbb8aff7f6369d3e

          Steven Christou added a comment - I created https://github.com/jenkinsci/subversion-plugin/pull/89 to resolve this issue.

          Code changed in jenkins
          User: christ66
          Path:
          src/test/java/hudson/scm/SubversionSCMTest.java
          http://jenkins-ci.org/commit/subversion-plugin/611dedc5beeaee8dd4f066c13892ad46f5d2b8ee
          Log:
          JENKINS-22568 Added test unit to show that default parameter values do not get expanded for polling.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/test/java/hudson/scm/SubversionSCMTest.java http://jenkins-ci.org/commit/subversion-plugin/611dedc5beeaee8dd4f066c13892ad46f5d2b8ee Log: JENKINS-22568 Added test unit to show that default parameter values do not get expanded for polling.

          Code changed in jenkins
          User: christ66
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          src/test/java/hudson/scm/SubversionSCMTest.java
          http://jenkins-ci.org/commit/subversion-plugin/a6292d4b8d222e3fcb9d4914f4320523374e4472
          Log:
          [FIXED JENKINS-22568] Subversion polling does not work with parameters.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/main/java/hudson/scm/SubversionSCM.java src/test/java/hudson/scm/SubversionSCMTest.java http://jenkins-ci.org/commit/subversion-plugin/a6292d4b8d222e3fcb9d4914f4320523374e4472 Log: [FIXED JENKINS-22568] Subversion polling does not work with parameters.

          Code changed in jenkins
          User: christ66
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/subversion-plugin/9affb650b0fcd68d213e1c064adb5f453205b6aa
          Log:
          [FIXED JENKINS-22568] Backwards compatible fix.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/subversion-plugin/9affb650b0fcd68d213e1c064adb5f453205b6aa Log: [FIXED JENKINS-22568] Backwards compatible fix.

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          src/test/java/hudson/scm/SubversionSCMTest.java
          http://jenkins-ci.org/commit/subversion-plugin/396837b69f1e9b240196609acabebf9f1ec2f225
          Log:
          Merge pull request #89 from christ66/JENKINS-22568

          [FIXED JENKINS-22568] Subversion polling does not work with parameters.

          Compare: https://github.com/jenkinsci/subversion-plugin/compare/7fecc427c206...396837b69f1e

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/hudson/scm/SubversionSCM.java src/test/java/hudson/scm/SubversionSCMTest.java http://jenkins-ci.org/commit/subversion-plugin/396837b69f1e9b240196609acabebf9f1ec2f225 Log: Merge pull request #89 from christ66/ JENKINS-22568 [FIXED JENKINS-22568] Subversion polling does not work with parameters. Compare: https://github.com/jenkinsci/subversion-plugin/compare/7fecc427c206...396837b69f1e

          Code changed in jenkins
          User: christ66
          Path:
          src/test/java/hudson/scm/SubversionSCMTest.java
          http://jenkins-ci.org/commit/subversion-plugin/7d8a61febbb9b83e536a168e4f3e08013b747445
          Log:
          JENKINS-22568 Added test unit to show that default parameter values do not get expanded for polling.

          (cherry picked from commit 611dedc5beeaee8dd4f066c13892ad46f5d2b8ee)

          Conflicts:
          src/test/java/hudson/scm/SubversionSCMTest.java

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/test/java/hudson/scm/SubversionSCMTest.java http://jenkins-ci.org/commit/subversion-plugin/7d8a61febbb9b83e536a168e4f3e08013b747445 Log: JENKINS-22568 Added test unit to show that default parameter values do not get expanded for polling. (cherry picked from commit 611dedc5beeaee8dd4f066c13892ad46f5d2b8ee) Conflicts: src/test/java/hudson/scm/SubversionSCMTest.java

          Code changed in jenkins
          User: christ66
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          src/test/java/hudson/scm/SubversionSCMTest.java
          http://jenkins-ci.org/commit/subversion-plugin/c6b1bacd211ad91def256fb5299b25e07e0616fc
          Log:
          [FIXED JENKINS-22568] Subversion polling does not work with parameters.

          (cherry picked from commit a6292d4b8d222e3fcb9d4914f4320523374e4472)

          Conflicts:
          src/main/java/hudson/scm/SubversionSCM.java
          (Original patch used ParameterValue.getValue, which is 1.568+. Switched to StringParameterValue.value.)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/main/java/hudson/scm/SubversionSCM.java src/test/java/hudson/scm/SubversionSCMTest.java http://jenkins-ci.org/commit/subversion-plugin/c6b1bacd211ad91def256fb5299b25e07e0616fc Log: [FIXED JENKINS-22568] Subversion polling does not work with parameters. (cherry picked from commit a6292d4b8d222e3fcb9d4914f4320523374e4472) Conflicts: src/main/java/hudson/scm/SubversionSCM.java (Original patch used ParameterValue.getValue, which is 1.568+. Switched to StringParameterValue.value.)

          Code changed in jenkins
          User: christ66
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/subversion-plugin/c2f5764ac073916dd0f9a9ec64b4d6c3106af219
          Log:
          [FIXED JENKINS-22568] Backwards compatible fix.

          (cherry picked from commit 9affb650b0fcd68d213e1c064adb5f453205b6aa)

          Conflicts:
          src/main/java/hudson/scm/SubversionSCM.java
          (Switching to the master version of ParameterValue logic, throwing out merge resolution from prior commit.)

          Compare: https://github.com/jenkinsci/subversion-plugin/compare/07d6177a0914^...c2f5764ac073

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/subversion-plugin/c2f5764ac073916dd0f9a9ec64b4d6c3106af219 Log: [FIXED JENKINS-22568] Backwards compatible fix. (cherry picked from commit 9affb650b0fcd68d213e1c064adb5f453205b6aa) Conflicts: src/main/java/hudson/scm/SubversionSCM.java (Switching to the master version of ParameterValue logic, throwing out merge resolution from prior commit.) Compare: https://github.com/jenkinsci/subversion-plugin/compare/07d6177a0914 ^...c2f5764ac073

          Nick Brown added a comment -

          As requested re-opening this issue.

          I defined a variable in the Environment Inject plugin (https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin)

          VAR=https://PRETEND_URL.com

          In the SCM 'Repository URL' box I have tried using ${VAR} and $VAR but neither works:

          ERROR: Failed to check repository revision for $VAR
          org.tmatesoft.svn.core.SVNException: svn: E125002: Malformed URL '$VAR'

          However if I use this '$VAR' I get some success but then it rejects the "'":

          ERROR: Failed to check repository revision for 'https://PRETEND_URL.com'
          org.tmatesoft.svn.core.SVNException: svn: E125002: URL protocol is not supported ''https://PRETEND_URL.com''

          (Please note I did try it with a genuine URL but have altered it for security here)

          So it looks like it needs to be surrounded in single quotes to resolve but then the URL is not well formed...

          Nick Brown added a comment - As requested re-opening this issue. I defined a variable in the Environment Inject plugin ( https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin ) VAR= https://PRETEND_URL.com In the SCM 'Repository URL' box I have tried using ${VAR} and $VAR but neither works: ERROR: Failed to check repository revision for $VAR org.tmatesoft.svn.core.SVNException: svn: E125002: Malformed URL '$VAR' However if I use this '$VAR' I get some success but then it rejects the "'": ERROR: Failed to check repository revision for 'https://PRETEND_URL.com' org.tmatesoft.svn.core.SVNException: svn: E125002: URL protocol is not supported ''https://PRETEND_URL.com'' (Please note I did try it with a genuine URL but have altered it for security here) So it looks like it needs to be surrounded in single quotes to resolve but then the URL is not well formed...

          demonick The fix for this issue was specifically for parameterized builds, and not the envinject plugin.

          Steven Christou added a comment - demonick The fix for this issue was specifically for parameterized builds, and not the envinject plugin.

          Ralf Mühle added a comment -

          possible fixed with JENKINS-23007

          Ralf Mühle added a comment - possible fixed with JENKINS-23007

          Daniel Beck added a comment -

          Env-Inject adds variables to the build environment. These are unavailable during polling. So it's no surprise if that doesn't work. Workarounds are to reuse previous build's environment or something like that, which can have insane side effects.

          Daniel Beck added a comment - Env-Inject adds variables to the build environment. These are unavailable during polling . So it's no surprise if that doesn't work. Workarounds are to reuse previous build's environment or something like that, which can have insane side effects.

          @Daniel: very good hint to understand the problem.

          The behaviour is also documented with the Env-Inject plugin. As a workaround I use now the URL-Trigger included with XTrigger plugin (option Check the last modification Date). XTrigger reuses previous builds environment with the described side effects and I can live with that.
          With version 1.5.4 of the subversion plugin I also had the desired behaviour but now I have to use the newest subversion plugin version to use svn 1.8 working copies.

          What about introducing a checkbox "reuse previous environment for polling" with the subversion plugin?

          Heiner Tittelbach added a comment - @Daniel: very good hint to understand the problem. The behaviour is also documented with the Env-Inject plugin. As a workaround I use now the URL-Trigger included with XTrigger plugin (option Check the last modification Date). XTrigger reuses previous builds environment with the described side effects and I can live with that. With version 1.5.4 of the subversion plugin I also had the desired behaviour but now I have to use the newest subversion plugin version to use svn 1.8 working copies. What about introducing a checkbox "reuse previous environment for polling" with the subversion plugin?

          Tim Bradt added a comment -

          Also does not work in Subversion plugin 2.5 when defining the variables in global properties. This is already linked to JENKINS-22922 which spells that out.

          Tim Bradt added a comment - Also does not work in Subversion plugin 2.5 when defining the variables in global properties. This is already linked to JENKINS-22922 which spells that out.

          Ralf Mühle added a comment - - edited

          possible workaround:

          • define global variable (for example: SVN_REPO)
          • in job use "a text parameter" and set default to global variable, variable name must be different to global variable (for example SVN_REPO2)
          • in svn url use the variable from "text parameter" (SVN_REPO2)

          doesn't work

          Ralf Mühle added a comment - - edited possible workaround: define global variable (for example: SVN_REPO) in job use "a text parameter" and set default to global variable, variable name must be different to global variable (for example SVN_REPO2) in svn url use the variable from "text parameter" (SVN_REPO2) doesn't work

          Tim Bradt added a comment -

          I figured that would be the case. The problem appears to be that the plug in does not expand variables, and I doubted it mattered where they originated.

          Tim Bradt added a comment - I figured that would be the case. The problem appears to be that the plug in does not expand variables, and I doubted it mattered where they originated.

          Again marking this issue as solved. The initial fix for this was the parameterized build not obtaining the proper environment variables while polling. The envinject plugin version of this issue can be found in JENKINS-22922.

          Steven Christou added a comment - Again marking this issue as solved. The initial fix for this was the parameterized build not obtaining the proper environment variables while polling. The envinject plugin version of this issue can be found in JENKINS-22922 .

          Tim Bradt added a comment -

          Confirmed. Updated to 2.5.2 and confirmed that polling with a variable URL works.

          Tim Bradt added a comment - Confirmed. Updated to 2.5.2 and confirmed that polling with a variable URL works.

          Manuel Recena Soto added a comment - - edited

          tpbradt Thanks so much for your feedback. It is very important to receive feedback when a bug is solved.

          Manuel Recena Soto added a comment - - edited tpbradt Thanks so much for your feedback. It is very important to receive feedback when a bug is solved.

          chris_mh3 added a comment - - edited

          Unfortunatly this still does not work for me.

          From the Subverion Polling Log:

          Started on 20.10.2015 15:14:00
          Location 'http://subversion/svn/repos/${branch}/plugins/at.myplugin' does not exist
          One or more repository locations do not exist anymore for hudson.model.FreeStyleProject@78dd0b8f[MyProject], project will be disabled.
          The project has been disabled
          Done. Took 0,1 sec
          No changes
          

          branch is defined as evironment variable in the jenkins configuration.
          Subversion Plug-in 2.5.3
          Jenkins 1.634 and 1.625.1

          It works with Jenkins 1.580.3 and Subversion 2.4.5

          chris_mh3 added a comment - - edited Unfortunatly this still does not work for me. From the Subverion Polling Log: Started on 20.10.2015 15:14:00 Location 'http: //subversion/svn/repos/${branch}/plugins/at.myplugin' does not exist One or more repository locations do not exist anymore for hudson.model.FreeStyleProject@78dd0b8f[MyProject], project will be disabled. The project has been disabled Done. Took 0,1 sec No changes branch is defined as evironment variable in the jenkins configuration. Subversion Plug-in 2.5.3 Jenkins 1.634 and 1.625.1 It works with Jenkins 1.580.3 and Subversion 2.4.5

          Daniel Beck added a comment -

          chris_mh3 Please provide more details, where/how specifically is the branch variable defined?

          Daniel Beck added a comment - chris_mh3 Please provide more details, where/how specifically is the branch variable defined?

          @chris_mh3,

          I received feedback from several users confirming that this bug is solved. I prefer to close this issue and open new one with new information.

          Regards,

          Manuel Recena Soto added a comment - @chris_mh3, I received feedback from several users confirming that this bug is solved. I prefer to close this issue and open new one with new information. Regards,

          chris_mh3 added a comment - - edited

          the branch variable is defined in Manage Jenkins -> Configure System -> Global properties -> Environment variables

          chris_mh3 added a comment - - edited the branch variable is defined in Manage Jenkins -> Configure System -> Global properties -> Environment variables

          chris_mh3 Could you add a new ticket, please?

          Manuel Recena Soto added a comment - chris_mh3 Could you add a new ticket, please?

          chris_mh3 added a comment -

          chris_mh3 added a comment - JENKINS-31067

          chris_mh3, Thank you.

          Manuel Recena Soto added a comment - chris_mh3 , Thank you.

            recena Manuel Recena Soto
            dilyin Denis Ilyin
            Votes:
            5 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: