Bug 1703476

Summary: No syncable repositories found for selected products and options. (RuntimeError)
Product: Red Hat Satellite 6 Reporter: Evgeni Golov <egolov>
Component: Sync PlansAssignee: Samir Jha <sajha>
Status: CLOSED ERRATA QA Contact: Stephen Wadeley <swadeley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: aeladawy, zhunting
Target Milestone: 6.6.0Keywords: Regression, Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 12:47:18 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:

Description Evgeni Golov 2019-04-26 14:26:49 UTC
Description of problem:
Satellite 6.5, snap 25
When having a sync plan with no products attached (which is technically possible, even if it makes not too much sense), this plan errors out during execution:

2019-04-26T10:09:08 [E|bac|] No syncable repositories found for selected products and options. (RuntimeError)
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.46/app/lib/actions/katello/sync_plan/run.rb:24:in `block in plan'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:100:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:106:in `as_anonymous_admin'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.46/app/lib/actions/katello/sync_plan/run.rb:18:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/action.rb:493:in `block (3 levels) in execute_plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:35:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:35:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:35:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.46/app/lib/actions/middleware/keep_locale.rb:7:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_timezone.rb:10:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_timezone.rb:33:in `block in with_current_timezone'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_timezone.rb:44:in `restore_curent_timezone'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_timezone.rb:33:in `with_current_timezone'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_timezone.rb:9:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_user.rb:10:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_user.rb:33:in `block in with_current_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_user.rb:43:in `restore_curent_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_user.rb:33:in `with_current_user'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_user.rb:9:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_taxonomies.rb:10:in `block in plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_taxonomies.rb:30:in `with_current_taxonomies'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.4.6/app/lib/actions/middleware/keep_current_taxonomies.rb:9:in `plan'
…


[root@dhcp-8-29-228 ~ CLONE]# hammer -u egolov sync-plan info --id 9 --organization "Default Organization"
[Foreman] Password for egolov: 
ID:                 9
Name:               egolov-test
Start Date:         2019/04/26 14:25:00
Interval:           hourly
Enabled:            yes
Cron Expression:    
Recurring Logic ID: 7
Description:        
Created at:         2019/04/26 14:20:50
Updated at:         2019/04/26 14:20:50
Products:



Version-Release number of selected component (if applicable):
Satellite 6.5 Snap 25

How reproducible:
100%

Steps to Reproduce:
1. create a sync plan, don't assign any products to be synced

Actual results:
See above

Expected results:
No error

Additional info:
Technically a regression, as this did not produce any errors in 6.4

Comment 4 Samir Jha 2019-05-02 16:25:29 UTC
Created redmine issue http://projects.theforeman.org/issues/26734 from this bug

Comment 5 Bryan Kearney 2019-05-07 16:04:13 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26734 has been resolved.

Comment 7 Stephen Wadeley 2019-06-17 15:11:40 UTC
Hello


Testing on latest snap

[root@sat-6-6-qa-rhel7 ~]# rpm -q tfm-rubygem-katello
tfm-rubygem-katello-3.12.0.1-11.master.el7sat.noarch



[root@sat-6-6-qa-rhel7 ~]# hammer sync-plan create --name TestSP --organization-id 1 --interval hourly --enabled 1 --sync-date 2019-06-17
Sync plan created.

[root@sat-6-6-qa-rhel7 ~]# hammer sync-plan info --id 1 
ID:                 1
Name:               TestSP
Start Date:         2019/06/17 00:00:00
Interval:           hourly
Enabled:            yes
Cron Expression:    
Recurring Logic ID: 2
Description:        
Created at:         2019/06/17 14:28:03
Updated at:         2019/06/17 14:28:03
Products:

Notice no products attached.

Change so it syncs every four minutes.

[root@sat-6-6-qa-rhel7 ~]# hammer sync-plan update --id 1 --interval "custom cron" --cron-expression "*/4 * * * *" 
Sync plan updated.

I found the task in web UI: 
  Tasks > Run Sync Plan: TestSP

got the task ID  003a0065-9edd-4d9d-b1e1-5bbcc410df3c and searched production log
[root@sat-6-6-qa-rhel7 ~]# less /var/log/foreman/production.log

2019-06-17T14:58:35 [I|app|b9a6ff5b] Started GET "/foreman_tasks/tasks/003a0065-9edd-4d9d-b1e1-5bbcc410df3c" for 192.168.121.1 at 2019-06-17 14:58:35 +0000
2019-06-17T14:58:35 [I|app|b9a6ff5b] Processing by ForemanTasks::TasksController#show as HTML
2019-06-17T14:58:35 [I|app|b9a6ff5b]   Parameters: {"id"=>"003a0065-9edd-4d9d-b1e1-5bbcc410df3c"}
2019-06-17T14:58:35 [I|app|b9a6ff5b] Current user set to admin (admin)
2019-06-17T14:58:35 [I|app|b9a6ff5b]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.15.5/app/views/foreman_tasks/tasks/show.html.erb within layouts/application
2019-06-17T14:58:35 [I|app|b9a6ff5b]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.15.5/app/views/foreman_tasks/tasks/_details.html.erb (38.7ms)

No errors seen

Checked /var/log/messages

no errors seen

Comment 10 errata-xmlrpc 2019-10-22 12:47:18 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/RHSA-2019:3172