Bug 1505397
| Summary: | Uploading an invalid rpm should show better error message | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Nikhil Kathole <nkathole> | ||||
| Component: | Pulp | Assignee: | satellite6-bugs <satellite6-bugs> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.3.0 | CC: | bbuckingham, bmbouter, daviddavis, dkliban, egolov, ehelms, ggainey, ipanova, jcallaha, jortel, jpathan, lhellebr, mhrivnak, pcreech, pthomas, rchan, ttereshc | ||||
| Target Milestone: | 6.4.0 | Keywords: | Triaged | ||||
| Target Release: | Unused | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | pulp-rpm-2.16.4.1-1 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-10-16 19:26:00 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Nikhil Kathole
2017-10-23 13:51:51 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug. The Pulp upstream bug priority is at High. Updating the external tracker on this bug. The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug. The Pulp upstream bug status is at POST. Updating the external tracker on this bug. The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug. All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST. The Pulp upstream bug status is at ON_QA. Updating the external tracker on this bug. Failed QA in Satellite 6.4 Snap 7. There continues to be a non-helpful error message presented when upload invalid files to a rpm repo: Error during upload: Task bd2d23e7-ec06-4503-8791-b4586ed8f852: Katello::Errors::PulpError: RPM1016: Error reading uploaded package header. See attached gif Created attachment 1451480 [details]
error gif
Requesting needsinfo from upstream developer jortel because the 'FailedQA' flag is set. Based upon the error reported, going to move this to the pulp component.
Pasting below the pulp_task output from dynflow console:
pulp_tasks:
- exception:
task_type: pulp.server.managers.content.upload.import_uploaded_unit
_href: "/pulp/api/v2/tasks/537fefc1-a979-4520-903c-c4a151318ec6/"
task_id: 537fefc1-a979-4520-903c-c4a151318ec6
tags:
- pulp:repository:720db840-4bd4-4276-9ad2-73a78ccb6298
- pulp:action:import_upload
finish_time: '2018-06-25T20:05:09Z'
_ns: task_status
start_time: '2018-06-25T20:05:09Z'
traceback: |
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 529, in __call__
return super(Task, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 107, in __call__
return super(PulpTask, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/managers/content/upload.py", line 218, in import_uploaded_unit
unit_metadata, file_path, conduit, call_config)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/importer.py", line 63, in upload_unit
return upload.upload(repo, type_id, unit_key, metadata, file_path, conduit, config)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/upload.py", line 120, in upload
handlers[type_id](repo, type_id, unit_key, metadata, file_path, conduit, config)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/upload.py", line 384, in _handle_package
raise PulpCodedException(error_codes.RPM1016)
PulpCodedException: Error reading uploaded package header.
spawned_tasks: []
progress_report: {}
queue: reserved_resource_worker-0.example.com.dq2
state: error
worker_name: reserved_resource_worker-0.example.com
result:
error:
code: RPM1016
data: {}
description: Error reading uploaded package header.
sub_errors: []
_id:
"$oid": 5b314af5f533b23c09b69232
id: 5b314af5f533b23c09b69232
poll_attempts:
total: 1
failed: 1
Could you clarify what would be a helpful message? Headers are not correct - maybe it's not rpm at all, maybe file is just corrupted. Thanks! Requesting needsinfo from upstream developer jortel because the 'FailedQA' flag is set. Tanya, a better message could be something general like: "Invalid RPM" Or maybe something more specific like: "Invalid content: Expected RPM; received Python script, ASCII text executable" Requesting needsinfo from upstream developer jortel because the 'FailedQA' flag is set. The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug. Here is an additional commit which addresses the suggestion from comment#16. https://github.com/pulp/pulp_rpm/commit/f3e618b5eb0a2195ce5b31f37fe7f5ddc120bd8f It's a part of 3090 and it will be released in Pulp > 2.16.3. Failed QA in Satellite 6.4 Snap 16. Still continues to show a non-helpful error message presented when upload invalid files to a rpm repo: Error during upload: Task 8c5db9d9-b802-4892-b1ee-a7cadffa0671: Katello::Errors::PulpError: RPM1016: Error reading uploaded package header. does not shows error message according to commit from comment#19. $rpm -qa pulp-server pulp-server-2.16.3-1.el7sat.noarch Requesting needsinfo from upstream developer jortel because the 'FailedQA' flag is set. The commit for this change hasn't been released upstream (investigating why). So it should be cherry-picked to end up in 6.4.0 and for this BZ to be verified. https://github.com/pulp/pulp_rpm/commit/f3e618b5eb0a2195ce5b31f37fe7f5ddc120bd8f The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug. The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug. needinfo UI is showing proper error message while uploading invalid file but the log still shows "500 Internal Server Error", is it ok if the log shows such message. pasting bellow error from production.log and attached log file too. 2018-08-28T03:44:35 [E|bac|] RPM1016: Uploaded file is not a valid RPM. (Katello::Errors::PulpError) /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/lib/actions/pulp/abstract_async_task.rb:121:in `block in external_task=' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/lib/actions/pulp/abstract_async_task.rb:119:in `each' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/lib/actions/pulp/abstract_async_task.rb:119:in `external_task=' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action/polling.rb:98:in `poll_external_task_with_rescue' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action/polling.rb:21:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action/cancellable.rb:13:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/lib/actions/pulp/abstract_async_task.rb:45:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/action.rb:538:in `block (3 levels) in execute_run' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:26:in `pass' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware.rb:18:in `pass' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware.rb:31:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:22:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware/stack.rb:26:in `pass' /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.0.5/lib/dynflow/middleware.rb:18:in `pass' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/lib/actions/middleware/remote_action.rb:16:in `block in run' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user' /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.17/app/models/katello/concerns/user_extensions.rb:21:in `cp_config' Verified with Sat 6.4 snap 19. Used reproducer from OP. Note that repo type must be "yum". The notification now says "Error during upload: Task <ID>: Katello::Errors::PulpError: RPM1016: Uploaded file is not a valid RPM.". production.log now contains "2018-08-29T06:07:14 [E|bac|] RPM1016: Uploaded file is not a valid RPM. (Katello::Errors::PulpError)" + traceback and "2018-08-29T06:07:15 [E|app|330ca] ForemanTasks::TaskError: Task 88aee4a5-ee1b-43b6-b1b2-08172bfed172: Katello::Errors::PulpError: RPM1016: Uploaded file is not a valid RPM." + traceback which seems correct to me. Jameer, I can't see any 500 ISE in logs, not even in your snip. The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:2927 The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug. |