Bug 1376032 - Content Sync fails with error: "Failed to configure host groups: undefined method `puppet_environment' for nil:NilClass"
Summary: Content Sync fails with error: "Failed to configure host groups: undefined me...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Quickstart Cloud Installer
Classification: Red Hat
Component: Installation - RHEV
Version: 1.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
: 1.1
Assignee: Derek Whatley
QA Contact: Tasos Papaioannou
Dan Macpherson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-14 13:15 UTC by Tasos Papaioannou
Modified: 2017-02-28 01:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-28 01:39:41 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:0335 0 normal SHIPPED_LIVE Red Hat Quickstart Installer 1.1 2017-02-28 06:36:13 UTC

Description Tasos Papaioannou 2016-09-14 13:15:57 UTC
Description of problem:

When running a RHV deployment with a non-library environment path selected, the "Satellite" task fails with an error message:

Failed to configure host groups: undefined method `puppet_environment' for nil:NilClass

/var/log/foreman/production.log shows that the "puppet_environment" method of a nil object was called:

2016-09-13 13:51:57 [foreman-tasks/action] [E] undefined method `puppet_environment' for nil:NilClass (NoMethodError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:79:in `find_or_ensure_hostgroup'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:44:in `block in run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:43:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.14/app/lib/actions/fusor/configure_host_groups.rb:43:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:506:in `block (3 levels) in execute_run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `call'


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

QCI-1.0-RHEL-7-20160908.1

How reproducible:

100%

Steps to Reproduce:
1.) Create a new lifecycle environment, either under Content > Lifecycle Environments or in the deployment wizard for a new RHV deployment.
2.) Start the RHV deployment.
3.) See the above error.

Actual results:

Failed deployment when selecting lifecycle environment other than the default.

Expected results:

No failure.

Additional info:

The relevant code in configure_host_groups.rb is:

----
          if lifecycle_environment_id
            lifecycle_environment = ::Katello::KTEnvironment.find(lifecycle_environment_id)
            content_view_puppet_environment = content_view.puppet_env(lifecycle_environment)
          else
            lifecycle_environment = deployment.organization.library
            puppet_content_view = find_content_view(organization_id, default_puppet_content_view_name)
            content_view_puppet_environment = puppet_content_view.puppet_env(lifecycle_environment)
          end
          puppet_environment = content_view_puppet_environment.puppet_environment

----

Comment 1 Tasos Papaioannou 2016-09-14 16:00:32 UTC
The problem appears to be due to the fact the deployment's content view is published to the Library environment, but not to the selected environment (e.g., Library > Development). The call to content_view.puppet_env(lifecycle_environment) in find_or_ensure_hostgroup therefore fails to find any matching content view versions that match the Development environment, and content_view_puppet_environment.puppet_environment throws NoMethodError.

Comment 3 Derek Whatley 2016-10-07 17:43:19 UTC
Resolved by PR 1241 thanks to an effort by fabianvf during the transition from Puppet to Ansible for RHV configuration.

Content sync now completes successfully in non-library enironment.

https://github.com/fusor/fusor/pull/1241

Comment 4 Derek Whatley 2016-10-07 19:28:34 UTC
Should be in ISO: QCI-1.1-RHEL-7-20161007.t.0-QCI-x86_64-dvd1.iso

Comment 5 Tasos Papaioannou 2016-10-10 20:11:22 UTC
Verified on QCI-1.1-RHEL-7-20161007.t.0.

Comment 8 errata-xmlrpc 2017-02-28 01:39:41 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/RHEA-2017:0335


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