We have more than 10 Jenkins servers and the job import plugin doesn't appear to work in any when clicking on "Query!". I see the page only reloads back to the same. Below is the error i see from the System Log. Here the scenario is we inform the users to use this plugin whenever they need to move jobs to another Jenkins.

       

      Feb 22, 2022 6:03:45 AM SEVERE org.jenkins.ci.plugins.jobimport.client.RestApiClient getRemoteItems
      Failed to list job from remote https://jenkins-xyz1.company.com/xyz1/job/Jenkins.testingfolder java.io.IOException: Server returned HTTP response code: 400 for URL: https://jenkins-xyz2.company.com/xyz2/job/Jenkins.testingfolder/api/xml?tree=jobs[name,url,description]
      

       

       

          [JENKINS-67871] Job Import Plugin not importing jobs

          Ian Williams added a comment -

          Were you the poster of this question? Did it not address your problem?

          Ian Williams added a comment - Were you the poster of this question ? Did it not address your problem?

          Ian Williams added a comment -

          Lowering severity as there are workarounds and it does not impede the operational ability of Jenkins

          Ian Williams added a comment - Lowering severity as there are workarounds and it does not impede the operational ability of Jenkins

          Akhil T added a comment -

          Hi ianw, yes it was me who posted the question. We are still stuck with the same error in all the jenkins that we have. Need help on this as to what can be done.

          Akhil T added a comment - Hi ianw , yes it was me who posted the question. We are still stuck with the same error in all the jenkins that we have. Need help on this as to what can be done.

          Ian Williams added a comment -

          (I am just another frustrated plugin user, not a maintainer.) I am using 2.263.4 on RHEL 7, currently with Bugfix/jenkins 64121 #31 plugin and do not see your issue. We are not using https://. Otherwise it works

          Your query suggests your server host Url are: [ https://jenkins-xyz1.company.com/xyz1 ] and evidently, [ https://jenkins-xyz2.company.com/xyz2 ]; you are querying root folder Jenkins.testingfolder.

          But you posted two different strings:
          https://jenkins-xyz1.company.com/xyz1/job/Jenkins.testingfolder
          https://jenkins-xyz2.company.com/xyz2/job/Jenkins.testingfolder/api/xml?tree=jobs[name,url,description]

          Maybe that was a sanitizing mix-up?
          Is your Remote folder value == [ job/Jenkins.testingfolder ] and does it exist on that server?
          Can you connect at the root level ?

          If you Query! and it fails (silently), the selector resets Jenkins Server to the first item in the list but does not wipe the Remote folder; very subtle if similarly named values. Make sure your inputs are correct when you retry.

          I have recreated the folder structure, both without a job and with a job in the folder and get an expected response. Any failure conditions result in a 404, not 400. HTTP Error 400:

          The most common reason for a 400 Bad Request error is because the URL was typed wrong or the link that was clicked on points to a malformed URL with a specific kind of mistake in it, like a syntax problem

          So, check both the Global Configure settings and make sure you are specifying the correct Remote folder (ie: with job/ ) and try again, confirming the Jenkins Server value before querying.

          Ian Williams added a comment - (I am just another frustrated plugin user, not a maintainer.) I am using 2.263.4 on RHEL 7, currently with Bugfix/jenkins 64121 #31 plugin and do not see your issue. We are not using https:// . Otherwise it works Your query suggests your server host Url are: [ https://jenkins-xyz1.company.com/xyz1 ] and evidently, [ https://jenkins-xyz2.company.com/xyz2 ]; you are querying root folder Jenkins.testingfolder . But you posted two different strings: https://jenkins-xyz1.company.com/xyz1/job/Jenkins.testingfolder https://jenkins-xyz2.company.com/xyz2/job/Jenkins.testingfolder/api/xml?tree=jobs[name,url,description ] Maybe that was a sanitizing mix-up? Is your Remote folder value == [ job/Jenkins.testingfolder ] and does it exist on that server? Can you connect at the root level ? If you Query! and it fails (silently), the selector resets Jenkins Server to the first item in the list but does not wipe the Remote folder ; very subtle if similarly named values. Make sure your inputs are correct when you retry. I have recreated the folder structure, both without a job and with a job in the folder and get an expected response. Any failure conditions result in a 404, not 400. HTTP Error 400: The most common reason for a 400 Bad Request error is because the URL was typed wrong or the link that was clicked on points to a malformed URL with a specific kind of mistake in it, like a syntax problem So, check both the Global Configure settings and make sure you are specifying the correct Remote folder (ie: with job/ ) and try again, confirming the Jenkins Server value before querying.

          This doesn't seem to be a bug.

          You need to use a username and a token instead of a password.

          The token has to be created in your Jenkins instance from where you want to import the plugins.

          Moustapha Boulgoudan added a comment - This doesn't seem to be a bug. You need to use a username and a token instead of a password. The token has to be created in your Jenkins instance from where you want to import the plugins.

          Anurag Tiwari added a comment - - edited

          moustapha Can you tell me the steps to achieve?

          Anurag Tiwari added a comment - - edited moustapha Can you tell me the steps to achieve?

            Unassigned Unassigned
            akhitak Akhil T
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: