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

Copy Artifact plugin: Unable to find project for artifact copy when using a build parameter

      Error message:

      ...
      project_name=daily
      _=/bin/env
      Unable to find project for artifact copy: daily
      This may be due to incorrect project name or permission settings; see help for project name in job configuration.
      Build step 'Copy artifacts from another project' marked build as failure
      ...
      

      When I set the project name by hand, there is no error. When I use a build parameter, and set its value to the same value as the hand typed value, it fails. The above message show what variable I use: $project_name

      Please see the screenshots for the configuration details.

          [JENKINS-14999] Copy Artifact plugin: Unable to find project for artifact copy when using a build parameter

          Code changed in jenkins
          User: ikedam
          Path:
          src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java
          http://jenkins-ci.org/commit/copyartifact-plugin/6eab69d0972fdd508da88a39b7a90e9a2042cb65
          Log:
          JENKINS-14999 Enabled tests for QueueItemAuthenticator as copyartifact now targets for Jenkins 1.580.1 > 1.521.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java http://jenkins-ci.org/commit/copyartifact-plugin/6eab69d0972fdd508da88a39b7a90e9a2042cb65 Log: JENKINS-14999 Enabled tests for QueueItemAuthenticator as copyartifact now targets for Jenkins 1.580.1 > 1.521.

          Code changed in jenkins
          User: ikedam
          Path:
          src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java
          http://jenkins-ci.org/commit/copyartifact-plugin/ec41cbdd914d33d606734b8f36460efc25913af4
          Log:
          Merge pull request #60 from ikedam/feature/JENKINS-14999_EnableTestsForQueueItemAuthentication

          JENKINS-14999 Enabled tests for QueueItemAuthenticator

          Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/47e05f2703db...ec41cbdd914d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java http://jenkins-ci.org/commit/copyartifact-plugin/ec41cbdd914d33d606734b8f36460efc25913af4 Log: Merge pull request #60 from ikedam/feature/ JENKINS-14999 _EnableTestsForQueueItemAuthentication JENKINS-14999 Enabled tests for QueueItemAuthenticator Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/47e05f2703db...ec41cbdd914d

          Or Shachar added a comment -

          Hi,

          The issue reoccurs with Jenkins core 1.596.2 and copy-artifacts version 1.35.
          Tested it with any of the parameters and I still get same issue.

          Or Shachar added a comment - Hi, The issue reoccurs with Jenkins core 1.596.2 and copy-artifacts version 1.35. Tested it with any of the parameters and I still get same issue.

          Or Shachar added a comment -

          It seems like now you need to give special permissions at the source job to allow specific jobs to copy artifacts.

          Or Shachar added a comment - It seems like now you need to give special permissions at the source job to allow specific jobs to copy artifacts.

          Shane Gannon added a comment -

          In Jenkins ver. 1.609.3 with Copy Artifact Plugin 1.36.1 I hit this issue. As a workaround if I set Permission to Copy Artifact - Projects to allow copy artifacts to * the problem is resolved.

          But this is still a bug. It should not behave differently depending on whether the job name is hard coded or comes from a parameter.

          Shane Gannon added a comment - In Jenkins ver. 1.609.3 with Copy Artifact Plugin 1.36.1 I hit this issue. As a workaround if I set Permission to Copy Artifact - Projects to allow copy artifacts to * the problem is resolved. But this is still a bug. It should not behave differently depending on whether the job name is hard coded or comes from a parameter.

          Rick Liu added a comment -

          I have this same issue.

          Jenkins ver. 1.642.1
          Copy Artifact Plugin ver 1.37
          CloudBees Folders Plugin ver 5.1

          On the upstream trigger job,
          I have explicitly set "Permission to Copy Artifact - Projects to allow copy artifacts"
          for the full downstream job name including Folder-Plugin's foldername "FOLDNER_NAME/DOWNSTREAM_PROJECT_NAME".

          But this still causes the error on the downstream job:
          ERROR: Unable to find project for artifact copy: FOLDER_NAME/DOWNSTREAM_PROJECT_NAME
          This may be due to incorrect project name or permission settings; see help for project name in job configuration.

          If on the upstream trigger job,
          I have explicitly set "Permission to Copy Artifact - Projects to allow copy artifacts"
          for the full downstream job name to wildcard '*',
          then the problem solved.

          Rick Liu added a comment - I have this same issue. Jenkins ver. 1.642.1 Copy Artifact Plugin ver 1.37 CloudBees Folders Plugin ver 5.1 On the upstream trigger job, I have explicitly set "Permission to Copy Artifact - Projects to allow copy artifacts" for the full downstream job name including Folder-Plugin's foldername "FOLDNER_NAME/DOWNSTREAM_PROJECT_NAME". But this still causes the error on the downstream job: ERROR: Unable to find project for artifact copy: FOLDER_NAME/DOWNSTREAM_PROJECT_NAME This may be due to incorrect project name or permission settings; see help for project name in job configuration. If on the upstream trigger job, I have explicitly set "Permission to Copy Artifact - Projects to allow copy artifacts" for the full downstream job name to wildcard '*', then the problem solved.

          Rick Liu added a comment -

          After some further combination of trials,
          I found out that "Permission to Copy Artifact - Projects to allow copy artifacts" must set to a project name without FOLDER_NAME.

          This resolves the problem too.
          However,
          there's a misleading warning "Unable to find project:"
          when set the upstream job "Permission to Copy Artifact - Projects to allow copy artifacts"
          to a DOWNSTREAM_PROJECT_NAME only without FOLDER_NAME.

          I'll create a separate JIRA ticket for that.

          Rick Liu added a comment - After some further combination of trials, I found out that "Permission to Copy Artifact - Projects to allow copy artifacts" must set to a project name without FOLDER_NAME. This resolves the problem too. However, there's a misleading warning "Unable to find project:" when set the upstream job "Permission to Copy Artifact - Projects to allow copy artifacts" to a DOWNSTREAM_PROJECT_NAME only without FOLDER_NAME. I'll create a separate JIRA ticket for that.

          Rick Liu added a comment -

          created JENKINS-33257 for the misleading warning

          Rick Liu added a comment - created JENKINS-33257 for the misleading warning

          I'm still getting this in 1.3.7 / Jenkins ver. 1.651.1

          Jakub Bochenski added a comment - I'm still getting this in 1.3.7 / Jenkins ver. 1.651.1

          Lanre Ade added a comment -

          19 May 2016 - still having same issue. Rick's suggestion didn't work for me.

          Lanre Ade added a comment - 19 May 2016 - still having same issue. Rick's suggestion didn't work for me.

            ikedam ikedam
            deepchip Martin d'Anjou
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: