Project

Profile

Help

Issue #9587

closed

manually upload rpm packages

Added by TiagodCC over 2 years ago. Updated over 2 years ago.

Status:
CLOSED - NOTABUG
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:
Quarter:

Description

Hello All

I am currently developing an Ansible playbook to upload custom RPM packages to specific pulp repositories. It uses the pulp.squeezer collection and some API calls.
For this I have used the following documentations: https://docs.pulpproject.org/pulp_rpm/workflows/upload.html & https://docs.pulpproject.org/pulp_rpm/restapi.html#operation/

Following the upload of the file, the creation of rpm content and the association of the content with the desired repository, the change to the repository is published and distributed.
However, when Pulp is invoked via the browser, it becomes apparent that the package is not displayed with the actual package name, but with its "location_href" from the metadata.

Below you can find a snippet from the metadata of one of the affected packages:

<package type="rpm">
  <name>amsd</name>
  <arch>x86_64</arch>
  <version epoch="0" ver="2.5.0" rel="1675.24.rhel8"/>
  <checksum type="sha256" pkgid="YES">554b4534999d9e0b778c8c1825f1ae098fe858b36daeaa5ac7c38b81804ffb4a</checksum>
  <summary>Agentless Management Service</summary>
  <description>This package contains the helper daemon that provides information for iLO5
embedded health and alerting.</description>
  <packager>Hewlett-Packard Enterprise</packager>
  <url>http://www.hpe.com/go/proliantlinux</url>
  <time file="1637837726" build="1630381441"/>
  <size package="3026011" installed="8620992" archive="8632796"/>
  <location href="Packages/f/fcbdc174-f1f4-4277-8913-3e2ce843e028"/>
  <format>
    <rpm:license>MIT and BSD</rpm:license>
    <rpm:vendor>Hewlett-Packard Enterprise</rpm:vendor>
    <rpm:group>System Environment/Daemons</rpm:group>
    <rpm:buildhost>ablrh7ex6416.sde.rdlabs.hpecorp.net</rpm:buildhost>
    <rpm:sourcerpm>amsd-2.5.0-1675.24.rhel8.src.rpm</rpm:sourcerpm>
    <rpm:header-range start="872" end="55032"/>
    <rpm:provides>
      <rpm:entry name="config(amsd)" flags="EQ" epoch="0" ver="2.5.0" rel="1675.24.rhel8"/>
      <rpm:entry name="amsd(x86-64)" flags="EQ" epoch="0" ver="2.5.0" rel="1675.24.rhel8"/>
      <rpm:entry name="amsd" flags="EQ" epoch="0" ver="2.5.0" rel="1675.24.rhel8"/>
    </rpm:provides>
    <rpm:requires>
      <rpm:entry name="libc.so.6(GLIBC_2.17)(64bit)"/>
      <rpm:entry name="/bin/sh"/>
      <rpm:entry name="/bin/sh" pre="1"/>
      <rpm:entry name="systemd"/>
      <rpm:entry name="rtld(GNU_HASH)"/>
      <rpm:entry name="pciutils"/>
      <rpm:entry name="lsof"/>
      <rpm:entry name="libsystemd.so.0(LIBSYSTEMD_209)(64bit)"/>
      <rpm:entry name="libsystemd.so.0()(64bit)"/>
      <rpm:entry name="libstdc++.so.6(GLIBCXX_3.4.21)(64bit)"/>
      <rpm:entry name="libstdc++.so.6(GLIBCXX_3.4.20)(64bit)"/>
      <rpm:entry name="libstdc++.so.6(GLIBCXX_3.4)(64bit)"/>
      <rpm:entry name="libstdc++.so.6(CXXABI_1.3)(64bit)"/>
      <rpm:entry name="libstdc++.so.6()(64bit)"/>
      <rpm:entry name="librt.so.1(GLIBC_2.2.5)(64bit)"/>
      <rpm:entry name="librt.so.1()(64bit)"/>
      <rpm:entry name="librpmio.so.8()(64bit)"/>
      <rpm:entry name="librpm.so.8()(64bit)"/>
      <rpm:entry name="libpthread.so.0(GLIBC_2.2.5)(64bit)"/>
      <rpm:entry name="libpthread.so.0()(64bit)"/>
      <rpm:entry name="libm.so.6(GLIBC_2.2.5)(64bit)"/>
      <rpm:entry name="libm.so.6()(64bit)"/>
      <rpm:entry name="libjson-c.so.4()(64bit)"/>
      <rpm:entry name="libgcc_s.so.1(GCC_3.0)(64bit)"/>
      <rpm:entry name="libgcc_s.so.1()(64bit)"/>
      <rpm:entry name="libdl.so.2(GLIBC_2.2.5)(64bit)"/>
      <rpm:entry name="libdl.so.2()(64bit)"/>
      <rpm:entry name="coreutils"/>
      <rpm:entry name="bash"/>
      <rpm:entry name="/bin/sh"/>
    </rpm:requires>
    <rpm:conflicts>
      <rpm:entry name="hp-ams"/>
    </rpm:conflicts>
    <file>/sbin/smad_rev</file>
    <file>/sbin/smad</file>
    <file>/sbin/mr_cpqScsi_rev</file>
    <file>/sbin/mr_cpqScsi</file>
    <file>/sbin/cpqiScsi</file>
    <file>/sbin/cpqScsi_rev</file>
    <file>/sbin/cpqScsi</file>
    <file>/sbin/cpqIde_rev</file>
    <file>/sbin/cpqIde</file>
    <file>/sbin/cpqFca_rev</file>
    <file>/sbin/cpqFca</file>
    <file>/sbin/amsd_rev</file>
    <file>/sbin/amsd</file>
    <file>/sbin/ahslog</file>
    <file>/etc/sysconfig/smad_rev</file>
    <file>/etc/sysconfig/smad</file>
    <file>/etc/sysconfig/mr_cpqScsi_rev</file>
    <file>/etc/sysconfig/mr_cpqScsi</file>
    <file>/etc/sysconfig/cpqiScsi</file>
    <file>/etc/sysconfig/cpqScsi_rev</file>
    <file>/etc/sysconfig/cpqScsi</file>
    <file>/etc/sysconfig/cpqIde_rev</file>
    <file>/etc/sysconfig/cpqIde</file>
    <file>/etc/sysconfig/cpqFca_rev</file>
    <file>/etc/sysconfig/cpqFca</file>
    <file>/etc/sysconfig/amsd_rev</file>
    <file>/etc/sysconfig/amsd</file>
    <file>/etc/sysconfig/ahslog</file>
  </format>
</package>

The package is located at (as mentioned in the metadata). The desired place would look something like this:

The package can be found and installed via clients, but this makes it more difficult to understand.
I unfortunately didn't find anything in the documentation about this.

I therefore wanted to ask what the reason for this is and how to fix it.

Thanks in advance for the answer.


Related issues

Related to RPM Support - Issue #8720: Published RPM metadata isn't sorted properlyCLOSED - DUPLICATEActions
Actions #1

Updated by TiagodCC over 2 years ago

To rule out an Ansible issue with displaying the location HREFs of self-uploaded packages, I uploaded a package to a repository using the pulp-cli commands below:

*pulp artifact upload --file "amsd-2.3.1-1459.1.rhel7.x86_64.rpm"
pulp rpm content create --sha256 "SHA256XXXXX" --relative-path "XXXXX"
pulp rpm repository content add --repository "REPONAME" --package-href "/pulp/api/v3/content/rpm/packages/XXXXX"
pulp rpm publication create --repository "REPONAME"
pulp rpm distribution update --publication "/pulp/api/v3/publications/rpm/rpm/XXXXX/" --base-path "XXXXX" --name "XXXXX"*

Here are the package information:

{
  "pulp_href": "/pulp/api/v3/content/rpm/packages/XXXXX/",
  "pulp_created": "2021-12-02T10:29:09.270535Z",
  "sha256": "XXXXX",
  "name": "amsd",
  "epoch": "0",
  "version": "2.3.1",
  "release": "1459.1.rhel7",
  "arch": "x86_64",
  "checksum_type": "sha256",
  "summary": "Agentless Management Service",
  "description": "This package contains the helper daemon that provides information for iLO5\nembedded health and alerting.",
  "url": http://www.hpe.com/go/proliantlinux,
  "changelogs": [
    [
      "HP Linux Development Linux_SWdeliverables@external.groups.hpe.com 2.3.1-1459.1.rhel7",
      1280318400,
      "- ENHANCEMENTS"
    ]
  ],
  "obsoletes": [],
  "suggests": [],
  "enhances": [],
  "recommends": [],
  "supplements": [],
  "location_base": "",
  "location_href": "fdf5a41c-7efb-4e77-b94b-dce447d706dc",
  "rpm_buildhost": "ablrh7ex6413.sde.rdlabs.hpecorp.net",
  "rpm_group": "System Environment/Daemons",
  "rpm_license": "MIT and BSD",
  "rpm_packager": "Hewlett-Packard Enterprise",
  "rpm_sourcerpm": "amsd-2.3.1-1459.1.rhel7.src.rpm",
  "rpm_vendor": "Hewlett-Packard Enterprise",
  "rpm_header_start": 872,
  "rpm_header_end": 52791,
  "is_modular": false,
  "size_archive": 6340864,
  "size_installed": 6333816,
  "size_package": 2901377,
  "time_build": 1616643775,
  "time_file": 1638440949
}

The package is still displayed as location HREF (in this case "fdf5a41c-7efb-4e77-b94b-dce447d706dc") in the web browser. Therefore, I assume that this behavior is not associated with the use of Ansible.

Actions #2

Updated by ttereshc over 2 years ago

  • Description updated (diff)
Actions #3

Updated by ggainey over 2 years ago

Here's the sequence that works for me:

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ pulp artifact upload --file ./kangaroo-0.2-1.noarch.rpm 
Uploading file ./kangaroo-0.2-1.noarch.rpm
{
  "pulp_href": "/pulp/api/v3/artifacts/cac636b7-7fe1-401f-8f2d-db2d79ffd0b0/",
  "pulp_created": "2021-12-09T14:00:34.637843Z",
  "file": "artifact/83/3af594bc0ba31256045ed1fb17d3df2d8341a89b0c5a9bf610dd6103ce4cc8",
  "size": 1875,
  "md5": null,
  "sha1": "004ee29c029d1425705eca461e489d0f378d3e8c",
  "sha224": "01e3f2a5b2ed3f1199a06e6c44aac83935cbd66f958a30aa7d25a4f4",
  "sha256": "833af594bc0ba31256045ed1fb17d3df2d8341a89b0c5a9bf610dd6103ce4cc8",
  "sha384": "750a5b74afe777775425dc59f500623852ba1de7d8d1ce4879fee426cbbfea959c1db1c510bca4a0dbaf0c84efc0e19b",
  "sha512": "35ba692a7a7b2d84366b0158147e7ede46f380c0e6acdf3918c4b09e8b72216da158545e848ab18d79aea0404f340e5f20aff7772df6a404710c714bad222773"
}


(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ pulp rpm content create --sha256 "833af594bc0ba31256045ed1fb17d3df2d8341a89b0c5a9bf610dd6103ce4cc8" --relative-path "kangaroo-0.2-1.noarch.rpm"
Started background task /pulp/api/v3/tasks/ea2de705-fd53-4ffd-a7ec-0b2587410df2/
Done.
{
  "pulp_href": "/pulp/api/v3/content/rpm/packages/440f467d-84ba-4047-96ab-fbda9973ed23/",
  "pulp_created": "2021-12-09T14:01:17.366546Z",
  "md5": null,
  "sha1": "004ee29c029d1425705eca461e489d0f378d3e8c",
  "sha224": "01e3f2a5b2ed3f1199a06e6c44aac83935cbd66f958a30aa7d25a4f4",
  "sha256": "833af594bc0ba31256045ed1fb17d3df2d8341a89b0c5a9bf610dd6103ce4cc8",
  "sha384": "750a5b74afe777775425dc59f500623852ba1de7d8d1ce4879fee426cbbfea959c1db1c510bca4a0dbaf0c84efc0e19b",
  "sha512": "35ba692a7a7b2d84366b0158147e7ede46f380c0e6acdf3918c4b09e8b72216da158545e848ab18d79aea0404f340e5f20aff7772df6a404710c714bad222773",
  "artifact": "/pulp/api/v3/artifacts/cac636b7-7fe1-401f-8f2d-db2d79ffd0b0/",
  "name": "kangaroo",
  "epoch": "0",
  "version": "0.2",
  "release": "1",
  "arch": "noarch",
  "pkgId": "833af594bc0ba31256045ed1fb17d3df2d8341a89b0c5a9bf610dd6103ce4cc8",
  "checksum_type": "sha256",
  "summary": "A dummy package of kangaroo",
  "description": "A dummy package of kangaroo",
  "url": "http://tstrachota.fedorapeople.org",
  "changelogs": [],
  "files": [
    [
      "",
      "/tmp/",
      "kangaroo.txt"
    ]
  ],
  "requires": [],
  "provides": [
    [
      "kangaroo",
      "EQ",
      "0",
      "0.2",
      "1",
      false
    ]
  ],
  "conflicts": [],
  "obsoletes": [],
  "suggests": [],
  "enhances": [],
  "recommends": [],
  "supplements": [],
  "location_base": "",
  "location_href": "kangaroo-0.2-1.noarch.rpm",
  "rpm_buildhost": "smqe-ws15",
  "rpm_group": "Internet/Applications",
  "rpm_license": "GPLv2",
  "rpm_packager": "",
  "rpm_sourcerpm": "kangaroo-0.2-1.src.rpm",
  "rpm_vendor": "",
  "rpm_header_start": 280,
  "rpm_header_end": 1721,
  "is_modular": false,
  "size_archive": 300,
  "size_installed": 42,
  "size_package": 1875,
  "time_build": 1331831376,
  "time_file": 1639058477
}



(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ pulp rpm repository create --name test
{
  "pulp_href": "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/",
  "pulp_created": "2021-12-09T14:01:37.242508Z",
  "versions_href": "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/versions/",
  "pulp_labels": {},
  "latest_version_href": "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/versions/0/",
  "name": "test",
  "description": null,
  "retain_repo_versions": null,
  "remote": null,
  "autopublish": false,
  "metadata_signing_service": null,
  "retain_package_versions": 0,
  "metadata_checksum_type": null,
  "package_checksum_type": null,
  "gpgcheck": 0,
  "repo_gpgcheck": 0,
  "sqlite_metadata": false
}



(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ pulp rpm repository content add --repository test --package-href /pulp/api/v3/content/rpm/packages/440f467d-84ba-4047-96ab-fbda9973ed23/
Started background task /pulp/api/v3/tasks/6d7a0536-f195-48a8-b0bd-42cf4a637d75/
Done.
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ http :/pulp/api/v3/tasks/6d7a0536-f195-48a8-b0bd-42cf4a637d75/
{
    "child_tasks": [],
    "created_resources": [
        "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/versions/1/"
    ],
    "error": null,
    "finished_at": "2021-12-09T14:02:14.260410Z",
    "logging_cid": "ebc6e4bfd22b4dddaa6cb8e4e06174e9",
    "name": "pulpcore.app.tasks.repository.add_and_remove",
    "parent_task": null,
    "progress_reports": [],
    "pulp_created": "2021-12-09T14:02:14.044079Z",
    "pulp_href": "/pulp/api/v3/tasks/6d7a0536-f195-48a8-b0bd-42cf4a637d75/",
    "reserved_resources_record": [
        "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/"
    ],
    "started_at": "2021-12-09T14:02:14.082483Z",
    "state": "completed",
    "task_group": null,
    "worker": "/pulp/api/v3/workers/8c53774f-3bfe-4656-ba91-f53a286dcd53/"
}




(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ pulp rpm publication create --repository test
Started background task /pulp/api/v3/tasks/b430e47e-87e5-4c5a-8400-41ebb6b89b21/
.Done.
{
  "pulp_href": "/pulp/api/v3/publications/rpm/rpm/b0a9d63c-c8f5-4f93-a9f0-cbd84883adf8/",
  "pulp_created": "2021-12-09T14:02:34.671979Z",
  "repository_version": "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/versions/1/",
  "repository": "/pulp/api/v3/repositories/rpm/rpm/fca3fe70-0515-41d1-902a-54c1acbbecc9/",
  "metadata_checksum_type": "sha256",
  "package_checksum_type": "sha256",
  "gpgcheck": 0,
  "repo_gpgcheck": 0,
  "sqlite_metadata": false
}



(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ pulp rpm distribution create --publication /pulp/api/v3/publications/rpm/rpm/b0a9d63c-c8f5-4f93-a9f0-cbd84883adf8/ --base-path test-rpm --name test
Started background task /pulp/api/v3/tasks/4a8d8bed-275e-4c07-aab9-0880ae011362/
.Done.
{
  "pulp_href": "/pulp/api/v3/distributions/rpm/rpm/a94e24c5-ce6a-4f6c-96a4-c679522b3eed/",
  "pulp_created": "2021-12-09T14:03:52.926666Z",
  "base_path": "test-rpm",
  "base_url": "http://pulp2-nightly-pulp3-source-centos7.padre-fedora.example.com/pulp/content/test-rpm/",
  "content_guard": null,
  "pulp_labels": {},
  "name": "test",
  "repository": null,
  "publication": "/pulp/api/v3/publications/rpm/rpm/b0a9d63c-c8f5-4f93-a9f0-cbd84883adf8/"
}

        

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$ http :/pulp/content/test-rpm/Packages/k/
        <!DOCTYPE html>
        <html>
            <body>
                <ul>
                    <li><a href="kangaroo-0.2-1.noarch.rpm">kangaroo-0.2-1.noarch.rpm</a></li>                
                </ul>
            </body>
        </html>
        

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 assets]$
Actions #4

Updated by ggainey over 2 years ago

  • Triaged changed from No to Yes
Actions #5

Updated by dalley over 2 years ago

Basically you should ignore the "location_href" that the REST API provides entirely. It provides no useful information, it never should have been added in the first place and it should probably be removed at some point. Sorry for the confusion on that front.

I've written a little bit about this issue previously over here: https://pulp.plan.io/issues/8720

Actions #6

Updated by dalley over 2 years ago

  • Related to Issue #8720: Published RPM metadata isn't sorted properly added
Actions #7

Updated by TiagodCC over 2 years ago

ggainey Thank you for the explanation and the example. Indeed, it was due to the relative-path that was given incorrectly. So now the problem could be solved.

Therefore, this issue can be closed.

Actions #8

Updated by ggainey over 2 years ago

  • Status changed from NEW to CLOSED - NOTABUG

/me cheers wildly - glad we figured it out!

closing

Also available in: Atom PDF