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

  1. Relax or remove the exact pin on the offending collection shown as the candidate, letting the resolver pick a compatible version
  2. Upgrade the parent collection(s) named in `dependency of ...` to versions with compatible requirement ranges
  3. 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

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


AI-assisted analysis of ansible/ansible@9cf16a4aca (2026-08-15). Data as JSON: /api/errors/b4fd98ac2cf5830c. Report an issue: GitHub.