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

Jenkins ImportPlugin - Error '/' unsafe character

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • job-import-plugin
    • None
    • Jenkins 2.255
      job-import plugin 3.4
      Oracle Linux Server release 7.5

      I am able to import a job if it is located at the root of jenkins 

      src:   (/opt/jenkins/workspace/job)

      But if I try to import a job located in a folder             

      src:   (/opt/jenkins/workspace/directory/job)

      I get the following error:

      Failure: ‘/’ is an unsafe character

       

      There are no / s in the name of the directory or file

      I have attached the relevant Jenkins.log output

       

          [JENKINS-64121] Jenkins ImportPlugin - Error '/' unsafe character

          Todd Vogl created issue -

          Ben Herfurth added a comment -

          Same here.

          My directory has / in the name because it is not in the jenkins root.

          The request passes it like:
          "com/job/deployment/job/my-app/": false,
           
           

          Ben Herfurth added a comment - Same here. My directory has / in the name because it is not in the jenkins root. The request passes it like: "com/job/deployment/job/my-app/": false,    

          Mykhailo Zolotarenko added a comment - - edited

          We also see this issue when trying import job, not from the root directory

          e.g.

          If we choose from the list jobs:

          dir-1/ dir-2/job_name https://jenkins/job/dir_1/job/dir_2/job/job_name/]

          and click on import - we have the following issue:

          Remote Jenkins Job Import Status
          Name Status
          job_name FAILED - ‘/’ is an unsafe character

          Jenkins 2.249.3
          job-import plugin 3.4

          Mykhailo Zolotarenko added a comment - - edited We also see this issue when trying import job, not from the root directory e.g. If we choose from the list jobs: dir-1/ dir- 2/job_name https://jenkins/job/dir_1/job/dir_2/job/job_name/] and click on import - we have the following issue: Remote Jenkins Job Import Status Name Status job_name FAILED - ‘/’ is an unsafe character Jenkins 2.249.3 job-import plugin 3.4

          Todd Vogl added a comment -

          Temp Work Around:

          Move your job to the Root of Jenkins  /opt/jenkins/workspace

          Then I've been able to import it to another instance

          Todd Vogl added a comment - Temp Work Around: Move your job to the Root of Jenkins  /opt/jenkins/workspace Then I've been able to import it to another instance

          Alexander added a comment -

          Alexander added a comment - I think I have found the cause of the issue; https://github.com/jenkinsci/jenkins/commit/f176292eb4a41c007a97b86ff767ccb36707c1e6  It added an additional check to the name. Should be fixed here: https://github.com/jenkinsci/job-import-plugin/blob/2578ed330d35328f9bdeca219f7b98beefe68a71/src/main/java/org/jenkins/ci/plugins/jobimport/JobImportAction.java#L222  

          Todd Vogl added a comment -

          avdkolk,

           

          Will this be released soon as a Plugin update or is there another way to update my plugin?

           

          Thanks,

           

          Todd

          Todd Vogl added a comment - avdkolk ,   Will this be released soon as a Plugin update or is there another way to update my plugin?   Thanks,   Todd

          Alexander added a comment -

          a07855 sorry I'm not the maintainer nor have I got a working dev/test-environment for it.

          Alexander added a comment - a07855  sorry I'm not the maintainer nor have I got a working dev/test-environment for it.

          Ian Williams added a comment -

          I have posted am alternate workaround to StackOverflow:
          Job Import Plugin doesn’t import folder

          Ian Williams added a comment - I have posted am alternate workaround to StackOverflow: Job Import Plugin doesn’t import folder
          Ian Williams made changes -
          Link New: This issue is related to JENKINS-53902 [ JENKINS-53902 ]

          Todd Vogl added a comment - - edited

          ianw This worked great!  Thank you very much!!!!

           

          https://stackoverflow.com/a/68799939/598141

          Todd Vogl added a comment - - edited ianw  This worked great!  Thank you very much!!!!   https://stackoverflow.com/a/68799939/598141

            Unassigned Unassigned
            a07855 Todd Vogl
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: