Bug 1342528 - [upgrade] Capsule sync failed with error: undefined method `[]' for nil:NilClass (NoMethodError)
Summary: [upgrade] Capsule sync failed with error: undefined method `[]' for nil:NilCl...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Upgrades
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1335807 1342490
TreeView+ depends on / blocked
 
Reported: 2016-06-03 12:26 UTC by Sachin Ghai
Modified: 2019-09-26 17:32 UTC (History)
3 users (show)

Fixed In Version: rubygem-katello-3.0.0.42-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:38:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15292 0 Urgent Closed [upgrade] Capsule sync failed with error: undefined method `[]' for nil:NilClass (NoMethodError) 2020-05-27 09:29:48 UTC

Description Sachin Ghai 2016-06-03 12:26:31 UTC
Description of problem:
I was trying to perform capsule sync from upgrade satellite from 6.1.9 -> 6.2 snap14.1 and it failed with error:

2016-06-03 08:16:36 [app] [I] Started POST "/katello/api/capsules/2/content/sync" for ::1 at 2016-06-03 08:16:36 -0400
2016-06-03 08:16:36 [app] [I] Processing by Katello::Api::V2::CapsuleContentController#sync as JSON
2016-06-03 08:16:36 [app] [I]   Parameters: {"api_version"=>"v2", "id"=>"2", "capsule_content"=>{}}
2016-06-03 08:16:36 [app] [I] Authorized user admin(Admin User)
2016-06-03 08:16:37 [app] [I] Started GET "/foreman_tasks/tasks/f5dd6601-e230-4f35-9a15-f90e57ed3e4c" for 10.65.223.218 at 2016-06-03 08:16:37 -0400
2016-06-03 08:16:37 [app] [I] Processing by ForemanTasks::TasksController#show as HTML
2016-06-03 08:16:37 [app] [I]   Parameters: {"id"=>"f5dd6601-e230-4f35-9a15-f90e57ed3e4c"}
2016-06-03 08:16:37 [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/katello/capsule_content/sync.rb:84:in `block in repos_needing_importer_updates'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/katello/capsule_content/sync.rb:81:in `select'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/katello/capsule_content/sync.rb:81:in `repos_needing_importer_updates'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/katello/capsule_content/sync.rb:64:in `repos_needing_updates'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.42/app/lib/actions/katello/capsule_content/sync.rb:22:in `plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:461:in `block (3 levels) in execute_plan'
 | /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:34:in `plan'
 | /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/dynflow-0.8.11/lib/dynflow/middleware.rb:34:in `plan'
 | /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/world.rb:30:in `execute'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:460:in `block (2 levels) in execute_plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/execution_plan.rb:281:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/execution_plan.rb:281:in `switch_flow'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:364:in `concurrence'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:459:in `block in execute_plan'


Please note that satellite upgrade was completed successfully and capsule upgrade too if we specify "--pulp-oauth-secret" with installer.

Upgrading...
Upgrade Step: stop_services...
Upgrade Step: start_databases...
Upgrade Step: update_http_conf...
Upgrade Step: migrate_pulp...
Upgrade Step: fix_pulp_httpd_conf...
Upgrade Step: start_httpd...
Upgrade Step: start_qpidd...
Upgrade Step: start_pulp...
Upgrade Step: remove_nodes_importers...
Upgrade Step: Running installer...
Installing             Done                                               [100%] [..................................................................]
  The full log is at /var/log/foreman-installer/capsule.log
Upgrade Step: restart_services...
Katello upgrade completed!


Version-Release number of selected component (if applicable):
upgraded setup from 6.1.9 -> 6.2 GA snap14.1

How reproducible:


Steps to Reproduce:
1. capsule sync
2.
3.

Actual results:
~]# hammer -u admin -p changeme capsule content synchronize --id=2
Could not synchronize capsule content:
  undefined method `[]' for nil:NilClass


Expected results:
sync should work

Additional info:

Comment 2 Justin Sherrill 2016-06-03 18:28:56 UTC
Created redmine issue http://projects.theforeman.org/issues/15292 from this bug

Comment 3 Bryan Kearney 2016-06-07 00:16:06 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15292 has been closed

Comment 4 Sachin Ghai 2016-06-10 09:11:37 UTC
Verified with upgrade from sat6.1.9 -> sat6.2 GA snap15.1

I created a new repo on upgrade satellite and published it in CV. Later initiated the capsule sync. Sync was completed successfully. 

 ~]# hammer -u admin -p changeme capsule content synchronize --id=2
[......................................................................................................................................] [100%]
[root@qe-sat6-upgrade-rhel7 ~]# 

on capsule node, I can see synced custom contents.

# ll | wc -l
165
[root@qe-capsule-rhel7 capsule7]# pwd
/var/lib/pulp/published/yum/https/repos/Default_Organization/DEV/rhel7_cv/custom/capsule/capsule7

Comment 5 Bryan Kearney 2016-07-27 11:38:51 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


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