Bug 1228165
Summary: | [upgrade] Could not find Content Host with exact name <capsule_fqdn> (Katello::Errors::CapsuleContentMissingConsumer): On synchronising contents from upgraded sat6 to upgraded capsule | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sachin Ghai <sghai> | ||||||||||
Component: | Upgrades | Assignee: | Stephen Benjamin <stbenjam> | ||||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Sachin Ghai <sghai> | ||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | unspecified | ||||||||||||
Version: | 6.1.0 | CC: | bbuckingham, bkearney, cwelton, mmccune, stbenjam | ||||||||||
Target Milestone: | Unspecified | Keywords: | ReleaseNotes, Triaged | ||||||||||
Target Release: | Unused | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
URL: | http://projects.theforeman.org/issues/11123 | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2015-08-12 16:03:00 UTC | Type: | Bug | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Bug Depends On: | |||||||||||||
Bug Blocks: | 1190823, 1195450 | ||||||||||||
Attachments: |
|
Description
Sachin Ghai
2015-06-04 10:36:14 UTC
It looks like the migration didn't work. There's this: db/migrate/20150423134004_add_content_host_id_to_smart_proxy.rb Which is supposed to add the content_host to the smart proxy, and that didn't happen for some reason on your Satellite. Post-upgrade I didn't encounter this issue, my Capsule had the Content Host associated. However, deleting the Content Host associated with the Capsule, and later reregistering it will cause this problem, so its something we need to prevent from happening. I've now done a bunch of upgrades with SNAP 7 through various bug testing and never hit this, so I don't think it's an upgrade issue, or if it was, its been corrected. The situation could still happen if you unregister the content host that the capsule is attached to. You can fix it in `foreman-rake console` with this: User.current = User.anonymous_admin SmartProxy.all.each do |proxy| content_host = ::Katello::System.where(:name => proxy.name).order("created_at DESC").first if content_host proxy.content_host_id = content_host.id proxy.save! puts "Capsule #{proxy} has Content Host #{content_host}" else puts "No Content Host Found for #{proxy}" end end Maybe that could be turned into a rake task. The permanent solution isn't clear to me, there's a few things we could do. Maybe we should delete the SmartProxy object if a user deletes the relevant ContentHost for a Capsule. This issue is still reproducible on rhel66 with sat6.1.1 snap12. here is the summary: ======================== While trying upgrade from sat6.0.8 to sat6.1.1 snap12, found a weird issue where content-view promotion ( Library -> dev) failed. Please note that CV publish was successful. I've updated the CV with 6.1.1 capsule and sat-tools repos. So I was trying to generate new version of CV with these repos. Here is the error I found in production.log: --- 2015-07-13 03:25:17 [E] Could not find Content Host with exact name 'cloud-qe-20.idmqe.lab.eng.bos.redhat.com', verify the Capsule is registered with that name. (Katello::Errors::CapsuleContentMissingConsumer) -- here 'cloud-qe-20.idmqe.lab.eng.bos.redhat.com' is the node which was configured as external capsule. I skipped the promotion task from dynflow and resume it again. Later, I tried capsule-upgrade and it was completed successfully (with workaround[1]). But when I initiated capsule sync, it got failed with same error: -- [root@cloud-qe-17 ~]# hammer -u admin -p changeme capsule content synchronize --id=2 Could not synchronize capsule content: Could not find Content Host with exact name 'cloud-qe-20.idmqe.lab.eng.bos.redhat.com', verify the Capsule is registered with that name. -- I unregister and re-register the capsule node again and re-initiated sync. this time sync successfully completed. ---- [root@cloud-qe-17 ~]# hammer -u admin -p changeme capsule content synchronize --id=2 [............................................................................................................................................] [100%] ----- Created attachment 1051372 [details]
logs from production.log
Created attachment 1051398 [details]
CV promotion failed after sat6 upgrade
This issue is reproducible on rhel71 too. steps performed: =================== - I installed sat6.0.8 with external capsule and provisioned a content-host via external capsule. - upgraded sat6.0.8 with sat6.1.1. (upgrade was completed successfully) - created custom repos for sat6.1_tools and capsule repo. - added repos to existing CV and published it - but when I promoted the new version to next 'dev' env. promotion failed with error: -- 2015-07-13 08:48:02 [E] Could not find Content Host with exact name 'cloud-qe-6.idmqe.lab.eng.bos.redhat.com', verify the Capsule is registered with that name. (Katello::Errors::CapsuleContentMissingConsumer) /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.57/app/lib/katello/capsule_content.rb:48:in `consumer' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.57/app/lib/actions/katello/capsule_content/configure_capsule.rb:19:in `block in plan' -- Created attachment 1051400 [details]
foreman-debug from rhel71
Sachin will open a separate docs BZ for the problem, will leave this one as-is, deleting a content host breaks synchronization. Earlier I was trying satellite6.1 content synchronization (capsule repo and sat-tools repo) after upgrade. Which breaks the content promotion. As suggested, this time I synced all repos(capsule and sat-tools) before upgrade. Upgrade on Satellite server and external capsule completed successfully. But when I re-tried the capsule sync after upgrade, I got this: [root@cloud-qe-12 ~]# hammer -u admin -p changeme capsule content synchronize --id=2 Could not synchronize capsule content: Could not find Content Host with exact name 'cloud-qe-15.idmqe.lab.eng.bos.redhat.com', verify the Capsule is registered with that name. [root@cloud-qe-12 ~]# hammer -u admin -p changeme capsule list ---|------------------------------------------|------------------------------------------------------ ID | NAME | URL ---|------------------------------------------|------------------------------------------------------ 1 | cloud-qe-12.idmqe.lab.eng.bos.redhat.com | https://cloud-qe-12.idmqe.lab.eng.bos.redhat.com:9090 2 | cloud-qe-15.idmqe.lab.eng.bos.redhat.com | https://cloud-qe-15.idmqe.lab.eng.bos.redhat.com:9090 ---|------------------------------------------|------------------------------------------------------ [root@cloud-qe-12 ~]# Does this mean we need to re-register the capsule after upgrade ? Created redmine issue http://projects.theforeman.org/issues/11123 from this bug Moving to POST since upstream bug http://projects.theforeman.org/issues/11123 has been closed ------------- Anonymous Applied in changeset commit:katello|0bc31483f1110205dfa38ce1b0e16ce88dfd0839. commit c0ca95be6ce42a9569010c4d0bc095afb732d89a Author: Stephen Benjamin <stbenjam> Date: Wed Jul 15 10:41:14 2015 -0400 fixes #11123 - actually assign content_host to capsule Verified with sat6.1.1 GA snap14. Now I can successfully sync contents to capsule after upgrade. steps performed: Upgraded sat server and capsule from sat6.0.8 -> sat6.1.1 GA snap14 re-run the capsule-sync and it was completed without any error. [root@cloud-qe-19 ~]# hammer -u admin -p changeme capsule content synchronize --id=2 [............................................................................................................................................] [100%] A workaround for anyone encountering this until GA: echo 'User.current = User.anonymous_admin; SmartProxy.all.each { |proxy| proxy.content_host.blank? ? proxy.update_attribute(:content_host, Katello::System.find_by_name(proxy.name)) : nil }' | foreman-rake console This bug was fixed in Satellite 6.1.1 which was delivered on 12 August, 2015. |