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

Posting config.xml to master node advertised to work

      The POST action of config.xml to /computer on 'master' node doesn't work.
      If I go to "/computer/(master)/api" page, it says that the config.xml can be fetched and updated but it doesn't work that way.

      I just took a look at the code and it looks like the "replaceBy(Node newNode)" function on "core/src/main/java/hudson/model/Computer.java" uses the "getNodes()" function defined in "core/src/main/java/jenkins/model/Jenkins.java" which returns only the slaves and NOT the master. Is it an expected behavior? Shouldn't we be able to POST config.xml to master node? It has a lot of options that can be customized and posting the config.xml will help greatly.

          [JENKINS-16264] Posting config.xml to master node advertised to work

          Jesse Glick added a comment -

          @damong I am not sure why you expect token to be usable in a query string like this. You API token is to be used for HTTP BASIC authentication. Take it to the user list.

          Jesse Glick added a comment - @damong I am not sure why you expect token to be usable in a query string like this. You API token is to be used for HTTP BASIC authentication. Take it to the user list.

          I agree with @jesse. Also the 403 looks like it is because you have the CSRF enabled on your server and you are not sending the crumb.

          Kannan Manickam added a comment - I agree with @jesse. Also the 403 looks like it is because you have the CSRF enabled on your server and you are not sending the crumb.

          Damon G added a comment -

          So sorry. I must have misunderstood the wiki. I removed the token part of the query string and it worked! Thanks so much.

          Damon G added a comment - So sorry. I must have misunderstood the wiki. I removed the token part of the query string and it worked! Thanks so much.

          Damon G added a comment -

          I have to take that comment back. It doesn't work. I thought it was working because my attempt above used cashed credentials I had open in another browser tab. I don't have CSRF enabled. I'll take it to the forums though.

          Damon G added a comment - I have to take that comment back. It doesn't work. I thought it was working because my attempt above used cashed credentials I had open in another browser tab. I don't have CSRF enabled. I'll take it to the forums though.

          Daniel Beck added a comment -

          Daniel Beck added a comment - https://github.com/jenkinsci/jenkins/pull/1258

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly
          http://jenkins-ci.org/commit/jenkins/af67ae868e0d150e4d73e48a301c831bc2732b0c
          Log:
          [FIX JENKINS-16264] Don't advertise POSTing config.xml on master

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly http://jenkins-ci.org/commit/jenkins/af67ae868e0d150e4d73e48a301c831bc2732b0c Log: [FIX JENKINS-16264] Don't advertise POSTing config.xml on master

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly
          http://jenkins-ci.org/commit/jenkins/bdfcd2625381e3e9153c1de5ead82abe96ab1c16
          Log:
          Merge pull request #1258 from daniel-beck/JENKINS-16264

          [FIX JENKINS-16264] Don't advertise POSTing config.xml on master

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly http://jenkins-ci.org/commit/jenkins/bdfcd2625381e3e9153c1de5ead82abe96ab1c16 Log: Merge pull request #1258 from daniel-beck/ JENKINS-16264 [FIX JENKINS-16264] Don't advertise POSTing config.xml on master

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3424
          [FIX JENKINS-16264] Don't advertise POSTing config.xml on master (Revision af67ae868e0d150e4d73e48a301c831bc2732b0c)

          Result = SUCCESS
          daniel-beck : af67ae868e0d150e4d73e48a301c831bc2732b0c
          Files :

          • core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly

          dogfood added a comment - Integrated in jenkins_main_trunk #3424 [FIX JENKINS-16264] Don't advertise POSTing config.xml on master (Revision af67ae868e0d150e4d73e48a301c831bc2732b0c) Result = SUCCESS daniel-beck : af67ae868e0d150e4d73e48a301c831bc2732b0c Files : core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly

          Daniel Beck added a comment -

          Bot seems to not have picked up the change.

          It's no longer being advertised to work.

          File a feature request if you want to be able to do this.

          Daniel Beck added a comment - Bot seems to not have picked up the change. It's no longer being advertised to work. File a feature request if you want to be able to do this.

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly
          http://jenkins-ci.org/commit/jenkins/0a102cddd72f634f6ded56863d6b31befaa4d969
          Log:
          [FIX JENKINS-16264] Don't advertise POSTing config.xml on master

          (cherry picked from commit af67ae868e0d150e4d73e48a301c831bc2732b0c)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/resources/jenkins/model/Jenkins/MasterComputer/_api.jelly http://jenkins-ci.org/commit/jenkins/0a102cddd72f634f6ded56863d6b31befaa4d969 Log: [FIX JENKINS-16264] Don't advertise POSTing config.xml on master (cherry picked from commit af67ae868e0d150e4d73e48a301c831bc2732b0c)

            danielbeck Daniel Beck
            arangamani Kannan Manickam
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: