You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacOS安装Delve时遇security: SecKeychainSearchCopyNext错误求助

Fixing the "SecKeychainSearchCopyNext: 钥匙串中找不到指定项目" Error When Installing Delve via Homebrew

Hey there! I’ve run into this exact issue before setting up Delve on macOS—let’s get this sorted out for you. The error pops up because Homebrew’s automated attempt to generate the self-signed certificate (required for debugging on macOS) is failing to interact properly with your keychain. Here’s how to fix it step by step:

Step 1: Manually Create the Required Certificate

The simplest way to bypass the brew-generated certificate glitch is to make the certificate yourself via Keychain Access:

  • Open Keychain Access (find it quickly with Cmd+Space Spotlight search)
  • Select the System keychain from the left sidebar
  • Go to File > New Certificate Assistant > Create a Certificate
  • Fill in these critical details:
    • Name: dlv-cert (this exact name is non-negotiable—Delve looks specifically for this certificate)
    • Identity Type: Self-Signed Root Certificate
    • Certificate Type: Code Signing
    • Check the box labeled "Let me override defaults", then click Continue
  • For all subsequent steps, just keep clicking Continue until you reach the "Specify a Location For The Certificate" screen—make sure System is selected, then click Finish
  • Locate the dlv-cert certificate in your System keychain, right-click it and select Get Info
  • Expand the Trust section, set "Code Signing" to Always Trust, then close the info window (you’ll need to enter your system password to confirm the change)

Step 2: Clean Up and Reinstall Delve

With the certificate properly in place, let’s reset the failed brew installation:

  • First, clear out any leftover files from the incomplete install:
    brew cleanup delve
    
  • Then re-run the original install command:
    brew install go-delve/delve/delve
    

If Step 1 Fails: Use Command Line to Generate the Certificate

If the GUI method doesn’t resolve the issue, let’s generate the certificate directly via terminal:

  1. Generate the base certificate and key files:
    openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -out dlv-cert.pem -keyout dlv-cert.key
    
    (You can press Enter through all prompts—no need to fill in extra details like country or organization)
  2. Combine the key and certificate into a single .p12 file:
    cat dlv-cert.key dlv-cert.pem > dlv-cert.p12
    
  3. Import the file into your keychain:
    security import dlv-cert.p12 -k ~/Library/Keychains/login.keychain-db -P "" -T /usr/bin/codesign
    
  4. Mark the certificate as trusted:
    security add-trusted-cert -d -r trustRoot -k ~/Library/Keychains/login.keychain-db dlv-cert.pem
    
  5. Clean up the temporary files we created:
    rm dlv-cert.*
    
  6. Finally, re-run the brew install command as before.

Why This Happens

macOS requires debuggers to be code-signed to run safely, so Delve relies on a self-signed certificate for this purpose. The error you saw means Homebrew’s automated script couldn’t locate or access the correct keychain entry to create this certificate—manual creation bypasses that automated process and ensures the certificate is properly registered in your keychain.

内容的提问来源于stack exchange,提问作者Nic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:45:13