Xcode Server Build:“Multiple matching codesigning identities found” [英] Xcode Server Build: "Multiple matching codesigning identities found"

查看:345
本文介绍了Xcode Server Build:“Multiple matching codesigning identities found”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然,Xcode构建服务器没有改变,我开始收到一个错误,甚至跨越不同的机器人,分支机构和应用程序(所有都是Mac应用程序)。我没有改变任何软件或配置的构建服务器(我知道),甚至登录它。我在分析过程中遇到错误:


检查依赖关系



:找到多个匹配的代码签名标识:找到与Mac Developer:OS X Server(N________L)匹配的多个代码标识标识(即证书和私钥对)。


并且在测试期间(虽然我的测试通过 - 上面的是失败的构建):


测试失败:



找到多个匹配的代码签名标识:找到与Mac Developer:OS X Server(N________L)匹配的多个代码标识标识(即证书和私钥对) p>

我已经尝试过以下操作,在每个步骤后触发构建,但没有更改消息:


  1. 触发另一个构建

  2. 更新到构建服务器上的最新Xcode(6.3.2)

  3. 通过Keychain Access搜索任何OS X Server证书或密钥,找不到

  4. 从Server.app中删除了所有开发人员团队。 注意:这行为怪异。在设置为No Teams之前,我必须删除它两次,但现在保持不变

  5. 我已登录并重新添加了我的团队
  6. $ b
  7. 已多次重新启动机器

  8. 已移除来自 / Library / Developer / XcodeServer / ProvisioningProfiles
  9. 的所有配置配置文件
  10. 删除配置文件后,再次使用我的开发人员帐户登录。他们已被重新创建,但错误仍然存​​在

我在机器人中关闭了执行分析操作消息,但重新打开它,或打开执行归档操作,重新引入它,这不是一个选项(也,我想要执行静态分析,这是为什么它首先打开)。



假设Xcode Server的签名标识列表已损坏,我该如何重置它们,在Server.app之外(因为我已经删除了开发团队)?我找到了几个目录,似乎是一些疑难解答和/或备份恢复的候选人,但我很抱歉,不知道确切的是,他们是为了什么。



< pre class =lang-none prettyprint-override> / Library / Developer / XcodeServer / Certificates
/ Library / Developer / XcodeServer / Keychains

我注意到我的配置配置文件在2016年5月20日 2016年 到期。这意味着我的旧的两天前(5/20/2015),这是在我上次成功(5/19)和第一次失败(5/21)之间。



现在,知道这些失败的来源,现在的问题变成:如何清除导致重复的旧配置文件(或证书等)?



服务器在Yosemite(10.10.3),服务器(4.1)和Xcode(6.3.2)上是最新的。



strong>更新



我试图列出代码标识,但无法获得单个Mac开发:OS X服务器 ,更不用说多倍。这些是我试过的命令,只列出非服务器身份在钥匙串:

  security find-identity  - p codesigning 
sudo -u _xcsbuildd security find-identity -p codesigning
sudo -u _xcsd security find-identity -p codesigning


解决方案

它似乎是一个服务器中的错误实际上引入了重复的签名身份。我举报为 rdar:// 21080937 ,如果你想欺骗它。



为了解决这个问题,我必须了解Xcode Server如何存储签名身份(完全感谢

Xcode Server将开发人员计划证书存储在

  /Library/Developer/XcodeServer/Keychains/Portal.keychain 

按照以下步骤,我可以打开钥匙串,找到重复的,删除它,然后把它。


  1. 移除开发人员小组,从Server.app登出开发人员入口网站


  2. 将Portal密钥链复制到您的桌面:

     > sudo cp /Library/Developer/XcodeServer/Keychains/Portal.keychain〜/ Desktop / 

    密码: 您的管理员密码

      sudo chown`whoami`:staff〜/ Desktop / Portal.keychain 


  3. 设置Portal钥匙串密码123

     > security set-keychain-password -o`sudo cat / Library / Developer / XcodeServer / SharedSecrets / PortalKeychainSharedSecret`〜/ Desktop / Portal.keychain 

    新密码: 123



    code>重新输入新密码: 123


  4. 在钥匙串中打开钥匙串访问: / p>

     >打开-b com.apple.keychainaccess〜/ Desktop / Portal.keychain 


  5. 使用密码


  6. 查找具有错误中列出的名称的重复键

    li>
  7. 删除一个(我最近选择了一个修改的较少,但可能没什么关系)


  8. 锁定Portal钥匙串,退出钥匙串访问


  9. 重置门户钥匙串密码:

     > security set-keychain-password -p`sudo cat / Library / Developer / XcodeServer / SharedSecrets / PortalKeychainSharedSecret`〜/ Desktop / Portal.keychain 

    密码: 您的管理员密码(可选步骤)



    旧密码: 123




  10. 备份原来的钥匙串

     > sudo cp /Library/Developer/XcodeServer/Keychains/Portal.keychain/Library/Developer/XcodeServer/Keychains/Portal.keychain.old 


  11. 复制Portal钥匙串

      sudo cp〜/ Desktop / Portal.keychain / Library / Developer / XcodeServer / Keychains / 


  12. 修正新钥匙串的权限

     > sudo chown _xcsbuildd:_xcs /Library/Developer/XcodeServer/Keychains/Portal.keychain 



  13. li>

    运行构建,验证一切正常。如果是,请删除钥匙串的备份副本

     > rm〜/ Desktop / Portal.keychain 
    > sudo rm /Library/Developer/XcodeServer/Keychains/Portal.keychain.old



All of a sudden, with no change to the Xcode build server, I started getting an error, even across different bots, branches, and apps (all are Mac apps). I didn't change any software or configuration on the build server (that I know of), or even sign into it. I get the error once during analysis:

Check dependencies

Code Sign error: Multiple matching codesigning identities found: Multiple codesigning identities (i.e. certificate and private key pairs) matching "Mac Developer: OS X Server (N________L)" were found.

And again during Testing (though my tests pass – the one above is what fails the build):

Testing failed:

Multiple matching codesigning identities found: Multiple codesigning identities (i.e. certificate and private key pairs) matching "Mac Developer: OS X Server (N________L)" were found.

I have tried the following, triggering a build after each step, with no change in the message:

  1. Triggered another build
  2. Updated to the latest Xcode on the build server (6.3.2)
  3. Searched through Keychain Access for any "OS X Server" certificates or keys, finding none
  4. Removed all Developer Teams from Server.app. Note: this acted weird. I had to remove it twice before the setting read "No Teams", but now it's stayed that way
  5. I signed in to add my team again
  6. Removed it again, which still had to be done twice before it "stuck"
  7. Restarted the machine, multiple times
  8. Removed all provisioning profiles from /Library/Developer/XcodeServer/ProvisioningProfiles
  9. Signed in with my developer account again after removing the provisioning profiles. They have been recreated, but the error remains

I turned off "Perform analyze action" in the bot, which did get rid of the message, but turning it back on, or turning on "Perform archive action", reintroduce it, so that's not an option (also, I want static analysis performed, which is why it's turned on in the first place).

Assuming for the moment that Xcode Server's list of signing identities is corrupted, how would I go about resetting them, outside of Server.app (since I already removed the Development Team there)? I found a couple of directories that seem like candidates for some troubleshooting and/or backup restoration, but I'm hesitant to mess around without knowing for sure what they're for.

/Library/Developer/XcodeServer/Certificates
/Library/Developer/XcodeServer/Keychains

I noticed that my provisioning profiles all expire on May 20, 2016. This means my old ones expired two days ago (5/20/2015), which was between my last successful (5/19) and first failed (5/21) builds.

So now, knowing the source of these failures, the problem now becomes: how do I clear out the old provisioning profiles (or certificates, etc.) that are causing the duplicates?

The server is up-to-date on Yosemite (10.10.3), Server (4.1), and Xcode (6.3.2).

Update

I'm trying to list codesigning identities, but can't get even a single "Mac Developer: OS X Server" to show up, let alone multiples. These are the commands I've tried, which only list the non-Server identities in the keychain:

security find-identity -p codesigning
sudo -u _xcsbuildd security find-identity -p codesigning
sudo -u _xcsd security find-identity -p codesigning

解决方案

It looks like a bug in Server did in fact introduce a duplicate signing identity. I reported it as rdar://21080937, if you'd like to dupe it.

In order to fix it, I had to learn about how Xcode Server stores signing identities (thanks entirely to an extremely helpful answer to an unrelated question).

Xcode Server stores Developer Program certificates in

/Library/Developer/XcodeServer/Keychains/Portal.keychain

Following the steps below, I was able to open the keychain, find the duplicate, remove it, and put it back. These steps are adapted from the answer linked above.

  1. Sign out of the Developer Portal from Server.app by removing the developer team you're having issues with

  2. Copy the Portal keychain to your desktop:

    > sudo cp /Library/Developer/XcodeServer/Keychains/Portal.keychain ~/Desktop/
    

    Password: your-administrator-password

    > sudo chown `whoami`:staff ~/Desktop/Portal.keychain 
    

  3. Set the Portal keychain password to "123"

    > security set-keychain-password -o "`sudo cat /Library/Developer/XcodeServer/SharedSecrets/PortalKeychainSharedSecret`" ~/Desktop/Portal.keychain 
    

    New Password: 123

    Retype New Password: 123

  4. Open the Keychain in Keychain Access:

    > open -b com.apple.keychainaccess ~/Desktop/Portal.keychain
    

  5. Unlock the "Portal" keychain using password "123"

  6. Find the duplicate keys with the name listed in the error

  7. Remove one (I picked the one modified less recently, but it may not matter)

  8. Lock the "Portal" keychain, quit "Keychain Access"

  9. Reset the Portal keychain password:

    > security set-keychain-password -p "`sudo cat /Library/Developer/XcodeServer/SharedSecrets/PortalKeychainSharedSecret`" ~/Desktop/Portal.keychain 
    

    Password: your-administrator-password (optional step)

    Old Password: 123

    It may or may not ask you for your administrator password again, pay attention to the prompt.

  10. Backup the original keychain

    > sudo cp /Library/Developer/XcodeServer/Keychains/Portal.keychain /Library/Developer/XcodeServer/Keychains/Portal.keychain.old
    

  11. Copy the Portal keychain back

    > sudo cp ~/Desktop/Portal.keychain /Library/Developer/XcodeServer/Keychains/
    

  12. Fix the new keychain's permissions

    > sudo chown _xcsbuildd:_xcs /Library/Developer/XcodeServer/Keychains/Portal.keychain
    

  13. Since the system caches open keychains, restart the server

  14. Add your developer team back, in Server.app

  15. Run a build, verifying everything looks good. If so, remove the backup copies of the keychain

    > rm ~/Desktop/Portal.keychain
    > sudo rm /Library/Developer/XcodeServer/Keychains/Portal.keychain.old
    

这篇关于Xcode Server Build:“Multiple matching codesigning identities found”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆