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

API/UI should not allow 'invalid' namespace names.

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.2.0rc2
    • None
    • None
    • None
    • False
    • False
    • API/UI doesn't allow the creation of namespaces with upper-case names, returns a 400 with an explanation of the issue, and that explanation is displayed on the UI.
    • Undefined

      Importer requires lower-case for collection namespaces.

      Currently the API and the UI accept upper-case names during namespace creation. If you then create a collection with the matching namespace, the upload fails to complete (progress just spins - no failure obvious in the UI).

      journalctl traceback appears like so:

      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

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

                Created:
                Updated: