Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing files in on-demand mode #1214

Open
vogll opened this issue Jan 8, 2025 · 16 comments
Open

Missing files in on-demand mode #1214

vogll opened this issue Jan 8, 2025 · 16 comments

Comments

@vogll
Copy link

vogll commented Jan 8, 2025

Version
"versions": [
{
"component": "core",
"version": "3.69.0",
"package": "pulpcore",
"module": "pulpcore.app",
"domain_compatible": true
},
{
"component": "deb",
"version": "3.4.0",
"package": "pulp_deb",
"module": "pulp_deb.app",
"domain_compatible": false
},
{
"component": "ostree",
"version": "2.4.4",
"package": "pulp-ostree",
"module": "pulp_ostree.app",
"domain_compatible": true
},
{
"component": "certguard",
"version": "3.69.0",
"package": "pulpcore",
"module": "pulp_certguard.app",
"domain_compatible": true
},
{
"component": "file",
"version": "3.69.0",
"package": "pulpcore",
"module": "pulp_file.app",
"domain_compatible": true
},
{
"component": "container",
"version": "2.22.0",
"package": "pulp-container",
"module": "pulp_container.app",
"domain_compatible": false
},
{
"component": "ansible",
"version": "0.23.1",
"package": "pulp-ansible",
"module": "pulp_ansible.app",
"domain_compatible": false
},
{
"component": "python",
"version": "3.12.5",
"package": "pulp-python",
"module": "pulp_python.app",
"domain_compatible": true
},
{
"component": "maven",
"version": "0.8.1",
"package": "pulp-maven",
"module": "pulp_maven.app",
"domain_compatible": false
},
{
"component": "rpm",
"version": "3.27.2",
"package": "pulp-rpm",
"module": "pulp_rpm.app",
"domain_compatible": true
}
],

Describe the bug
We have been using Pulp in on-demand mode for the Ubuntu archives (noble, noble-updates, noble-security) and only for the amd64 architecture. After several months of use, we observed that some artifacts previously used, reports 404 even though the files are present in /var/lib/pulp.

We haven't performed any resynchronizations other than the initial sync. For all repositories (noble, noble-updates, noble-security), we have created their own remote.

Pulp has been deployed in our Kubernetes cluster using the Pulp Operator. After the first occurence of the missing files we performed a redeploy.

Additional context
Here is the script I've used to test artifact presence:

#!/bin/bash
REPO_VERSION_HREF="/pulp/api/v3/repositories/deb/apt/0193d9f0-2e4d-7a4d-8d04-69a7855f2d11/versions/1/"
OUTPUT_FILE="artifacts-noble-20250107.txt"
BASE_URL="https://pulp.cloud.prz/pulp/content/ubuntu-noble-amd64/"
echo "" > $OUTPUT_FILE

# Step 1: List all content units in the repository version
CONTENT_UNITS=$(pulp deb content list --repository-version "$REPO_VERSION_HREF" --limit 10000)

# Step 2: Check each artifact's details
echo "Downloaded artifacts for repository version $REPO_VERSION_HREF:"
echo "$CONTENT_UNITS" | jq -c '.[]' | while read -r content_unit; do
    ARTIFACT_HREF=$(echo "$content_unit" | jq -r '.artifact // empty')
    if [ -n "$ARTIFACT_HREF" ]; then
       REL_PATH=$(echo "$content_unit" | jq -r '.relative_path // empty')
       FULL_URL=$BASE_URL/$REL_PATH
       if curl --head --silent --fail "$FULL_URL" > /dev/null; then
         echo "Exists: $FULL_URL" | tee -a "$OUTPUT_FILE"
       else
         echo "Not Found: $FULL_URL" | tee -a "$OUTPUT_FILE"
       fi
    fi
done

Here is the script for the initial sync

#!/bin/bash -x
REPOSITORY_NAME='ubuntu-noble-amd64'
REMOTE_NAME="${REPOSITORY_NAME}"
DISTRIBUTION_NAME="${REPOSITORY_NAME}"
SIGNING_SERVICE="deb-signing-service"
REMOTE_OPTIONS=(
  --url=http://archive.ubuntu.com/ubuntu/
  --distribution=noble
  --component=main
  --component=multiverse
  --component=universe
  --component=restricted
  --architecture=amd64
  --policy on_demand
)
pulp deb remote create --name=${REMOTE_NAME} ${REMOTE_OPTIONS[@]}
pulp deb repository create --name=${REPOSITORY_NAME} --remote=${REMOTE_NAME}
pulp deb repository sync --name=${REPOSITORY_NAME}
pulp deb publication create --repository=${REPOSITORY_NAME}
pulp deb distribution create --name=${DISTRIBUTION_NAME} --base-path=${REPOSITORY_NAME} --repository=${REPOSITORY_NAME}

pulp deb repository sync --name=${REPOSITORY_NAME} --remote=${REMOTE_NAME}
PUB_HREF=$(pulp deb publication create --repository=${REPOSITORY_NAME} | jq -r '.pulp_href')
pulp deb distribution update --name=${REPOSITORY_NAME} --publication=${PUB_HREF}  --base-path=${REPOSITORY_NAME}

@quba42
Copy link
Collaborator

quba42 commented Jan 9, 2025

After several months of use, we observed that some artifacts previously used, reports 404 even though the files are present in /var/lib/pulp.

I am struggling to think how this might be possible. My understanding how on demand works is that on the initial sync it creates a "remote artifact" which is essentially a download URL and some checksums. Once that artifact is needed for the first time, the file is downloaded and turned into a normal artifact that replaces the "remote artifact". At that point Pulp will never attempt to re-download the file again, so it should not be possible to get a 404.

Are you absolutely certain that you are getting 404 on a file that was already downloaded (and not say, a package with the same name and version, but a different checksum i.e. a different file that has not yet been downloaded)?

On a side note: The on demand implementation is entirely inherited from pulpcore. To my knowledge there are no pulp_deb plugin specific changes here. If we can find a clear reproducer for this issue, we will need to figure out if this is a pulpcore bug or some bad interaction with something on the plugin side.

@vogll
Copy link
Author

vogll commented Jan 9, 2025

Hi,
Below is my investigation of the artifact named cryptsetup_2.7.0-1ubuntu4.1_amd64.deb that returned a 404 error. Please review to ensure my findings are accurate. I have enabled debug logging, but no errors appear except for the aiohttp 404 response. Are there any other methods I can use to further debug this issue?

Thank you!

https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64/pool/main/c/cryptsetup/cryptsetup_2.7.0-1ubuntu4.1_amd64.deb

log

pulp [None]: pulpcore.content:DEBUG: Content App '22@pulp-content-6b4d88fb97-vk679' heartbeat written, sleeping for '7' seconds
::ffff:10.42.1.40 [09/Jan/2025:10:30:07 +0000] "GET /pulp/content/ubuntu-noble-updates-amd64/pool/main/c/cryptsetup/cryptsetup_2.7.0-1ubuntu4.1_amd64.deb HTTP/1.1" 404 174 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0"
pulp [None]: pulpcore.content:DEBUG: Content App '23@pulp-content-6b4d88fb97-vk679' heartbeat written, sleeping for '7' seconds

We have only one version of the repository.
Now i found package

(venv) vogll@deployer:/opt/pulp$ pulp deb content list --repository-version /pulp/api/v3/repositories/deb/apt/0193daab-70bb-7a1e-aec6-394e48640fa2/versions/1/ --package cryptsetup
[
  {
    "pulp_href": "/pulp/api/v3/content/deb/packages/0193daab-9832-7872-b726-ada5f2c159f2/",
    "prn": "prn:deb.package:0193daab-9832-7872-b726-ada5f2c159f2",
    "pulp_created": "2024-12-18T16:48:30.580629Z",
    "pulp_last_updated": "2024-12-18T16:48:30.580665Z",
    "artifact": "/pulp/api/v3/artifacts/01944140-e46d-717d-b2d3-5cdae9fa476b/",
    "relative_path": "pool/main/c/cryptsetup/cryptsetup_2.7.0-1ubuntu4.1_amd64.deb",
    "md5": null,
    "sha1": null,
    "sha224": "5bc5ca57f1a0676dccc8a2d12b1f2c2193d182f8b96326f227557c2f",
    "sha256": "d6eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8",
    "sha384": "1ececa6753663b9c14e053bdb2537020f886461bbeaff304ce1fb54b5b8dd8f8e468d92cebf13b05a54ad868a8fa21c6",
    "sha512": "c266ad3c33e08e653ca55361b72bf365c820be677896d97cef8817c99e5b73d06ea56a8f22c2c0c70fa2b463780a15c23a65e0ba5141982e2515af73165fcbbf",
    "package": "cryptsetup",
    "source": null,
    "version": "2:2.7.0-1ubuntu4.1",

Artifact sha224 to identify file

(venv) vogll@deployer:/opt/pulp$ pulp artifact list --sha224 5bc5ca57f1a0676dccc8a2d12b1f2c2193d182f8b96326f227557c2f
[
  {
    "pulp_href": "/pulp/api/v3/artifacts/01944140-e46d-717d-b2d3-5cdae9fa476b/",
    "prn": "prn:core.artifact:01944140-e46d-717d-b2d3-5cdae9fa476b",
    "pulp_created": "2025-01-07T14:52:39.408868Z",
    "pulp_last_updated": "2025-01-07T14:52:39.408910Z",
    "file": "artifact/d6/eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8",
    "size": 207834,
    "md5": null,
    "sha1": null,
    "sha224": "5bc5ca57f1a0676dccc8a2d12b1f2c2193d182f8b96326f227557c2f",

Open pulp content (kubectl exec)

bash-5.1$ ls -la /var/lib/pulp/media/artifact/d6/eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8
-rw-r--r-- 1 pulp pulp 207834 Jan  7 14:52 d6/eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8
(venv) vogll@deployer:/opt/pulp$ pulp artifact show --href /pulp/api/v3/artifacts/01944140-e46d-717d-b2d3-5cdae9fa476b/
{
  "pulp_href": "/pulp/api/v3/artifacts/01944140-e46d-717d-b2d3-5cdae9fa476b/",
  "prn": "prn:core.artifact:01944140-e46d-717d-b2d3-5cdae9fa476b",
  "pulp_created": "2025-01-07T14:52:39.408868Z",
  "pulp_last_updated": "2025-01-07T14:52:39.408910Z",
  "file": "artifact/d6/eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8",
  "size": 207834,
  "md5": null,
  "sha1": null,
  "sha224": "5bc5ca57f1a0676dccc8a2d12b1f2c2193d182f8b96326f227557c2f",
  "sha256": "d6eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8",
  "sha384": "1ececa6753663b9c14e053bdb2537020f886461bbeaff304ce1fb54b5b8dd8f8e468d92cebf13b05a54ad868a8fa21c6",
  "sha512": "c266ad3c33e08e653ca55361b72bf365c820be677896d97cef8817c99e5b73d06ea56a8f22c2c0c70fa2b463780a15c23a65e0ba5141982e2515af73165fcbbf"
}

@quba42
Copy link
Collaborator

quba42 commented Jan 9, 2025

Just on the off chance that the file is present at /var/lib/pulp/media/artifact/d6/eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8, but corrupted, perhaps try running:

sha256sum /var/lib/pulp/media/artifact/d6/eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8

That should return d6eac1d471955e33252a366c2faa34ab3fc492cbf194383e123ef1faca7fe9f8.

If the file is not corrupted, then it is there and Pulp should use the local file and not return 404 when it is accessed on the content app. I will try to get some pulpcore developer eyes on this issue.

@vogll
Copy link
Author

vogll commented Jan 9, 2025

Thanks for your effort. Sha256sum returned the same hash. Should I escalate this issue to pulp-core?

@mdellweg
Copy link
Member

mdellweg commented Jan 9, 2025

I'm not an expert for kubernetes nor the operator. It just sounds a bit weird to use file storage in such an environment.
How sure are you that all the services can see the files in the same way and are running with the same username and privileges?

@vogll
Copy link
Author

vogll commented Jan 10, 2025

By checking the running processes I see that all services are running under the same user. The affected files are the same after redeploying the modules with the same user/group/owner permissions.
Pulp deployment within Pulp-operator was defined by Pulp developers.
We use NFS as the backend storage.

@quba42
Copy link
Collaborator

quba42 commented Jan 10, 2025

@vogll Please open an issue in pulpcore. Make sure to link to this issue from the pulpcore one you open.

As a rule I don't like punting problems to somebody else, but I just don't know enough about the on_demand implementation to help. While some weird interaction between core and plugin is always possible, the feature itself lives in core and I don't see how to make any progress without getting pulpcore developers involved.

@vogll
Copy link
Author

vogll commented Jan 10, 2025

I did a new deployment and a new synchronization of Noble Ubuntu-updates. I found that all the same files were missing. That is, all the same file names as in the previous synchronization. Could it be a problem inside the deb (some regex) ? Here is list...


Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/v/vim/xxd_9.1.0016-1ubuntu7.5_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/v/vim/vim_9.1.0016-1ubuntu7.5_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/v/vim/vim-tiny_9.1.0016-1ubuntu7.5_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/v/vim/vim-runtime_9.1.0016-1ubuntu7.5_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/v/vim/vim-common_9.1.0016-1ubuntu7.5_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/u/update-manager/update-manager-core_24.04.9_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/u/update-manager/python3-update-manager_24.04.9_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/s/shadow/passwd_4.13+dfsg1-4ubuntu3.2_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/p/procps/procps_4.0.4-4ubuntu3.2_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/o/openssh/openssh-sftp-server_9.6p1-3ubuntu13.5_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/o/openssh/openssh-server_9.6p1-3ubuntu13.5_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/o/openssh/openssh-client_9.6p1-3ubuntu13.5_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/s/shadow/login_4.13+dfsg1-4ubuntu3.2_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/o/open-vm-tools/open-vm-tools_12.4.5-1~ubuntu0.24.04.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/p/procps/libproc2-0_4.0.4-4ubuntu3.2_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/llvm-toolchain-18/libllvm18_18.1.3-1ubuntu1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/lvm2/libdevmapper1.02.1_1.02.185-3ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/lvm2/libdevmapper-event1.02.1_1.02.185-3ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/llvm-toolchain-18/libclang1-18_18.1.3-1ubuntu1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/llvm-toolchain-18/libclang-cpp18_18.1.3-1ubuntu1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/c/cryptsetup/libcryptsetup12_2.7.0-1ubuntu4.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/a/audit/libaudit1_3.1.2-2.1build1.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/a/audit/libaudit-common_3.1.2-2.1build1.1_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/g/git/git_2.43.0-1ubuntu7.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/g/git/git-man_2.43.0-1ubuntu7.1_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/u/util-linux/bsdutils_2.39.3-9ubuntu6.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/lvm2/dmsetup_1.02.185-3ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/l/lvm2/dmeventd_1.02.185-3ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/d/dhcpcd/dhcpcd-base_10.0.6-1ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/c/cryptsetup/cryptsetup_2.7.0-1ubuntu4.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/c/cryptsetup/cryptsetup-initramfs_2.7.0-1ubuntu4.1_all.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/c/cryptsetup/cryptsetup-bin_2.7.0-1ubuntu4.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/b/busybox/busybox-static_1.36.1-6ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/b/busybox/busybox-initramfs_1.36.1-6ubuntu3.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/b/bind9/bind9-libs_9.18.30-0ubuntu0.24.04.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/b/bind9/bind9-host_9.18.30-0ubuntu0.24.04.1_amd64.deb
Not Found: https://pulp.cloud.prz/pulp/content/ubuntu-noble-updates-amd64//pool/main/b/bind9/bind9-dnsutils_9.18.30-0ubuntu0.24.04.1_amd64.deb

@mdellweg
Copy link
Member

What's up with the double slash (//) between amd64 and pool?

@vogll
Copy link
Author

vogll commented Jan 13, 2025

What's up with the double slash (//) between amd64 and pool?

This is created using a test script. Tests with a single slash have the same effect.

@quba42
Copy link
Collaborator

quba42 commented Jan 13, 2025

I did a new deployment and a new synchronization of Noble Ubuntu-updates.

Is this an immediate sync or an on_demand sync again?

@vogll
Copy link
Author

vogll commented Jan 13, 2025

On_demand

@vogll
Copy link
Author

vogll commented Jan 13, 2025

Seems to be that we found cause of the issue in the deb_module.

By comparing the version construction with the core module, we found that the deb_module uses a different version format. As a result, some artifacts cannot be found. Below is a comparison of some failed modules:

psql (13.15 (Debian 13.15-1.pgdg120+1))
Type "help" for help.

pulp=# select relative_path from deb_package where relative_path like '%vim-common%';
                     relative_path
--------------------------------------------------------
 pool/main/v/vim/vim-common_9.1.0016-1ubuntu7.5_all.deb
(1 row)

pulp=# select relative_path from core_publishedartifact where relative_path like '%vim-common%';
                      relative_path
----------------------------------------------------------
 pool/main/v/vim/vim-common_2:9.1.0016-1ubuntu7.5_all.deb
(1 row)
pulp=# select relative_path from core_publishedartifact where relative_path like '%libcryptsetup%';
                             relative_path
-----------------------------------------------------------------------
 pool/main/c/cryptsetup/libcryptsetup-dev_2:2.7.0-1ubuntu4.1_amd64.deb
 pool/main/c/cryptsetup/libcryptsetup12_2:2.7.0-1ubuntu4.1_amd64.deb
(2 rows)

pulp=# select relative_path from deb_package where relative_path like '%libcryptsetup%';
                            relative_path
---------------------------------------------------------------------
 pool/main/c/cryptsetup/libcryptsetup-dev_2.7.0-1ubuntu4.1_amd64.deb
 pool/main/c/cryptsetup/libcryptsetup12_2.7.0-1ubuntu4.1_amd64.deb
(2 rows)

Comparsion for the package vim-common

SELECT 
	"core_publishedartifact"."pulp_id", 
	"core_publishedartifact"."pulp_created", 
	"core_publishedartifact"."pulp_last_updated", 
	"core_publishedartifact"."relative_path", 
	"core_publishedartifact"."content_artifact_id", 
	"core_publishedartifact"."publication_id", 
	"core_contentartifact"."pulp_id", 
	"core_contentartifact"."pulp_created", 
	"core_contentartifact"."pulp_last_updated", 
	"core_contentartifact"."artifact_id", 
	"core_contentartifact"."content_id", 
	"core_contentartifact"."relative_path", 
	"core_artifact"."pulp_id", 
	"core_artifact"."pulp_created", 
	"core_artifact"."pulp_last_updated", 
	"core_artifact"."file", 
	"core_artifact"."size", 
	"core_artifact"."md5", 
	"core_artifact"."sha1", 
	"core_artifact"."sha224", 
	"core_artifact"."sha256", 
	"core_artifact"."sha384", 
	"core_artifact"."sha512", 
	"core_artifact"."timestamp_of_interest", 
	"core_artifact"."pulp_domain_id" 
FROM 
	"core_publishedartifact" 
INNER JOIN 
	"core_publication" 
ON (
	"core_publishedartifact"."publication_id" = "core_publication"."pulp_id"
) INNER JOIN 
	"deb_distributedpublication" 
ON (
	"core_publication"."pulp_id" = "deb_distributedpublication"."publication_id"
) INNER JOIN 
	"core_contentartifact"
ON (
	"core_publishedartifact"."content_artifact_id" = "core_contentartifact"."pulp_id"
) LEFT OUTER JOIN 
	"core_artifact" 
ON (
	"core_contentartifact"."artifact_id" = "core_artifact"."pulp_id"
) WHERE (
	"deb_distributedpublication"."pulp_id" IN (
		SELECT 
			U0."pulp_id" 
		FROM 
			"deb_distributedpublication" U0 
		WHERE (
				U0."distribution_id" = '01944fe65f6d7b22bc8ad435dfccb81c'::uuid 
			AND (
				U0."expires_at" >= '2025-01-13 12:32:17.645618+00:00'::timestamptz 
			OR 
				U0."expires_at" IS NULL
			))) 
			AND 
				"core_publishedartifact"."relative_path" = 'pool/main/v/vim/vim-common_9.1.0016-1ubuntu7.5_all.deb'
			) 
ORDER BY "deb_distributedpublication"."pulp_created" DESC LIMIT 1;

When querying for the relative path:

core_publishedartifact"."relative_path" = 'pool/main/v/vim/vim-common_9.1.0016-1ubuntu7.5_all.deb'

It fails.

Ubuntu-standart seems to be correct

                       relative_path
-----------------------------------------------------------
 pool/main/u/ubuntu-meta/ubuntu-standard_1.539.1_amd64.deb
(1 row)

pulp=# select relative_path from deb_package where relative_path like '%ubuntu-standard%';
                       relative_path
-----------------------------------------------------------
 pool/main/u/ubuntu-meta/ubuntu-standard_1.539.1_amd64.deb
(1 row)

The issue may lie in how the core and deb modules construct the relative path version/filename. The different ways in which the version is represented between core and deb modules might be causing some artifacts to be unrecognized.

@quba42
Copy link
Collaborator

quba42 commented Jan 13, 2025

I need to double check but my initial thought is that the deb_package should list the relative_path as actually synced from the upstream repo, while the publication artifact may by design diverge from this relative_path, because it uses the relative path format preferred/generated by the pulp_deb plugin. The affected cases you have identified appear to be packages with a version epoch that is not zero. This is a strong indication that the reason for the problem is related to a non-zero version epoch.

This in turn suggests that this is some bug within the pulp_deb plugin after all (and not something to do with the pulpcore on_demand sync).

This gives us a good idea where we should continue to investigate. Now I just need to find the time to do so.

@quba42
Copy link
Collaborator

quba42 commented Jan 14, 2025

Note to self: This issue in pulpcore: pulp/pulpcore#6200 (Update once we are sure if this is core or plugin).

@vogll
Copy link
Author

vogll commented Jan 17, 2025

Here is a workaround we used for this issue that might be helpful for debugging :

UPDATE deb_package SET relative_path = regexp_replace(relative_path, '[^/]+$', '') || package || '_' || version || '_' || architecture || '.deb';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants