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

Renaming a node over another is possible and destroys both configurations

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Software version: Jenkins ver. 1.635
      Possibly related plug-in: Windows Slaves Plugin
      Java version: 1.8.0_66
      Operating system: Windows Server 2008 R2

      When performing a node name rework, it is possible (partially?) overwrite a node with another one simply by renaming an existing node.

      Steps to reproduce:

      1. Create a node named foo
      2. Create another node named bar
      3. Go to the bar node configuration
      4. Rename it to foo and press Save

      Expected results:

      • An error message.

      Actual results:

      • Node bar replaces foo without any notice
      • Things start to behave wacky: build starts to fail without a reason (see attached edited log, Jenkins-BuildBreakageAfterNodeRename.txt

          [JENKINS-31321] Renaming a node over another is possible and destroys both configurations

          Christopher Simons added a comment - - edited

          When attempting to create a new node with the same name as an existing node (rather than editing), an error page is rendered with the message "Error: Slave called ‘foo’ already exists" and HTTP status 400. I'd propose throwing this same error upon trying to rename a node over another existing node.

          Fixed in PR #1949.

          Christopher Simons added a comment - - edited When attempting to create a new node with the same name as an existing node (rather than editing), an error page is rendered with the message "Error: Slave called ‘foo’ already exists" and HTTP status 400. I'd propose throwing this same error upon trying to rename a node over another existing node. Fixed in PR #1949 .

          Code changed in jenkins
          User: Christopher Simons
          Path:
          core/src/main/java/hudson/model/Computer.java
          test/src/test/java/hudson/model/ComputerTest.java
          http://jenkins-ci.org/commit/jenkins/16d6429c58400b18350c42280ac541a6322ac8f3
          Log:
          [FIXED JENKINS-31321] protect against node-rename corruption

          This change adds code to check that the user isn't attempting to rename
          an existing node with the name of another existing node. Previous to
          this change, such rename operations would succeed and would corrupt node
          configuration data.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Simons Path: core/src/main/java/hudson/model/Computer.java test/src/test/java/hudson/model/ComputerTest.java http://jenkins-ci.org/commit/jenkins/16d6429c58400b18350c42280ac541a6322ac8f3 Log: [FIXED JENKINS-31321] protect against node-rename corruption This change adds code to check that the user isn't attempting to rename an existing node with the name of another existing node. Previous to this change, such rename operations would succeed and would corrupt node configuration data.

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/Computer.java
          test/src/test/java/hudson/model/ComputerTest.java
          http://jenkins-ci.org/commit/jenkins/ad5b2d12a6674a827d1ce3b8cf8c7493626ab586
          Log:
          Merge pull request #1949 from csimons/prohibit-rename-node-to-existing

          [FIXED JENKINS-31321] protect against node-rename corruption

          Compare: https://github.com/jenkinsci/jenkins/compare/068c09f21afa...ad5b2d12a667

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/Computer.java test/src/test/java/hudson/model/ComputerTest.java http://jenkins-ci.org/commit/jenkins/ad5b2d12a6674a827d1ce3b8cf8c7493626ab586 Log: Merge pull request #1949 from csimons/prohibit-rename-node-to-existing [FIXED JENKINS-31321] protect against node-rename corruption Compare: https://github.com/jenkinsci/jenkins/compare/068c09f21afa...ad5b2d12a667

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4408
          [FIXED JENKINS-31321] protect against node-rename corruption (Revision 16d6429c58400b18350c42280ac541a6322ac8f3)

          Result = UNSTABLE
          christopherleesimons : 16d6429c58400b18350c42280ac541a6322ac8f3
          Files :

          • test/src/test/java/hudson/model/ComputerTest.java
          • core/src/main/java/hudson/model/Computer.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4408 [FIXED JENKINS-31321] protect against node-rename corruption (Revision 16d6429c58400b18350c42280ac541a6322ac8f3) Result = UNSTABLE christopherleesimons : 16d6429c58400b18350c42280ac541a6322ac8f3 Files : test/src/test/java/hudson/model/ComputerTest.java core/src/main/java/hudson/model/Computer.java

          dogfood added a comment -

          Integrated in jenkins_2.0 #5
          [FIXED JENKINS-31321] protect against node-rename corruption (Revision 16d6429c58400b18350c42280ac541a6322ac8f3)

          Result = SUCCESS
          christopherleesimons : 16d6429c58400b18350c42280ac541a6322ac8f3
          Files :

          • test/src/test/java/hudson/model/ComputerTest.java
          • core/src/main/java/hudson/model/Computer.java

          dogfood added a comment - Integrated in jenkins_2.0 #5 [FIXED JENKINS-31321] protect against node-rename corruption (Revision 16d6429c58400b18350c42280ac541a6322ac8f3) Result = SUCCESS christopherleesimons : 16d6429c58400b18350c42280ac541a6322ac8f3 Files : test/src/test/java/hudson/model/ComputerTest.java core/src/main/java/hudson/model/Computer.java

          Code changed in jenkins
          User: Christopher Simons
          Path:
          core/src/main/java/hudson/model/Computer.java
          test/src/test/java/hudson/model/ComputerTest.java
          http://jenkins-ci.org/commit/jenkins/df2b7d97ad8018d8fc4929b8a24bc8bcbfb90926
          Log:
          [FIXED JENKINS-31321] protect against node-rename corruption

          This change adds code to check that the user isn't attempting to rename
          an existing node with the name of another existing node. Previous to
          this change, such rename operations would succeed and would corrupt node
          configuration data.

          (cherry picked from commit 16d6429c58400b18350c42280ac541a6322ac8f3)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Simons Path: core/src/main/java/hudson/model/Computer.java test/src/test/java/hudson/model/ComputerTest.java http://jenkins-ci.org/commit/jenkins/df2b7d97ad8018d8fc4929b8a24bc8bcbfb90926 Log: [FIXED JENKINS-31321] protect against node-rename corruption This change adds code to check that the user isn't attempting to rename an existing node with the name of another existing node. Previous to this change, such rename operations would succeed and would corrupt node configuration data. (cherry picked from commit 16d6429c58400b18350c42280ac541a6322ac8f3)

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4450
          [FIXED JENKINS-31321] protect against node-rename corruption (Revision df2b7d97ad8018d8fc4929b8a24bc8bcbfb90926)

          Result = SUCCESS
          ogondza : df2b7d97ad8018d8fc4929b8a24bc8bcbfb90926
          Files :

          • core/src/main/java/hudson/model/Computer.java
          • test/src/test/java/hudson/model/ComputerTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4450 [FIXED JENKINS-31321] protect against node-rename corruption (Revision df2b7d97ad8018d8fc4929b8a24bc8bcbfb90926) Result = SUCCESS ogondza : df2b7d97ad8018d8fc4929b8a24bc8bcbfb90926 Files : core/src/main/java/hudson/model/Computer.java test/src/test/java/hudson/model/ComputerTest.java

            csimons Christopher Simons
            heldermagalhaes Helder Magalhães
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: