Bug 1406900 - After Satellite 6 upgrade from 6.1 -> 6.2 Content View loses puppet modules
Summary: After Satellite 6 upgrade from 6.1 -> 6.2 Content View loses puppet modules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.2.6
Hardware: x86_64
OS: All
high
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Lukas Pramuk
URL:
Whiteboard:
: 1397145 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-21 19:01 UTC by Waldirio M Pinheiro
Modified: 2020-08-13 08:46 UTC (History)
11 users (show)

Fixed In Version: rubygem-katello-3.0.0.93-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-26 10:47:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch that applies to 6.2.6 (1.61 KB, application/mbox)
2017-01-09 15:35 UTC, Justin Sherrill
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17987 0 High Closed After upgrade Content View loses puppet modules 2020-07-15 08:38:53 UTC
Red Hat Product Errata RHBA-2017:0197 0 normal SHIPPED_LIVE Satellite 6.2.7 Async Bug Release 2017-01-26 15:38:38 UTC

Description Waldirio M Pinheiro 2016-12-21 19:01:03 UTC
Description of problem:
Customer with Sat6.1 working fine, one cv just for puppet modules, after migration to 6.2, the cv appear without puppet modules, but if you check *inside cv* they are there. The workaround was

1. Access the cv
2. Remove the puppet modules
3. Readded the puppet modules
4. Publish
5. In my case, I just update the ccv version of this puppet cv
6. Publish the ccv
7. Promote the ccv

Voilá, now host group or machine are able to see again puppet modules.

Version-Release number of selected component (if applicable):
6.2.6

How reproducible:
100%

Steps to Reproduce:
1. Install sat6.1.11 and prepare the environment
2. Add puppet module and test
3. Migrate to 6.2.x
4. Check the content view according above.

Actual results:
No puppet modules in the content view.

Expected results:
See the puppet modules in the content view

Additional info:

Comment 4 Justin Sherrill 2017-01-04 18:59:04 UTC
Have you tried running:

foreman-rake katello:upgrades:2.4:import_puppet_modules

This is supposed to run as part of the upgrade but maybe it didn't run or complete for you?

Comment 5 Waldirio M Pinheiro 2017-01-06 20:13:35 UTC
Hi Justin

Checking the upgrade file */var/log/foreman-installer/satellite.log* it's possible to the the puppet module import without issues or error

---
[ INFO 2016-12-21 09:00:23 main] Upgrade Step: import_puppet_modules (this may take a while) ...
[DEBUG 2016-12-21 09:00:49 main] Importing Puppet Modules
---

After execute the command below, the original puppet cv still the same *without puppet modules*

---
[root@satserver foreman-installer]# foreman-rake katello:upgrades:2.4:import_puppet_modules --trace
** Invoke katello:upgrades:2.4:import_puppet_modules (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute katello:upgrades:2.4:import_puppet_modules
Importing Puppet Modules
[root@satserver foreman-installer]#
---

Please, let me know if you need any additional information.


Best Regards
-- 
Waldirio M Pinheiro | Senior Software Maintenance Engineer

Comment 7 Justin Sherrill 2017-01-09 15:00:00 UTC
Created redmine issue http://projects.theforeman.org/issues/17987 from this bug

Comment 8 Justin Sherrill 2017-01-09 15:05:46 UTC
Figured out this issue, it was introduced in 6.2.6. 

For now you can apply this patch: https://github.com/Katello/katello/pull/6530.patch

to /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.*/

and then run:

foreman-rake katello:upgrades:2.4:import_puppet_modules

to resolve the issue.

Comment 9 Justin Sherrill 2017-01-09 15:35:48 UTC
Created attachment 1238813 [details]
Patch that applies to 6.2.6

Comment 10 Waldirio M Pinheiro 2017-01-09 15:48:55 UTC
Hi Justin

Great, after create apply the patch and execute the command below, was possible to see the 3 puppet modules in the original content view *cv_puppet*

---
[root@satserver katello-3.0.0.90]# foreman-rake katello:upgrades:2.4:import_puppet_modules --trace
** Invoke katello:upgrades:2.4:import_puppet_modules (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute katello:upgrades:2.4:import_puppet_modules
Importing Puppet Modules
[root@satserver katello-3.0.0.90]#
---

Amazing, thank you for your help.


Best Regards
-- 
Waldirio M Pinheiro | Senior Software Maintenance Engineer

Comment 11 Satellite Program 2017-01-09 18:39:05 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17987 has been resolved.

Comment 12 Brad Buckingham 2017-01-11 12:38:27 UTC
*** Bug 1397145 has been marked as a duplicate of this bug. ***

Comment 16 Lukas Pramuk 2017-01-20 23:14:22 UTC
VERIFIED.

@satellite-6.2.7-1.0.el7sat.noarch
tfm-rubygem-katello-3.0.0.93-1.el7sat.noarch

used manual reproducer:

1. @Sat6.1.11 create a CV and add puppet module(s) to it
2. Publish CV to have at least one CV version
3. Upgrade to Sat6.2.7
4. @Sat6.2.7 UI: Check that the published CV version contains puppet module(s)

(don't check CV, it has the puppet modules even without fix, but check CV version as it doesn't have any puppet modules prior to the fix)

>>> CV version that was upgraded still contains puppet modules


# foreman-rake katello:upgrades:2.4:import_puppet_modules
Importing Puppet Modules

# foreman-rake katello:reimport
Importing Katello::Erratum
Importing Katello::PackageGroup
Importing Katello::PuppetModule
Importing Katello::Rpm
Importing Katello::Subscription
Importing Katello::Pool
Importing Katello::DockerManifest
Importing Katello::DockerTag
Importing Katello::ContentViewPuppetEnvironment
Importing Activation Key Subscriptions

>>> And foreman rake tasks still work

Comment 17 Waldirio M Pinheiro 2017-01-24 17:07:30 UTC
Hi guys,

One important point here is related to the file "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.90/*/lib/katello/tasks/reimport.rake", because by default on 6.2.6 there isn't this file, so when running for the firt time, you will see one warning like below

	--- 
	[root@provisioning katello-3.0.0.90]# patch -p1 < /root/6530.patch 
	patching file app/models/katello/content_view_puppet_environment.rb
	can't find file to patch at input line 32
	Perhaps you used the wrong -p or --strip option?
	The text leading up to this was:
	--------------------------
	|diff --git a/lib/katello/tasks/reimport.rake b/lib/katello/tasks/reimport.rake
	|index bbbcb3c..e40b4e2 100644
	|--- a/lib/katello/tasks/reimport.rake
	|+++ b/lib/katello/tasks/reimport.rake
	--------------------------
	File to patch:
	---

Well, my advice on this case is, before apply the patch, just create the reimport.rake file, according steps below

	- cd /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.90/*
	- touch lib/katello/tasks/reimport.rake
	# patch -p1 < /root/6530.patch 

Then everything should works fine.


Best Regards
-- 
Waldirio M Pinheiro | Senior Software Maintenance Engineer

Comment 19 errata-xmlrpc 2017-01-26 10:47:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0197


Note You need to log in before you can comment on or make changes to this bug.