2

jenkins is installed in OS X Sierra and I am trying to create a job I have uploaded provisioning file in KeyChain and Provisioning Profiles Management plugin. In job configuration, in Build environment section, Mobile Provisioning Profile, corresponding profile is selected. When build is run, I get these errors

FATAL: Failed to copy /Users/Shared/Jenkins/Home/kpp_upload/abcdfe-e441-407b-ba4a-34e97bf71f5b.mobileprovision to /Users/*****/Library/MobileDevice/Provisioning Profiles/abcdfe-e441-407b-ba4a-34e97bf71f5b.mobileprovision
         java.io.IOException: Failed to copy /Users/Shared/Jenkins/Home/kpp_upload/abcdfe-e441-407b-ba4a-34e97bf71f5b.mobileprovision to /Users/*****/Library/MobileDevice/Provisioning Profiles/abcdfe-e441-407b-ba4a-34e97bf71f5b.mobileprovision
    at .     
        hudson.FilePath.copyTo(FilePath.java:2018)
    at .                  com.sic.plugins.kpp.KPPProvisioningProfilesBuildWrapper.copyProvisioningProfiles(KPPProvisioningProfilesBuildWrapper.java:161)
    at .             com.sic.plugins.kpp.KPPProvisioningProfilesBuildWrapper.setUp(KPPProvisioningProfilesBuildWrapper.java:99)
    at .   hudson.model.Build$BuildExecution.doRun(Build.java:156)
    at .              hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at     hudson.model.Run.execute(Run.java:1720)
    at     hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at     hudson.model.ResourceController.execute(ResourceController.java:98)
    at     hudson.model.Executor.run(Executor.java:404)
    Caused by:     java.io.FileNotFoundException: /Users/*****/Library/MobileDevice/Provisioning Profiles/abcdfe-e441-407b-ba4a-34e97bf71f5b.mobileprovision (Permission denied)
    at     java.io.FileOutputStream.open0(Native Method)
    at     java.io.FileOutputStream.open(FileOutputStream.java:270)
    at     java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at     java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at     hudson.FilePath.write(FilePath.java:1907)
    at     hudson.FilePath.copyTo(FilePath.java:2011)
    ... 8 more
    Finished: FAILURE

When I run a command in terminal to copy file from source folder to destination folder, it succeeds. But jenkins is unable to copy

user2599522
  • 3,005
  • 2
  • 23
  • 40
SriSreeku
  • 21
  • 2

2 Answers2

0

The issue is that the target path has a folder "Provisioning Profiles" with a space in it.

Either place it into a folder with no white space, or escape the white space in your code.

<string path>.replaceAll(" ", "\\ ")
ɢʀᴜɴᴛ
  • 32,025
  • 15
  • 116
  • 110
0

I have met the similar problem because of the access permission denied.I think that you installed the Jenkins by .pkg file,because your Jenkins directory is in /Users/Shared/Jenkins.

This kind of installation of Jenkins on macOS is really easy to cause the file access permission error.

The above error is not very easy to solve,I have not solve the problem yet directly.

I have reinstalled the Jenkins by brew command,and I have no permission error,because the Jenkins installation directory is not in Shared,but in the User directory.

If you don't have Homebrew installed,use the command to install Homebrew in your terminal.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Use the command to install Jenkins.

brew install jenkins-lts
ifeegoo
  • 7,054
  • 3
  • 33
  • 38