badges/shields · error · NotFound
not found
Error message
not found
What it means
The Ansible role service fetches role metadata from the Ansible Galaxy API and throws NotFound with prettyMessage 'not found' when the response's results array is empty. This is Shields' way of rendering a 'not found' badge when the requested namespace/name does not match any role on Galaxy.
Source
Thrown at services/ansible/ansible-role.service.js:46
},
},
}
static defaultBadgeData = { label: 'role downloads' }
async fetch({ namespace, name }) {
const url = 'https://galaxy.ansible.com/api/v1/roles/'
return this._requestJson({
url,
schema: ansibleRoleSchema,
options: { searchParams: { namespace, name, limit: 1 } },
})
}
async handle({ namespace, name }) {
const json = await this.fetch({ namespace, name })
if (json.results.length === 0) {
throw new NotFound({ prettyMessage: 'not found' })
}
return renderDownloadsBadge({ downloads: json.results[0].download_count })
}
}
View on GitHub (pinned to 766fd8bc89)
Solutions
- Verify the namespace/name in the badge URL against the role's page on galaxy.ansible.com.
- Check whether the role was renamed or removed from Galaxy.
- Wait for the Galaxy import to complete for newly published roles.
- Use the correct namespace (author) — role names are not unique across namespaces.
Example fix
// before
/api/v1/roles/?namespace__name=myusr&name=myrole -> results: [] -> NotFound
// after (correct namespace)
/api/v1/roles/?namespace__name=correctuser&name=myrole -> results: [{ download_count: 42 }] Defensive patterns
Strategy: validation
Validate before calling
// verify the role exists before requesting the badge curl -s "https://galaxy.ansible.com/api/v1/roles/?namespace__name=NS&name=NAME" | jq '.results | length'
Type guard
function roleExists(json) { return Array.isArray(json?.results) && json.results.length > 0 } Try / catch
try {
const badge = await service.handle({ namespace, name })
} catch (err) {
if (err.name === 'NotFound') return renderNotFoundBadge()
throw err
} Prevention
- Verify namespace/name against the role's Galaxy page before embedding the badge.
- Account for roles being renamed or removed.
- Wait for Galaxy import to finish for new roles.
- Remember names are scoped per namespace.
When it happens
Trigger: this.fetch({ namespace, name }) succeeds (HTTP 200) but json.results.length === 0 — the Galaxy search by namespace/name returns no matching role.
Common situations: Typo in the role namespace or name in the badge URL, role deleted/renamed on Ansible Galaxy, role not yet published/imported (Galaxy import pending), asking for a role hosted under a different namespace.
Related errors
- no jobs found
- not found
- not found
- unknown type, provider, or upstream issue
- artifact or ${versionType}version not found
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/4c182ecc1a672138.
Report an issue: GitHub.