{"record":{"id":"ba8bdbfbbf536fe8","repo":"ansible/ansible","slug":"manifest-omit-default-directives-was-set-to-true","errorCode":null,"errorMessage":"\"manifest.omit_default_directives\" was set to True, but no directives were defined in \"manifest.directives\". This would produce an empty collection artifact.","messagePattern":"\"manifest\\.omit_default_directives\" was set to True, but no directives were defined in \"manifest\\.directives\"\\. This would produce an empty collection artifact\\.","errorType":"validation","errorClass":"AnsibleError","httpStatus":null,"severity":"error","filePath":"lib/ansible/galaxy/collection/__init__.py","lineNumber":1116,"sourceCode":"    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:\n        directives.extend(control.directives)\n    else:\n        directives.extend([\n            'include meta/*.yml',\n            'include *.txt *.md *.rst *.license COPYING LICENSE',\n            'recursive-include .reuse **',\n            'recursive-include LICENSES **',\n            'recursive-include tests **',\n            'recursive-include docs **.rst **.yml **.yaml **.json **.j2 **.txt **.license',\n            'recursive-include roles **.yml **.yaml **.json **.j2 **.license',\n            'recursive-include playbooks **.yml **.yaml **.json **.license',\n            'recursive-include changelogs **.yml **.yaml **.license',","sourceCodeStart":1098,"sourceCodeEnd":1134,"githubUrl":"https://github.com/ansible/ansible/blob/9cf16a4aca7898481c257f1e17ad28d0b67b1f85/lib/ansible/galaxy/collection/__init__.py#L1098-L1134","documentation":"Raised by _build_files_manifest_distlib when 'manifest.omit_default_directives' is True but 'manifest.directives' is empty/absent. Omitting the default directives means no files would be selected at all, producing a collection tarball with no payload — almost certainly a misconfiguration, so the build fails early instead of shipping an empty artifact.","triggerScenarios":"galaxy.yml with 'manifest: {omit_default_directives: true}' and no 'directives' key, or an empty 'directives: []'.","commonSituations":"Enabling the flag as scaffolding 'for later' without adding directives; deleting directives while debugging and forgetting to restore them.","solutions":["Add at least one directive, e.g. 'directives: [\"recursive-include . **\"]'","Or set 'omit_default_directives: false' (or remove it) so the default include set applies"],"exampleFix":"# before (galaxy.yml)\nmanifest:\n  omit_default_directives: true\n\n# after (galaxy.yml)\nmanifest:\n  omit_default_directives: true\n  directives:\n    - 'recursive-include plugins **'\n    - 'include *.md'","handlingStrategy":"validation","validationCode":"import yaml\n\ndef omit_has_directives(path='galaxy.yml'):\n    m = yaml.safe_load(open(path)).get('manifest') or {}\n    return not (m.get('omit_default_directives') and not m.get('directives'))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whenever omit_default_directives is true, immediately add at least one directive in the same edit","Add a CI assertion that omitted defaults plus empty directives never ships"],"tags":["ansible-galaxy","build","manifest","configuration"],"backgroundTag":null,"analyzedSha":"9cf16a4aca7898481c257f1e17ad28d0b67b1f85","analyzedAt":"2026-08-15T00:15:47.100Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}