# macOS: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain. (errSecItemNotFound -25300)

**Code:** `The specified item could not be found in the keychain (-25300)` · **Category:** macOS · **Seen on:** macOS

A lookup in the macOS keychain found no matching item, or access to it was denied.

## Meaning

Check the service/account names used in `security find-generic-password -s SERVICE -a ACCOUNT`, make sure you search the right keychain (login vs System), and that the item wasn't removed. For CI keychains, unlock with `security unlock-keychain` first and set a search list.

## Common causes

- Item never saved or removed
- Wrong service/account/label
- Wrong keychain (login/System/custom)
- Keychain locked (CI)
- Access control blocks the calling app

## Quick fix

1. `security find-generic-password -s "service" -a "account" -w`
2. `security unlock-keychain -p PASS ~/Library/Keychains/login.keychain-db`
3. Add the item again with `security add-generic-password`

## Detailed fix by platform

### macOS

1. `security list-keychains` and `security find-generic-password -s NAME`

## How to diagnose

1. **Name** — Service/account correct?
2. **Keychain** — Which one?
3. **Lock** — Unlocked?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/macos/keychain-item-not-found-25300)
