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

Jenkins ImportPlugin - Error '/' unsafe character

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: job-import-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.255
      job-import plugin 3.4
      Oracle Linux Server release 7.5
    • Similar Issues:

      Description

      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

       

        Attachments

          Issue Links

            Activity

            Hide
            bherfurth 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,
             
             

            Show
            bherfurth 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,    
            Hide
            mzol 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

            Show
            mzol 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
            Hide
            a07855 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

            Show
            a07855 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
            Show
            avdkolk 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  
            Hide
            a07855 Todd Vogl added a comment -

            Alexander,

             

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

             

            Thanks,

             

            Todd

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

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

            Show
            avdkolk Alexander added a comment - Todd Vogl  sorry I'm not the maintainer nor have I got a working dev/test-environment for it.
            Hide
            ianw Ian Williams added a comment -

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

            Show
            ianw Ian Williams added a comment - I have posted am alternate workaround to StackOverflow: Job Import Plugin doesn’t import folder
            Hide
            a07855 Todd Vogl added a comment - - edited

            Ian Williams This worked great!  Thank you very much!!!!

             

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

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

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              a07855 Todd Vogl
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: