badges/shields · error · NotFound
requirement not found
Error message
requirement not found
What it means
Thrown in GalaxyToolshedVersionService.transform when a requirement name is requested but the matched tool's requirements array contains no entry whose name equals the :requirement parameter. The service looks up dataTool.requirements for the given name to report its version.
Source
Thrown at services/galaxytoolshed/galaxytoolshed-version.service.js:84
},
),
},
},
}
static transform({ response, tool, requirement }) {
if (tool !== undefined) {
const dataTool = response[1].valid_tools.find(x => x.id === tool)
if (dataTool === undefined) {
throw new NotFound({ prettyMessage: 'tool not found' })
}
// Requirement version
if (requirement !== undefined) {
const dataRequirement = dataTool.requirements.find(
x => x.name === requirement,
)
if (dataRequirement === undefined) {
throw new NotFound({ prettyMessage: 'requirement not found' })
}
return dataRequirement.version
}
// Tool version
return dataTool.version
}
// Repository version
return response[1].changeset_revision
}
async handle({ repository, owner, tool, requirement }) {
const response = await this.fetchLastOrderedInstallableRevisionsSchema({
repository,
owner,
})
const version = this.constructor.transform({
response,
tool,View on GitHub (pinned to 766fd8bc89)
Solutions
- Inspect the tool's requirements in its tool_dependencies.xml or the Tool Shed UI to get exact names
- Use the exact requirement name as declared in the repository metadata
- If unsure, drop the requirement segment to get the plain tool version instead
Example fix
// before /galaxytoolshed/version/repo/owner/bowtie2/samtool // after /galaxytoolshed/version/repo/owner/bowtie2/samtools
Defensive patterns
Strategy: validation
Validate before calling
const reqs = toolInfo?.requirements ?? [];if (!reqs.some(r => r.name === requirementName)) { console.warn(`${requirementName} is not a requirement of this tool`); } Type guard
const hasRequirement = (tool, name) => Array.isArray(tool?.requirements) && tool.requirements.some(r => r?.name === name);
Try / catch
try { return await versionBadge({ repo, owner, tool, requirement }); } catch (e) { if (String(e.message).includes('requirement not found')) { return versionBadge({ repo, owner, tool }); } throw e; } Prevention
- Match requirement names exactly as declared in the repository metadata
- Fall back to the plain tool-version badge when unsure of requirement names
- Confirm the target revision still declares the requirement
When it happens
Trigger: Calling the version badge with a requirement name that the tool's requirements list does not define, e.g. /galaxytoolshed/version/{repo}/{owner}/{tool}/{requirement} where requirement is misspelled or not a declared requirement of that tool.
Common situations: Requirement names differing in spelling or punctuation (e.g. 'samtools' vs 'sam-tools'); requesting a requirement that was added only in newer revisions; confusing requirement names with tool ids.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/f46445c1c77e3732.
Report an issue: GitHub.