Project

Profile

Help

Issue #8571

Publishing raises forbidden checksum error when it shouldn't

Added by daviddavis 5 months ago. Updated 6 days ago.

Status:
MODIFIED
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.zPOST

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 656d93bb View on GitHub
Added by dalley 6 days ago

Fix publishing raises forbidden checksum error when it shouldn't

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

History

#1 Updated by daviddavis 5 months 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"
        }
    ]
}

#2 Updated by daviddavis 5 months ago

  • Description updated (diff)

#3 Updated by daviddavis 5 months ago

  • Description updated (diff)

#4 Updated by dalley 5 months ago

  • Triaged changed from No to Yes

#5 Updated by dalley 17 days ago

  • Sprint set to Sprint 104

#6 Updated by dalley 17 days ago

  • Status changed from NEW to POST
  • Assignee set to dalley

#7 Updated by dalley 17 days ago

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

#9 Updated by rchan 10 days ago

  • Sprint changed from Sprint 104 to Sprint 105

#10 Updated by dalley 8 days ago

  • Sprint/Milestone set to 3.14.4

#11 Updated by dalley 6 days ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF