TeamCity Build on MAC - permissions issue

Hi,

We are using TeamCity version 9.1.4 building an iOS application, so the build agent is running on a MAC (OS X operating system).  When running the build, we have a step to unlock the keychain and get access to the deployment certificate.  We are calling the following commands:

security -v default-keychain -s ~/Library/Keychains/login.keychain
security unlock-keychain -p pswdhere ~/Library/Keychains/login.keychain

When this runs it team city, we get the following messages:

default-keychain "-s" "~/Library/Keychains/login.keychain"
Will not set default: UID=501 does not own directory ~
security: SecKeychainSetDefault: write permissions error
security unlock-keychain
security: SecKeychainUnlock ~/Library/Keychains/login.keychain: The specified keychain could not be found.

When these commands are run in the terminal using the same user, they are successful.  I believe this issue is causing problems further in the build because it says there are no installed provisioning profiles.

I have reviewed the post about build behaving differently in TeamCity than locally, but the steps to correct seem to focus on Windows.  We are running the agent on a Mac.

Any pointers or recommendations on how to resolve in a Mac environment?

Thanks,

Doug

 

0
1 comment

Hi Doug, and sorry for the delay. The steps suggested are mostly equal for all systems, just with some specifics added in Windows because they handle services as a special case. In the case the same user is used, and if I understand you correctly, you are using a command line runner, then there might be some differences in the environment between the process spawned by teamcity (should be inherited from the one spawned for the agent), and the one you are running.

Can you confirm whether you are running a command line runner and whether you could follow most of the steps to check what is going on?

On the other hand, the error seems rather clear. The UID 501 doesn't own the directory, thus write permission isn't granted. Is the user running the build user 501? Is he owner of the directory?

0

Please sign in to leave a comment.