Project

Profile

Help

Issue #2627

Uploading drpm by pulp-admin with --checksum-type fails

Added by yuzheng 4 months ago. Updated 2 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Severity:
2. Medium
Version:
2.12.1
Platform Release:
2.12.2
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No

Description

Tested version:

# rpm -qa|grep pulp-admin
pulp-admin-client-2.12.1-1.el7.noarch

Reproducing steps:

1. Create a rpm repo
# pulp-admin rpm repo create --repo-id test-repo1
Successfully created repository [test-repo1]

2. Upload a drpm to the repo
# pulp-admin rpm repo uploads drpm --repo-id test-repo1 --file test-alpha-1.1-1_1.1-2.noarch.drpm --checksum-type sha256
+----------------------------------------------------------------------+
                              Unit Upload
+----------------------------------------------------------------------+

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: test-alpha-1.1-1_1.1-2.noarch.drpm
... completed

Creating upload requests on the server...
[==================================================] 100%
Initializing: test-alpha-1.1-1_1.1-2.noarch.drpm
... 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
canceled entirely using the cancel command.

Uploading: test-alpha-1.1-1_1.1-2.noarch.drpm
[==================================================] 100%
3268/3268 bytes
... completed

Importing into the repository...
This command may be exited via ctrl+c without affecting the request.

[\]
Running...

Task Failed

The importer yum_importer indicated a failed response when uploading drpm unit
to repository test-repo1.

Deleting the upload request...
... completed

Log from Pulp server:

Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) unexpected error occurred importing uploaded file: The field 'checksum_type' does not exist on the document 'DRPM'
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) Traceback (most recent call last):
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/upload.py", line 118, in upload
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) handlers[type_id](repo, type_id, unit_key, metadata, file_path, conduit, config)
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/upload.py", line 418, in handle_package
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) unit = model_class(**rpm_data)
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/db/models.py", line 154, in init
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) super(NonMetadataPackage, self).
_init__(*args, **kwargs)
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) File "/usr/lib/python2.7/site-packages/pulp/server/db/model/__init__.py", line 55, in init
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) super(AutoRetryDocument, self).__init__(*args, **kwargs)
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) File "/usr/lib/python2.7/site-packages/mongoengine/base/document.py", line 80, in init
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) raise FieldDoesNotExist(msg)
Mar 9 11:11:01 dhcp-136-68 pulp: pulp_rpm.plugins.importers.yum.upload:ERROR: (18520-70880) FieldDoesNotExist: The field 'checksum_type' does not exist on the document 'DRPM'
Mar 9 11:11:01 dhcp-136-68 pulp: pulp.server.managers.content.upload:ERROR: (18520-70880) Error from the importer while importing uploaded unit to repository [test-repo1]
Mar 9 11:11:01 dhcp-136-68 pulp: pulp.server.managers.content.upload:ERROR: (18520-70880) Traceback (most recent call last):
Mar 9 11:11:01 dhcp-136-68 pulp: pulp.server.managers.content.upload:ERROR: (18520-70880) File "/usr/lib/python2.7/site-packages/pulp/server/managers/content/upload.py", line 223, in import_uploaded_unit
Mar 9 11:11:01 dhcp-136-68 pulp: pulp.server.managers.content.upload:ERROR: (18520-70880) unit_type=unit_type_id, summary=result['summary'], details=result['details']
Mar 9 11:11:01 dhcp-136-68 pulp: pulp.server.managers.content.upload:ERROR: (18520-70880) PulpCodedException: The importer yum_importer indicated a failed response when uploading drpm unit to repository test-repo1.

Uploading without specifying --checksum-type works.

Associated revisions

Revision 741613a6 View on GitHub
Added by werwty 3 months ago

Merge pull request #1039 from werwty/bugfix/2627

Fix admin extension --checksum-type option

History

#1 Updated by yuzheng 4 months ago

Sorry about the mess format...

#2 Updated by bmbouter 4 months ago

  • Description updated (diff)

I added "pre" tags. @yuzheng, thanks for filing.

#3 Updated by bizhang 3 months ago

It looks like we're storing the metadata as checksum_type here: https://github.com/pulp/pulp_rpm/blob/master/extensions_admin/pulp_rpm/extensions/admin/upload/package.py#L61

but in the model the field is called checksumtype: https://github.com/pulp/pulp_rpm/blob/master/plugins/pulp_rpm/plugins/db/models.py#L162

A workaround might be to use the rest API instead to bypass the admin extension naming: http://docs.pulpproject.org/dev-guide/integration/rest-api/content/upload.html

#4 Updated by pthomas@redhat.com 3 months ago

We have smash tests for both CLI & API but it doesn't seem to be using the --checksum-type

pulp_smash.tests.rpm.api_v2.test_upload_publish.UploadDrpmTestCase
pulp_smash.tests.rpm.cli.test_upload.UploadDrpmTestCase.test_upload

#5 Updated by bizhang 3 months ago

  • Status changed from NEW to POST
  • Assignee set to bizhang
  • Sprint/Milestone set to Sprint 16
  • Triaged changed from No to Yes

#6 Updated by bizhang 3 months ago

  • Project changed from Pulp to RPM Support

#7 Updated by bizhang 3 months ago

  • Status changed from POST to MODIFIED

#8 Updated by pthomas@redhat.com 3 months ago

  • Smash Test set to 585

#9 Updated by bizhang 3 months ago

  • Platform Release set to 2.12.2

Cherry picked changes back into 2.12-dev where it should've been put in the first place https://github.com/pulp/pulp_rpm/commit/8edc7f5cd9698b59a78e3465ea999f5a61a050e8

#10 Updated by bizhang 3 months ago

  • Status changed from MODIFIED to ON_QA

#11 Updated by bizhang 2 months ago

  • Status changed from ON_QA to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF