Using an empty role/role_name/meta/main.yml
file in a collection makes galaxy to fail importing the collection when publishing
This is an example of a failed task importing the collection to be published:
The error is not quite clear but is complaining on meta fields of a role.
"error": {
"traceback": " File \"/venv/lib64/python3.11/site-packages/pulpcore/tasking/tasks.py\", line 66, in _execute_task\n result = func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/app/galaxy_ng/app/tasks/publishing.py\", line 115, in import_and_auto_approve\n repo = _upload_collection(**kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/galaxy_ng/app/tasks/publishing.py\", line 65, in _upload_collection\n general_create(*general_args, **kwargs)\n File \"/venv/lib64/python3.11/site-packages/pulpcore/app/tasks/base.py\", line 37, in general_create\n serializer.is_valid(raise_exception=True)\n File \"/venv/lib64/python3.11/site-packages/rest_framework/serializers.py\", line 227, in is_valid\n self._validated_data = self.run_validation(self.initial_data)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/rest_framework/serializers.py\", line 429, in run_validation\n value = self.validate(value)\n ^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/pulp_ansible/app/serializers.py\", line 484, in validate\n return super().validate(data)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/pulpcore/plugin/serializers/content.py\", line 123, in validate\n data = self.deferred_validate(data)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/pulp_ansible/app/serializers.py\", line 494, in deferred_validate\n collection_info = process_collection_artifact(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/pulp_ansible/app/tasks/upload.py\", line 37, in process_collection_artifact\n importer_result = import_collection(\n ^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/galaxy_importer/collection.py\", line 78, in import_collection\n return _import_collection(file, filename, file_url, logger, cfg)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/galaxy_importer/collection.py\", line 135, in _import_collection\n data = CollectionLoader(extract_dir, filename, cfg=cfg, logger=logger).load()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/collection.py\", line 100, in load\n self.content_objs = list(self._load_contents())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/collection.py\", line 378, in _load_contents\n content_obj = loader.load()\n ^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/content.py\", line 180, in load\n description = self._get_metadata_description()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/venv/lib64/python3.11/site-packages/galaxy_importer/loaders/content.py\", line 220, in _get_metadata_description\n description = role_metadata[\"galaxy_info\"][\"description\"]\n ~~~~~~~~~~~~~^^^^^^^^^^^^^^^\n",
"description": "'NoneType' object is not subscriptable"
},
Later, it was found that empty meta causes it to fail, removing it allows the import of collection to complete and be published as in this test:
Is there any documentation available on the requirements of meta files for a role?
Thanks!