Bug 1342490

Summary: [upgrade]content-view publish on a upgraded setup fails with error: undefined method `[]' for nil:NilClass (NoMethodError)
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Content ViewsAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, tbrisker
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-installer-base-3.0.0.43-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:12:04 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: 1342528    
Bug Blocks: 1335807    
Attachments:
Description Flags
exception raised while cv publish
none
cv publish fails on upgraded sat6.2
none
foreman-debug logs
none
content-view was successfully publsihed/promoted on upgraded setup none

Description Sachin Ghai 2016-06-03 11:40:44 UTC
Description of problem:I've upgrade sat6.1.9 -> sat6.2 GA snap14.1. Upgrade was successfully completed. Later, I tried to create a new repo on upgraded setup and added the newly created repo in existing CV. when I publish the CV it failed with error:


==> /var/log/foreman/production.log <==
2016-06-03 07:28:35 [foreman-tasks/action] [E] undefined method `[]' for nil:NilClass (NoMethodError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/pulp/repository/distributor_publish.rb:24:in `distributor_id'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/pulp/repository/distributor_publish.rb:16:in `invoke_external_task'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action/polling.rb:83:in `initiate_external_action'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action/polling.rb:18:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action/cancellable.rb:9:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/pulp/abstract_async_task.rb:45: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'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware.rb:17:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware.rb:30:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:22:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware.rb:17:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/models/katello/concerns/user_extensions.rb:20:in `cp_config'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/middleware/remote_action.rb:39:in `as_remote_user'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/middleware/remote_action.rb:16:in `run'



Version-Release number of selected component (if applicable):
upgrade sat6.1.9 -> sat6.2 GA snap14.1 on rhel7

How reproducible:


Steps to Reproduce:
1. add a new repo on upgraded 6.2 satellite
2. add that repo to an existing CV
3. publish the CV

Actual results:
error: undefined method `[]' for nil:NilClass (NoMethodError)

Expected results:
cv publish should work

Additional info:

Comment 1 Sachin Ghai 2016-06-03 11:43:05 UTC
Created attachment 1164443 [details]
exception raised while cv publish

Comment 2 Sachin Ghai 2016-06-03 11:44:25 UTC
Created attachment 1164444 [details]
cv publish fails on upgraded sat6.2

Comment 3 Sachin Ghai 2016-06-03 11:45:14 UTC
Created attachment 1164445 [details]
foreman-debug logs

Comment 5 Brad Buckingham 2016-06-06 00:14:14 UTC
Created redmine issue http://projects.theforeman.org/issues/15297 from this bug

Comment 6 Brad Buckingham 2016-06-06 00:53:59 UTC
The proposed fixes for this issue are in the following upstream PRs:
- https://github.com/Katello/katello/pull/6105
- https://github.com/Katello/katello-installer/pull/355

In addition, to fully test this, the fix for bug 1342528 will also be needed.

Comment 7 Sachin Ghai 2016-06-10 08:53:48 UTC
Verified with upgrade from sat6.1.9 -> sat6.2 GA snap15.1 on rhel7

After upgrade, I can successfully publish/promote the content-view. Please see the screenshot for verification.

Comment 8 Sachin Ghai 2016-06-10 08:55:02 UTC
Created attachment 1166592 [details]
content-view was successfully publsihed/promoted on upgraded setup

Comment 9 Bryan Kearney 2016-07-27 11:12:04 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-2016:1501