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

Subversion polling does not work when the Repository URL contains a variable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • subversion-plugin
    • None
    • Windows Server 2008 R2
      Jenkins 1.634 or 1.625.1
      Subversion Plug-in 2.5.3

      In my repository URLs I use variables for specifying branches like

      http://subversion/svn/repos/${branch}/plugins/at.myplugin
      

      The variable is defined as environment variable in Manage Jenkins -> Configure System -> Global properties -> Environment variables

      This fails with Subversion Plugin > 2.4.5
      The last configuration that worked for me is Jenkins 1.580.3 and Subversion 2.4.5
      Checking out and building works fine.

      The error message in the polling log is:

      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
      

      When I define the whole URL in the variable it seems to trigger every time it checks - although there are no changes.
      The message in the polling log is:

      Started on 20.10.2015 18:25:00
      ERROR: Failed to check repository revision for ${testtest}
      org.tmatesoft.svn.core.SVNException: svn: E125002: Malformed URL '${testtest}'
      	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:227)
      	at org.tmatesoft.svn.core.SVNURL.parseURIEncoded(SVNURL.java:121)
      	at hudson.scm.SubversionSCM$ModuleLocation.getSVNURL(SubversionSCM.java:2760)
      	at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1366)
      	at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
      	at hudson.scm.SCM.poll(SCM.java:398)
      	at hudson.model.AbstractProject._poll(AbstractProject.java:1454)
      	at hudson.model.AbstractProject.poll(AbstractProject.java:1357)
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526)
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	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:744)
      Done. Took 1 ms
      Changes found
      

      The system log shows:

      Okt 20, 2015 6:36:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:36:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:36:00 PM INFO hudson.triggers.SCMTrigger$Runner run
      SCM changes detected in testtest. Triggering  #19
      Okt 20, 2015 6:36:09 PM INFO hudson.model.Run execute
      testtest #19 main build action completed: SUCCESS
      Okt 20, 2015 6:37:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:37:00 PM WARNING hudson.scm.SubversionSCM buildEnvVars
      no revision found corresponding to ${testtest}; known: [http://subversion/svn/repos_sw_tools/samples]
      Okt 20, 2015 6:37:00 PM INFO hudson.triggers.SCMTrigger$Runner run
      SCM changes detected in testtest. Triggering  #20
      Okt 20, 2015 6:37:09 PM INFO hudson.model.Run execute
      testtest #20 main build action completed: SUCCESS
      

          [JENKINS-31067] Subversion polling does not work when the Repository URL contains a variable

          Manuel Recena Soto added a comment - - edited

          chris_mh3, I've reproduce the bug:

          Subversion Polling Log

          Started on Oct 21, 2015 1:39:00 PM
          Workspace doesn't contain https://subversion.assembla.com/svn/${REPO}/trunk. Need a new build.
          Done. Took 1.2 sec
          Changes found
          

          The bug is related to Jenkins version. I reproduced using 1.625.1.

          Manuel Recena Soto added a comment - - edited chris_mh3 , I've reproduce the bug: Subversion Polling Log Started on Oct 21, 2015 1:39:00 PM Workspace doesn't contain https://subversion.assembla.com/svn/${REPO}/trunk. Need a new build. Done. Took 1.2 sec Changes found The bug is related to Jenkins version. I reproduced using 1.625.1 .

          chris_mh3 added a comment - - edited

          I did two fresh installs of jenkins one on our buildserver and one on my local machine (Windows 8). Both with the same result as previously.

          What I did:
          Downloaded jenkins.war

          • java -jar jenkins.war
          • Update all installed plugins to the latest version (2.5.3 for subversion)
          • Add the environment variable
          • Create a new project
          • Configure Subversion to use my path with the variable
          • Activate SVM Polling with * * * * *
          • Manually trigger a build - that worked
            The polling log again shows the same error

          Polling started to work after I switched the workspace version to 1.8 (form 1.4), installed the Environment Injector Plugin, wiped the projects workspace and disabled the job and enabled it again. It didn't start to work immediately on one instance of Jenkins - it needed a few polls.

          Started on 21.10.2015 14:03:00
          Received SCM poll call on master for test on 21.10.2015 14:03:00
          http://subversion/svn/repos_sw_tools/myProject/trunk/plugins/at.myPlugin is at revision 197.308
          Done. Took 40 ms
          No changes
          

          The command line still shows warnings though:

          Okt 21, 2015 2:04:00 PM hudson.scm.SubversionSCM buildEnvVars
          WARNUNG: no revision found corresponding to http://subversion/svn/repos_sw_tools/${branch}/plugins/at.myPlugin; known: [http://subversion/svn/repos_sw_tools/myProject/trunk/plugins/at.myPlugin]
          

          After reading the last comment: Jenkins is still 1.634

          chris_mh3 added a comment - - edited I did two fresh installs of jenkins one on our buildserver and one on my local machine (Windows 8). Both with the same result as previously. What I did: Downloaded jenkins.war java -jar jenkins.war Update all installed plugins to the latest version (2.5.3 for subversion) Add the environment variable Create a new project Configure Subversion to use my path with the variable Activate SVM Polling with * * * * * Manually trigger a build - that worked The polling log again shows the same error Polling started to work after I switched the workspace version to 1.8 (form 1.4), installed the Environment Injector Plugin, wiped the projects workspace and disabled the job and enabled it again. It didn't start to work immediately on one instance of Jenkins - it needed a few polls. Started on 21.10.2015 14:03:00 Received SCM poll call on master for test on 21.10.2015 14:03:00 http: //subversion/svn/repos_sw_tools/myProject/trunk/plugins/at.myPlugin is at revision 197.308 Done. Took 40 ms No changes The command line still shows warnings though: Okt 21, 2015 2:04:00 PM hudson.scm.SubversionSCM buildEnvVars WARNUNG: no revision found corresponding to http: //subversion/svn/repos_sw_tools/${branch}/plugins/at.myPlugin; known: [http://subversion/svn/repos_sw_tools/myProject/trunk/plugins/at.myPlugin] After reading the last comment: Jenkins is still 1.634

          chris_mh3, Thanks so much for your feedback. I think I have the bug reproduced. This is the first step.

          Manuel Recena Soto added a comment - chris_mh3 , Thanks so much for your feedback. I think I have the bug reproduced. This is the first step.

          chris_mh3, I've added a new PR. It would be nice if you can try it.

          Manuel Recena Soto added a comment - chris_mh3 , I've added a new PR . It would be nice if you can try it.

          chris_mh3 Did you have a chance to try it?

          Manuel Recena Soto added a comment - chris_mh3 Did you have a chance to try it?

          chris_mh3 added a comment -

          Looks good for me. Tested on our buildserver and my local jenkins (1.634) - works without the Environment Injector Plugin again.

          Thanks for the fix!

          chris_mh3 added a comment - Looks good for me. Tested on our buildserver and my local jenkins (1.634) - works without the Environment Injector Plugin again. Thanks for the fix!

          chris_mh3, thanks so much for your feedback. I've added a comment in the PR.

          I hope to cut a release soon. Probably, this week.

          Manuel Recena Soto added a comment - chris_mh3 , thanks so much for your feedback. I've added a comment in the PR. I hope to cut a release soon. Probably, this week.

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/subversion-plugin/bc590398fa23ef459aeb101de6fef6884ab24af0
          Log:
          JENKINS-31067 Global environment variables are not available on Subversion Polling

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/subversion-plugin/bc590398fa23ef459aeb101de6fef6884ab24af0 Log: JENKINS-31067 Global environment variables are not available on Subversion Polling

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/test/java/hudson/scm/SubversionEnvVarsTest.java
          http://jenkins-ci.org/commit/subversion-plugin/05f1b867e0d3080b26bbf9135d9f23cd050ef85f
          Log:
          JENKINS-31067 Added a test

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/test/java/hudson/scm/SubversionEnvVarsTest.java http://jenkins-ci.org/commit/subversion-plugin/05f1b867e0d3080b26bbf9135d9f23cd050ef85f Log: JENKINS-31067 Added a test

          Code changed in jenkins
          User: Manuel Recena
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          src/test/java/hudson/scm/SubversionEnvVarsTest.java
          http://jenkins-ci.org/commit/subversion-plugin/d5d3bb9b850190c3ad9968d403540d34efa94216
          Log:
          Merge pull request #139 from recena/JENKINS-31067

          JENKINS-31067 Global env vars are not available on SVN Polling

          Compare: https://github.com/jenkinsci/subversion-plugin/compare/5da9ddbcf8d7...d5d3bb9b8501

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/hudson/scm/SubversionSCM.java src/test/java/hudson/scm/SubversionEnvVarsTest.java http://jenkins-ci.org/commit/subversion-plugin/d5d3bb9b850190c3ad9968d403540d34efa94216 Log: Merge pull request #139 from recena/ JENKINS-31067 JENKINS-31067 Global env vars are not available on SVN Polling Compare: https://github.com/jenkinsci/subversion-plugin/compare/5da9ddbcf8d7...d5d3bb9b8501

            recena Manuel Recena Soto
            chris_mh3 chris_mh3
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: