Project

Profile

Help

Issue #8571

closed

Publishing raises forbidden checksum error when it shouldn't

Added by daviddavis over 3 years ago. Updated about 3 years ago.

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

Description

Steps to reproduce:

  1. Enable md5 via ALLOWED_CONTENT_CHECKSUMS and sync down an md5 repository (eg https://fixtures.pulpproject.org/rpm-with-md5/)
  2. Disable md5 and run pulpcore-manager handle-artifact-checksums
  3. Now create a publication for your repository version using an allowed checksum:
http :/pulp/api/v3/publications/rpm/rpm/ repository_version=/pulp/api/v3/repositories/rpm/rpm/a1263205-e97a-452f-a674-f516714812c6/versions/1/ package_checksum_type="sha256"

You'll get this error:

ValueError: Package camel-0:0.1-1.noarch as content unit 6d518294-c03c-4cf1-b8ef-0e663b73274a contains forbidden checksum type 'md5', thus can't be published. Checksum must be one of the allowed checksum types.

I believe this check is faulty since it solely checks rpm_package.checksum_type and doesn't consider package_checksum_type.


Related issues

Copied to RPM Support - Backport #9332: Backport #8571 "Publishing raises forbidden checksum error when it shouldn't" to 3.14.zCLOSED - CURRENTRELEASEdalley

Actions
Actions #1

Updated by daviddavis over 3 years ago

Here's what my camel package looks like. Its checksum_type is md5 but also it has a sha256 checksum.

        {                                                                                                                                                                                     
            "arch": "noarch",                                                                                                                                                                 
            "artifact": "/pulp/api/v3/artifacts/bede35b5-28fe-4c4c-8797-8036d2a45bb9/",                                                                                                       
            "changelogs": [],                                                                                                                                                                 
            "checksum_type": "md5",                                                                                                                                                           
            "conflicts": [],                                                                                                                                                                  
            "description": "A dummy package of camel",                                                                                                                                        
            "enhances": [],                                                                                                                                                                   
            "epoch": "0",                                                                                                                                                                     
            "files": [                                                                                                                                                                        
                [                                                                                                                                                                             
                    null,                                                                                                                                                                     
                    "/tmp/",                                                                                                                                                                  
                    "camel.txt"                                                                                                                                                               
                ]                                                                                                                                                                             
            ],                                                                                                                                                                                
            "is_modular": false,
            "location_base": "",
            "location_href": "camel-0.1-1.noarch.rpm",
            "md5": null,
            "name": "camel",
            "obsoletes": [],
            "pkgId": "a3923b24d45c57431e1a1e7c3249878c",
            "provides": [
                [
                    "camel",
                    "EQ",
                    "0",
                    "0.1",
                    "1",
                    false
                ]
            ],
            "pulp_created": "2021-04-15T17:29:13.308853Z",
            "pulp_href": "/pulp/api/v3/content/rpm/packages/6d518294-c03c-4cf1-b8ef-0e663b73274a/",
            "recommends": [],
            "release": "1",
            "requires": [],
            "rpm_buildhost": "smqe-ws15",
            "rpm_group": "Internet/Applications",
            "rpm_header_end": 1697,
            "rpm_header_start": 280,
            "rpm_license": "GPLv2",
            "rpm_packager": "",
            "rpm_sourcerpm": "camel-0.1-1.src.rpm",
            "rpm_vendor": "",
            "sha1": null,
            "sha224": "bb325191e37933d9778efb47ae8d250e03249fb71c7be540932feb57",
            "sha256": "c5c34e1843847990d2c79b936309d6257279e26f907e20f9f58073a14525e1ef",
            "sha384": "e01817ea6087146204475e008f71f6735a0173787d8e8d934cd16ad5bd53446a5c735930d598ef3e6f2d654a1b88597d",
            "sha512": "8a303d3cbed42e8dc9335ab07012c44b3026163da2aa4cb282862a0e6d6c9eef026ff596637026ba3d9a84b7e7f3b290b794cd15c676e2aa75a0e8ae036cad94",
            "size_archive": 296,
            "size_installed": 42,
            "size_package": 1847,
            "suggests": [],
            "summary": "A dummy package of camel",
            "supplements": [],
            "time_build": 1331831360,
            "time_file": 1616674365,
            "url": "http://tstrachota.fedorapeople.org",
            "version": "0.1"
        }
    ]
}
Actions #2

Updated by daviddavis over 3 years ago

  • Description updated (diff)
Actions #3

Updated by daviddavis over 3 years ago

  • Description updated (diff)
Actions #4

Updated by dalley over 3 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by dalley over 3 years ago

  • Sprint set to Sprint 104
Actions #6

Updated by dalley over 3 years ago

  • Status changed from NEW to POST
  • Assignee set to dalley
Actions #7

Updated by dalley over 3 years ago

  • Copied to Backport #9332: Backport #8571 "Publishing raises forbidden checksum error when it shouldn't" to 3.14.z added
Actions #9

Updated by rchan over 3 years ago

  • Sprint changed from Sprint 104 to Sprint 105
Actions #10

Updated by dalley over 3 years ago

  • Sprint/Milestone set to 3.14.4

Added by dalley over 3 years ago

Revision 656d93bb | View on GitHub

Fix publishing raises forbidden checksum error when it shouldn't

closes: #8571 https://pulp.plan.io/issues/8571

Actions #11

Updated by dalley over 3 years ago

  • Status changed from POST to MODIFIED
Actions #12

Updated by dalley over 3 years ago

  • Sprint/Milestone changed from 3.14.4 to 3.16.0
Actions #13

Updated by pulpbot about 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF