Skip to content

Instantly share code, notes, and snippets.

@ehelms
Last active June 3, 2018 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ehelms/62f69ecf2e067b3825d6c3e6d4334ac0 to your computer and use it in GitHub Desktop.
Save ehelms/62f69ecf2e067b3825d6c3e6d4334ac0 to your computer and use it in GitHub Desktop.
First, find the pulp_id for the repository having issues
foreman-rake console
> Katello::Repository.find(REPO_ID).pulp_id
Copy the value returned above, it should look like something crazy, e.g. Sat6-CI-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server
Now we alter mongo:
$ mongo
> use pulp_database
> db.repo_importers.find({'repo_id': 'Sat6-CI-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server'}, {repo_id: 1})
This should return the importer information, where we are looking for the _id, e.g.:
{ "_id" : ObjectId("57275a3b52eb2b65d82f790b"), "repo_id" : "Sat6-CI-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server" }
Now lets look at the data for this:
> db.repo_importers.find({_id: ObjectId("57275a3b52eb2b65d82f790b")}, {})
{ "_id" : ObjectId("57275a4152eb2b65d7aafcec"), "scratchpad" : { "repomd_revision" : 123255122 } }
Now what we want to do to force a full re-sync is to set repomd_revision field to null:
> db.repo_importers.update({_id: ObjectId("57275a4152eb2b65d7aafcec")}, {$set: {"scratchpad.repomd_revision": null}})
Re-check that the update went through:
> db.repo_importers.find({_id: ObjectId("57275a3b52eb2b65d82f790b")}, {})
{ "_id" : ObjectId("57275a4152eb2b65d7aafcec"), "scratchpad" : { "repomd_revision" : null } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment