{"record":{"id":"cc2b0b8c262b48ee","repo":"ansible/ansible","slug":"invalid-manifest-provided-ex","errorCode":null,"errorMessage":"Invalid \"manifest\" provided: {ex}","messagePattern":"Invalid \"manifest\" provided: (.+?)","errorType":"exception","errorClass":"AnsibleError","httpStatus":null,"severity":"error","filePath":"lib/ansible/galaxy/collection/__init__.py","lineNumber":1104,"sourceCode":"\n    manifest['files'].sort(key=itemgetter('name'))\n\n    return manifest\n\n\ndef _build_files_manifest_distlib(b_collection_path, namespace, name, manifest_control,\n                                  license_file):\n    # type: (bytes, str, str, dict[str, t.Any], t.Optional[str]) -> FilesManifestType\n    if not HAS_DISTLIB:\n        raise AnsibleError('Use of \"manifest\" requires the python \"distlib\" library')\n\n    if manifest_control is None:\n        manifest_control = {}\n\n    try:\n        control = ManifestControl(**manifest_control)\n    except TypeError as ex:\n        raise AnsibleError(f'Invalid \"manifest\" provided: {ex}')\n\n    if not is_sequence(control.directives):\n        raise AnsibleError(f'\"manifest.directives\" must be a list, got: {control.directives.__class__.__name__}')\n\n    if not isinstance(control.omit_default_directives, bool):\n        raise AnsibleError(\n            '\"manifest.omit_default_directives\" is expected to be a boolean, got: '\n            f'{control.omit_default_directives.__class__.__name__}'\n        )\n\n    if control.omit_default_directives and not control.directives:\n        raise AnsibleError(\n            '\"manifest.omit_default_directives\" was set to True, but no directives were defined '\n            'in \"manifest.directives\". This would produce an empty collection artifact.'\n        )\n\n    directives = []\n    if control.omit_default_directives:","sourceCodeStart":1086,"sourceCodeEnd":1122,"githubUrl":"https://github.com/ansible/ansible/blob/9cf16a4aca7898481c257f1e17ad28d0b67b1f85/lib/ansible/galaxy/collection/__init__.py#L1086-L1122","documentation":"Raised by _build_files_manifest_distlib when constructing ManifestControl(**manifest_control) from the galaxy.yml 'manifest' value raises TypeError — i.e. the mapping contains keys that are not fields of ManifestControl (only 'directives' and 'omit_default_directives' are recognized). The original TypeError text is embedded so the offending key is visible.","triggerScenarios":"A galaxy.yml like 'manifest: {directive: [...]}' (typo'd singular key), or extra keys such as 'manifest: {directives: [...], strict: true}'. Constructing the dataclass with an unexpected kwarg raises TypeError, which is converted to this AnsibleError.","commonSituations":"Typos in manifest keys; copy/pasting draft documentation or blog examples that used different key names; leftover experimental keys from older proposals.","solutions":["Inspect the TypeError text in the message — it names the unexpected keyword argument(s)","Restrict 'manifest' to the supported keys: 'directives' (list of strings) and 'omit_default_directives' (bool)","Validate galaxy.yml against the current collection template/docs after upgrading ansible-core"],"exampleFix":"# before (galaxy.yml)\nmanifest:\n  directive:\n    - 'recursive-include roles **'\n\n# after (galaxy.yml)\nmanifest:\n  directives:\n    - 'recursive-include roles **'","handlingStrategy":"validation","validationCode":"import yaml\n\nALLOWED = {'directives', 'omit_default_directives'}\n\ndef manifest_keys_ok(path='galaxy.yml'):\n    manifest = yaml.safe_load(open(path)).get('manifest') or {}\n    bad = set(manifest) - ALLOWED\n    assert not bad, f'unexpected manifest keys: {bad}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Spell keys exactly: 'directives' (plural) and 'omit_default_directives'","Keep galaxy.yml under schema validation in CI to catch typo'd keys"],"tags":["ansible-galaxy","build","galaxy-yml","manifest","schema"],"backgroundTag":null,"analyzedSha":"9cf16a4aca7898481c257f1e17ad28d0b67b1f85","analyzedAt":"2026-08-15T00:15:47.100Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}