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 3.16.1.2 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 3.16.1.2, 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 3.16.1.2 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
—|--------------------------|----------------------
ID | FILENAME | SOURCE RPM |
---|---|---|
14 | walrus-0.71-1.noarch.rpm | walrus-0.71-1.src.rpm |
15 | walrus-5.21-1.noarch.rpm | walrus-5.21-1.src.rpm |
— | -------------------------- | ---------------------- |
[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?
katello-3.16.1-1.el7.noarch
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
Of course:
# foreman-rake console
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
Loading production environment (Rails 6.0.3.1)
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.
Hi @cintrix84,
I can execute against one of my broken repos but my issue is slightly different and I have opened another support issue ([Katello] 3.16.1.2 “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.
foreman-rake console
Loading production environment (Rails 6.0.3.1)
irb(main):001:0> Katello::Repository.find(28).version_href
=> “/pulp/api/v3/repositories/rpm/rpm/0676d8d3-6782-4bfe-9a07-865a4048e13e/versions/1/”
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:
/pulp/api/v3/repositories/rpm/rpm/0676d8d3-6782-4bfe-9a07-865a4048e13e/versions/1/”
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 6.0.3.1)
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 sosreport
.
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.
@jamie can you try the steps @Justin_Sherrill left and see if it helps getting the href back with your issue?
@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!