Project

Profile

Help

Issue #369

Pulp does not return an error when uploading an ISO named PULP_MANIFEST

Added by rbarlow almost 7 years ago. Updated over 1 year ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The ISOImporter performs some validation checks on uploaded ISOs, and if those validation checks fail, it raises a ValueError. Unfortunately, Pulp doesn't offer any way for Importers to indicate that they don't wish to accept an upload due to such problems, and the ValueError is not handled gracefully leading to a poor user experience.

For example, if a user tries to upload an ISO called PULP_MANIFEST (which is disallowed as of bug #973678), the upload will be unsuccessful, but the user will not see the error message that indicates why at the client.

$ pulp-admin iso repo uploads upload --repo-id test -f PULP_MANIFEST
----------------------------------------------------------------------
Unit Upload
--------------------------------------------------------------------

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: PULP_MANIFEST
... completed

Creating upload requests on the server...
[==================================================] 100%
Initializing: PULP_MANIFEST
... completed

Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.

Uploading: PULP_MANIFEST
... completed

Importing into the repository...
The web server reported an error trying to access the Pulp application. The
likely cause is that the pulp-manage-db script has not been run prior to
starting the server. More information can be found in Apache's error log file on
the server itself.

It is also unhelpful that our default error message for unhandled exceptions tells the user that they probably need to run pulp-manage-db. From our pulp.log:

2013-09-05 11:31:23,073 pulp.server.managers.content.upload:ERROR: Error from the importer while importing uploaded unit to repository [test]
Traceback (most recent call last):
File "/home/rbarlow/devel/pulp/server/pulp/server/managers/content/upload.py", line 227, in import_uploaded_unit
importer_instance.upload_unit(transfer_repo, unit_type_id, unit_key, unit_metadata, file_path, conduit, call_config)
File "/home/rbarlow/devel/pulp_rpm/pulp_rpm/src/pulp_rpm/plugins/importers/iso_importer/importer.py", line 129, in upload_unit
iso.validate(full_validation=validate)
File "/home/rbarlow/devel/pulp_rpm/pulp_rpm/src/pulp_rpm/common/models.py", line 409, in validate
raise ValueError(msg)
ValueError: An ISO may not be named PULP_MANIFEST, as it conflicts with the name of the manifest during publishing.

It would be nice to provide that error message to the end user.

+ This bug was cloned from Bugzilla Bug #1004850 +

History

#1 Updated by cduryee almost 7 years ago

I attempted this on 2.5.0. pulp-admin let me upload a file named PULP_MANIFEST and a directory was created under /var/lib/pulp/content for it. However, the directory was empty, and a new unit was not created.

+ This comment was cloned from Bugzilla #1004850 comment 1 +

#2 Updated by bmbouter over 6 years ago

  • Severity changed from Medium to 2. Medium

#3 Updated by bmbouter over 2 years ago

  • Status changed from NEW to CLOSED - WONTFIX

#4 Updated by bmbouter over 2 years ago

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

#5 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

#6 Updated by bmbouter over 1 year ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Please register to edit this issue

Also available in: Atom PDF