Thanks for trying and confirming the upgrade didn’t help. Will report back with what to do next.
Thanks for the guidance. I’m still not seeing 22.214.171.124 for some reason. I’ve tried several things (rm -rf /var/cache/yum/*, uninstalled and reinstalled katello-repos, yum update katello-repos, yum upgrade). I’ll keep tinkering with it. It is katello version 126.96.36.199, correct? I have 3.16.1 installed. Thanks!
Oh 3.16.1 is the package, but if you go into the “About” page and then “Plugins” from the UI (it will be in the “Administer” section).
I am willing to bet you have 188.8.131.52 installed.
Ah, yes it is. Sorry, I was only checking with rpm.
I tested with a test repo of ours and was able to remove a package from the UI/CLI:
[root@katello ~]# hammer package list --search walrus
[root@katello ~]# hammer repository remove-content --id 1 --ids 14
Repository content removed.
Was this a CentOS or Red Hat repo you were using? Also is this repo in a content view?
This is not a OS related repo. It is not synced from an upstream repo, its just my own repository that I created with Katello and added about 10 packages to.
It is part of a content view. Could that cause issues with trying to remove packages? I’m still very green when it comes to Katello, so apologies if I’m missing anything that would be obvious.
That should be fine to do, since the content view makes a copy of the repo.
I tried here and was able to remove packages, the next time the content view gets published it will just have less packages in it. I was thinking something else. The repo can not be removed until it it taken out of the content view.
I am working on a patch I can give you to tell us what repo it is looking for. Upon talking to another developer it seems there is no repo reference to the package.
Can you post the output of the following commands for me:
# foreman-rake console Katello::Repository.find(106).version_href exit
# foreman-rake console API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache. Loading production environment (Rails 184.108.40.206) irb(main):001:0> Katello::Repository.find(106).version_href => "/pulp/api/v3/repositories/rpm/rpm/3f33e4ad-c860-4535-bdf4-459f9b860669/versions/17/"
Can I have you post the output of the same command too, replace x with the repo ID you are trying to delete from:
# foreman-rake console Katello::Repository.find(x).version_href exit
Oh, it is actually repo ID “106”. Unless I am misunderstanding your ask.
Yep I got yours, I am working with another developer to get your reference back. I was seeing if the same output would return for @jamie or if we would get something different other than a uuid.
I can execute against one of my broken repos but my issue is slightly different and I have opened another support issue ([Katello] 220.127.116.11 “NoMethodError: undefined method `repository_href’ for nil:NilClass” when syncing yum repos) so as not to hijack @fresh-pie’s thread. However, I’d be glad to assist with troubleshooting on this issue.
Loading production environment (Rails 18.104.22.168)
Hi! First lets check something, run foreman-rake console and run:
REPO_ID = 106 Katello::Pulp3::RepositoryReference.where(:root_repository_id => Katello::Repository.find(REPO_ID).root_id, :content_view_id => Katello::Repository.find(REPO_ID).organization.library )
make sure to set the REPO_ID to whatever your repository _id actually is. I’m expecting that will return nothing (or an empty array). If it returns something like:
[#<Katello::Pulp3::RepositoryReference:0x000000000c225c48 id: 1, repository_href: "/pulp/api/v3/repositories/container/container/a403416e-b6e2-4670-aaca-e5d5f9afe842/", content_view_id: 1, root_repository_id: 1>]
Stop, and let us know. If it does return an empty array, you can run:
href = "/pulp/api/v3/repositories/rpm/rpm/3f33e4ad-c860-4535-bdf4-459f9b860669/" Katello::Pulp3::RepositoryReference.create!(:root_repository_id => Katello::Repository.find(REPO_ID).root_id, :content_view_id => Katello::Repository.find(REPO_ID).organization.library.id, repository_href: href)
set ‘href’ equal to the first part of the string you got from the previous ‘version_href’ command chris asked you to run, so if you got:
remove the versions/1/ and the href would be:
href = "/pulp/api/v3/repositories/rpm/rpm/0676d8d3-6782-4bfe-9a07-865a4048e13e/"
I’d also be interested in getting a sosreport to look for any errors that may have caused this!
Hello! Sure, here is my foreman-rake console session:
# foreman-rake console API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache. Loading production environment (Rails 22.214.171.124) irb(main):001:0> REPO_ID = 106 => 106 irb(main):002:0> Katello::Pulp3::RepositoryReference.where(:root_repository_id => Katello::Repository.find(REPO_ID).root_id, :content_view_id => Katello::Repository.find(REPO_ID).organization.library ) => #<ActiveRecord::Relation > irb(main):003:0> href = "/pulp/api/v3/repositories/rpm/rpm/3f33e4ad-c860-4535-bdf4-459f9b860669/" => "/pulp/api/v3/repositories/rpm/rpm/3f33e4ad-c860-4535-bdf4-459f9b860669/" irb(main):004:0> Katello::Pulp3::RepositoryReference.create!(:root_repository_id => Katello::Repository.find(REPO_ID).root_id, :content_view_id => Katello::Repository.find(REPO_ID).organization.library.id, repository_href: href) => #<Katello::Pulp3::RepositoryReference id: 129, repository_href: "/pulp/api/v3/repositories/rpm/rpm/3f33e4ad-c860-45...", content_view_id: 2, root_repository_id: 14>
Working on getting you that
@fresh-pie are you able to remove rpms from that repo now?
Ah, so sorry for making you wait! My multi-tasking skills are not the sharpest
YES, it does work now! Thank you very much. I’m trying to understand exactly what I just did. Is there some kind of relation/reference between the actual repository and its “object” (lack of better word at the moment) that broke and I “re-connected”?
I’ve uploaded my
sosreport here. Was a little too big to attach to this thread.
Thanks for letting us know, I am updating our repo rake task that can correct broken repos to accommodate this situation going forward.
@fresh-pie yes there’s some association that was missing, and i’m not sure how it happened. Would it be possible to tar up /var/log/foreman/* and send it too? The sosreport didn’t provide enough information. Thanks!