ansible/ansible · error · AnsibleError

Unhandled exception when retrieving {config!r}.

Error message

Unhandled exception when retrieving {config!r}.

What it means

Error "Unhandled exception when retrieving {config!r}." thrown in ansible/ansible.

Source

Thrown at lib/ansible/config/manager.py:564

        config: str,
        cfile: str | None = None,
        plugin_type: str | None = None,
        plugin_name: str | None = None,
        keys=None,
        variables=None,
        direct=None,
        *,
        templar: Templar | None = None,
    ) -> t.Any:
        """ wrapper """

        try:
            value, _drop = self.get_config_value_and_origin(config, cfile=cfile, plugin_type=plugin_type, plugin_name=plugin_name,
                                                            keys=keys, variables=variables, direct=direct, templar=templar)
        except AnsibleError:
            raise
        except Exception as ex:
            raise AnsibleError(f"Unhandled exception when retrieving {config!r}.") from ex
        return value

    def get_config_default(self, config: str, plugin_type: str | None = None, plugin_name: str | None = None) -> t.Any:
        """Return the default value for the specified configuration."""
        return self.get_configuration_definitions(plugin_type, plugin_name)[config]['default']

    def get_config_value_and_origin(
            self,
            config: str,
            cfile: str | None = None,
            plugin_type: str | None = None,
            plugin_name: str | None = None,
            keys=None,
            variables=None,
            direct=None,
            *,
            templar: Templar | None = None
    ) -> tuple[str, t.Any]:

View on GitHub (pinned to 9cf16a4aca)

Solutions

  1. Check that the config definition file exists and is readable.
  2. Run with -vvv to see the underlying exception and fix the reported cause.
  3. Verify no syntax errors exist in the plugin's config definition.

When it happens

Trigger: Thrown at lib/ansible/config/manager.py:564 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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