ansible/ansible · error · AnsibleError
Failed to resolve the requested dependencies map. Got the ca
Error message
Failed to resolve the requested dependencies map. Got the candidate {req.fqcn!s}:{req.ver!s} ({dep_origin!s}) which didn't satisfy all of the following requirements: What it means
Raised on `CollectionDependencyInconsistentCandidate`: the resolver settled on a candidate for a collection, but that candidate fails one or more requirements recorded for it (enumerated as `* fqcn:ver` lines). Unlike ResolutionImpossible, one candidate exists but does not fit all parents' constraints; the message also names the parent chain that pulled it in.
Source
Thrown at lib/ansible/galaxy/collection/__init__.py:1931
'Failed to resolve the requested dependencies map. '
'Got the candidate {req.fqcn!s}:{req.ver!s} ({dep_origin!s}) '
'which didn\'t satisfy all of the following requirements:'.
format(
req=dep_exc.candidate,
dep_origin='direct request'
if not parents else 'dependency of {parent!s}'.
format(parent=', '.join(parents))
)
)
]
for req in dep_exc.criterion.iter_requirement():
error_msg_lines.append(
f'* {req.fqcn!s}:{req.ver!s}'
)
error_msg_lines.append(pre_release_hint)
raise AnsibleError('\n'.join(error_msg_lines)) from dep_exc
except ValueError as exc:
raise AnsibleError(to_native(exc)) from exc
View on GitHub (pinned to 9cf16a4aca)
Solutions
- Relax or remove the exact pin on the offending collection shown as the candidate, letting the resolver pick a compatible version
- Upgrade the parent collection(s) named in `dependency of ...` to versions with compatible requirement ranges
- As a last resort use `--no-deps` and manage versions explicitly yourself
Example fix
# before (requirements.yml)
collections:
- name: ansible.netcommon
version: "==2.0.0" # candidate fails cisco.iosdev's >=3 requirement
# after
- name: ansible.netcommon
version: ">=3.0.0" Defensive patterns
Strategy: try-catch
Try / catch
from ansible.errors import AnsibleError
try:
install_collections(...)
except AnsibleError as e:
if "didn't satisfy all of the following requirements" in to_native(e):
# message lists candidate + parents; relax the pin or upgrade the parents Prevention
- Avoid `==` pins for collections whose deps are shared with others
- Review the 'dependency of X' line to find which parent to upgrade
- Validate requirements.yml in CI by running resolver against a throwaway venv
When it happens
Trigger: A previously chosen or pinned candidate (e.g. an already-specified version in requirements.yml, or a candidate matching another constraint) conflicts with a requirement from a different dependency chain; the message shows which parents (`dependency of X, Y`) imposed the failing requirements.
Common situations: Mixed old/new collections in requirements.yml, installing alongside already-installed versions, one collection pinning an exact old version of a dependency while others need newer.
Related errors
- Failed to resolve the requested dependencies map. Could not
- Expecting requirements file to be a dict with the key 'colle
- The positional collection_name arg and --requirements-file a
- You must specify a collection name or a requirements file.
- The --signatures option and --requirements-file are mutually
AI-assisted analysis of ansible/ansible@9cf16a4aca (2026-08-15).
Data as JSON: /api/errors/b4fd98ac2cf5830c.
Report an issue: GitHub.