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

"keychain with the same name already exists" error with developer profile import

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • xcode-plugin
    • None
    • Ubuntu 12.04.3 (Master), OSX Mavericks 10.9.2 (slave)

      I have a build set up using the Xcode plugin with a restriction set to run on an OSX build slave. The first build step in this job is to import the developer profile using the "Import Developer Profile" function. When I set it up this way, the first time I execute the build, the job launches and completes successfully. The second time I try to run this build, however, the job fails at the "import developer profile" step. The console log for the builds shows the following:

      $ security list-keychains
      $ security create-keychain -p ******** jenkins-iOS-Client-Dev
      security: SecKeychainCreate jenkins-iOS-Client-Dev: A keychain with the same name already exists.
      ERROR: Failed to create a keychain
      Finished: FAILURE

      If I manually run the 'security list-keychains' on the build slave as the build user (jenkins), I don't see any keychains listed:

      $ sudo -u jenkins security list-keychains
      Password:
      "/Library/Keychains/System.keychain"

      However, if I look in the Keychains directory for the 'jenkins' user on the OSX machine, I see a file named with the keychain:

      $ pwd
      /var/lib/jenkins/Library/Keychains
      $ ls -l
      total 176
      rw-rr- 1 jenkins jenkins 37292 Mar 11 11:33 jenkins-iOS-Client-Dev
      rw-rr- 1 jenkins jenkins 45164 Feb 21 17:30 login.keychain

      This is a major issue for us as, without being able to import developer profiles dynamically in the job config, we have to go manually tweak the build environment to include the proper certs, mobileprofiles and credentials.

            lacostej lacostej
            tduskin Trey Duskin
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: