How to reset pulp_container?

Hi all!

After upgrading pulpcore from 3.54.1 to 3.66.0 and pulp_container from 2.20.0 to 2.21.0 something broke:
I cannot access my containers anymore, even re-uploading them didn’t help.
So I tried to remove all containers and to start over, by removing the distributions, namespaces and running orphan cleanup. Oddly enough, “pulp container content list” still showed the containers.
Then I made a backup of my database, deleted all from container_*, re-created the namespace, set the roles and re-uploaded the container. Which was somehow rejected with these logs:

pulpcore-api[2596984]: pulp [60115527bda44bd481e3cbc61d09b674]: django.request:WARNING: Not Found: /v2/containers/mycontainer/blobs/sha256:f39ab84aada82e0712c8b60de7cbea78ad9540c2f7d9653694d44f4ea1560e56
pulpcore-api[2596984]: pulp [dc0a912be7a146cea06e5e4dc99e0cef]: django.request:WARNING: Not Found: /v2/containers/mycontainer/blobs/sha256:e673763aa7d1b4c3c44edcbc322449513d05b58ccf60d4e90fdd0fe8d1dfc3c4
pulpcore-api[2596984]: pulp [c765394aa8b341ff937ffa5128b93bc7]: django.request:WARNING: Not Found: /v2/containers/mycontainer/blobs/sha256:e547507a4043b33c85deb894f63394308a32c22049098bbf5ea9aecba4669e1a
pulpcore-api[2596984]: pulp [5edc1d9b38444c5b9c49d836b04c1f34]: django.request:WARNING: Not Found: /v2/containers/mycontainer/blobs/sha256:c317c9e0df809f8b77333d8adc47c576e32c6105d71a284eb6098210672cda19
postmaster[2600455]: 2024-10-29 14:33:00.381 UTC [2600455] ERROR:  duplicate key value violates unique constraint "core_artifact_sha256_pulp_domain_id_8efff3e8_uniq"
postmaster[2600455]: 2024-10-29 14:33:00.381 UTC [2600455] DETAIL:  Key (sha256, pulp_domain_id)=(e547507a4043b33c85deb894f63394308a32c22049098bbf5ea9aecba4669e1a, 018fb0c8-d45a-73d4-b217-bd5df52bf9c9) already exists.
postmaster[2600455]: 2024-10-29 14:33:00.381 UTC [2600455] STATEMENT:  INSERT INTO "core_artifact" ("pulp_id", "pulp_created", "pulp_last_updated", "file", "size", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "timestamp_of_interest", "pulp_domain_id") VALUES ('0192d8b1beda7cd3996557c6c09276df'::uuid, '2024-10-29 14:33:00.379744+00:00'::timestamptz, '2024-10-29 14:33:00.379759+00:00'::timestamptz, 'artifact/e5/47507a4043b33c85deb894f63394308a32c22049098bbf5ea9aecba4669e1a', 98877007, NULL, '320de0f43d19ee6a1d45d5d41a403bcc89db7600', '7f61232d3fb5d1000360b4543ec1a80296033b9cf61959cd3e1e89bb', 'e547507a4043b33c85deb894f63394308a32c22049098bbf5ea9aecba4669e1a', 'ea375612e942b5f4e628ad9e90d7371281713b90f4deffa2be8b915bbdb4c9f865e390e996664f89bf8d4edfbabbe1f3', '366405daf1a2bb1fa9a7d718bb9bdc827851295a4284d9705e74598ae8da82f5018bd5f9055208a0ea2316c4838e0f2f15ea12c159dd0e4b7da47e87b86d9f9e', '2024-10-29 14:33:00.380311+00:00'::timestamptz, '018fb0c8d45a73d4b217bd5df52bf9c9'::uuid)
pulpcore-api[2596984]: pulp [867e210765fb497c8cc1b3693f81f534]: django.request:WARNING: Not Found: /v2/containers/mycontainer/blobs/sha256:3aa3bd956a51a7c78c0d2cd50f588501a1d2e357a6a84810641d498548a6517b

I suspect an evil fsckup somewhere in my database. As it also holds hundreds of rpms, I don’t want to wipe everything to start over.

Is there a possibility to clean everything container-related from the database and the filesystem?

Thanks!

Did you make sure to remove the repositories as well before running orphan cleanup? [0] You got to manualy delete the normal repositories and the push repositories should be deleted when you delete the associated namespace. Make sure all the repositories are gone before running orphan cleanup, and use orphan_protection_time=0 to ensure all of the orphans get cleaned up.

[0] REST API - Pulp Project

HI gerrod, thanks!

As I’m using container-push-thingies, there were no ordinary repositories I could delete.
Running orphan cleanup with orphan_protection_time=0 did empty “pulp container content list”. \o/

That helped, thanks again!

(please disregard the 404 I mentioned, in case you read it. It was human error)

1 Like