Issue #2627
closedUploading drpm by pulp-admin with --checksum-type fails
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, ininit_
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.
Updated by bizhang about 7 years 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
Updated by pthomas@redhat.com about 7 years 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
Updated by bizhang about 7 years ago
- Status changed from NEW to POST
- Assignee set to bizhang
- Sprint/Milestone set to 34
- Triaged changed from No to Yes
Added by werwty about 7 years ago
Updated by bizhang about 7 years 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
Updated by bizhang about 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Merge pull request #1039 from werwty/bugfix/2627
Fix admin extension --checksum-type option