Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-106

Importer should explicitly fail imports

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 1.2
    • None
    • None
    • None
    • False
    • False
    • When an error is encountered during import, the error should be reported in the UI, ideally with a specific message.
    • Undefined

      related to AAH-105, the importer doesn't report failure when an error is encountered.

      As seen in the linked issue, the importer simply spins when a invalid format error is encountered. Instead, the error should be reported in the UI, ideally with a message that's more specific than 'invalid format'.

      Right now the importer throws an exception and continues to try to import, rather than stop and report failure.

      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]: Traceback (most recent call last):
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     rv = job.perform()
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     self._result = self._execute()
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     return self.func(*self.args, **self.kwargs)
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/galaxy_ng/app/tasks/publishing.py", line 46, in import_and_move_to_staging
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     repository_pk=inbound_repository_pk)
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 130, in import_collection
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     artifact_file, filename=filename, logger=user_facing_logger
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/galaxy_importer/collection.py", line 56, in import_collection
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     return _import_collection(file, filename, logger, cfg)
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/galaxy_importer/collection.py", line 76, in _import_collection
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     data = CollectionLoader(extract_dir, filename, cfg=cfg, logger=logger).load()
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/galaxy_importer/collection.py", line 141, in load
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     self._load_collection_manifest()
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:   File "/usr/lib/python3.6/site-packages/galaxy_importer/collection.py", line 174, in _load_collection_manifest
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]:     raise exc.ManifestValidationError(str(e))
      Oct 30 18:35:07 ip-10-0-15-160.ec2.internal rq[54779]: galaxy_importer.exceptions.ManifestValidationError: Invalid collection metadata. 'namespace' has invalid format: reasonableLength

            hhummel@redhat.com Henderson Hummel (Inactive)
            hhummel@redhat.com Henderson Hummel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: