# Jenkins: ERROR: Could not find credentials entry with ID 'github-token'

**Code:** `Could not find credentials entry` · **Category:** CI/CD · **Seen on:** Jenkins

The Jenkinsfile references a credentials ID that does not exist in the scope Jenkins can see for this job.

## Meaning

Credentials live in a store and scope (system, global, folder). A job inside a folder can use global credentials and its folder's own, not a sibling folder's. IDs are case-sensitive and must match exactly; type matters too (secret text vs username/password).

## Common causes

- ID misspelled or never created
- Credentials stored in a folder/store not visible to this job
- Wrong credential type for the binding
- Credentials deleted or renamed
- Multibranch scan using a different folder scope

## Quick fix

1. Compare the ID in Manage Jenkins → Credentials
2. Create it in a scope visible to the job (global or the job's folder)
3. Match the type used by `withCredentials`

## Detailed fix by platform

### Jenkins

1. `withCredentials([string(credentialsId: 'github-token', variable: 'TOKEN')]) { sh 'curl -H "Authorization: Bearer $TOKEN" ...' }`

## Code examples

### Use credentials safely

```groovy
withCredentials([usernamePassword(credentialsId: 'registry', usernameVariable: 'U', passwordVariable: 'P')]) {
  sh 'echo "$P" | docker login -u "$U" --password-stdin registry.example.com'
}
```

## How to diagnose

1. **ID** — Exact credentialsId?
2. **Scope** — Visible to this job?
3. **Type** — Matches the binding?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cicd/jenkins-credentials-not-found)
