Created attachment 1067724 [details] Image illustrating the duplicate content Description of problem: Running foreman-rake db:seed multiple times results in duplicate OpenSCAP content entries (for Red Hat default content) on the Hosts->SCAP Contents page Version-Release number of selected component (if applicable): openscap-1.2.4-1.el7sat.x86_64 openscap-scanner-1.2.4-1.el7sat.x86_64 puppet-foreman_scap_client-0.3.3-9.el7sat.noarch puppetlabs-stdlib-4.2.1-1.20140510git08b00d9.el7sat.noarch ruby193-rubygem-foreman_openscap-0.3.2.10-1.el7sat.noarch ruby193-rubygem-openscap-0.4.2-2.el7sat.noarch ruby193-rubygem-scaptimony-0.3.0.1-1.el7sat.noarch rubygem-smart_proxy_openscap-0.3.0.9-1.el7sat.noarch scap-security-guide-0.1.19-2.el7.noarch How reproducible: 100% Steps to Reproduce: 1. Install SCAP components (yum install ruby193-rubygem-foreman_openscap rubygem-smart_proxy_openscap ) 2 run 'foreman-rake db:seed' at the CLI. 3. Actual results: multiple entries shown on the Hosts->SCAP Contents page. If db:seed is run 6 times, there will be 6 entries on the page (for example) Expected results: A single entry for RHEL 6 & RHEL 7 Additional info:
Created redmine issue http://projects.theforeman.org/issues/11606 from this bug
Upstream fixed with https://github.com/theforeman/foreman_openscap/pull/112
From rhel71 run: [root@123 abc]# foreman-rake db:seed Seeding /usr/share/foreman/db/seeds.d/03-auth_sources.rb Seeding /usr/share/foreman/db/seeds.d/03-permissions.rb Seeding /usr/share/foreman/db/seeds.d/03-roles.rb Seeding /usr/share/foreman/db/seeds.d/04-admin.rb Seeding /usr/share/foreman/db/seeds.d/05-taxonomies.rb Seeding /usr/share/foreman/db/seeds.d/06-architectures.rb Seeding /usr/share/foreman/db/seeds.d/07-config_templates.rb Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb Seeding /usr/share/foreman/db/seeds.d/13-compute_profiles.rb Seeding /usr/share/foreman/db/seeds.d/15-bookmarks.rb Seeding /usr/share/foreman/db/seeds.d/16-mail_notifications.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.15.7/db/seeds.d/20-foreman_tasks_permissions.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_bootdisk-4.0.2.13/db/seeds.d/50-bootdisk_templates.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-2.0.0.19/db/seeds.d/60_discovery_proxy_feature.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.15.7/db/seeds.d/61-foreman_tasks_bookmarks.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_openscap-0.3.2.10/db/seeds.d/openscap_feature.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_openscap-0.3.2.10/db/seeds.d/openscap_scap_default.rb Saved /usr/share/xml/scap/ssg/content/ssg-rhel6-ds.xml as Red Hat rhel6 default content Saved /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml as Red Hat rhel7 default content All seed files executed From rhel67 run [root@123 abc]# foreman-rake db:seed Seeding /usr/share/foreman/db/seeds.d/03-auth_sources.rb Seeding /usr/share/foreman/db/seeds.d/03-permissions.rb Seeding /usr/share/foreman/db/seeds.d/03-roles.rb Seeding /usr/share/foreman/db/seeds.d/04-admin.rb Seeding /usr/share/foreman/db/seeds.d/05-taxonomies.rb Seeding /usr/share/foreman/db/seeds.d/06-architectures.rb Seeding /usr/share/foreman/db/seeds.d/07-config_templates.rb Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb Seeding /usr/share/foreman/db/seeds.d/13-compute_profiles.rb Seeding /usr/share/foreman/db/seeds.d/15-bookmarks.rb Seeding /usr/share/foreman/db/seeds.d/16-mail_notifications.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.15.7/db/seeds.d/20-foreman_tasks_permissions.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_bootdisk-4.0.2.13/db/seeds.d/50-bootdisk_templates.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-2.0.0.19/db/seeds.d/60_discovery_proxy_feature.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.15.7/db/seeds.d/61-foreman_tasks_bookmarks.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_openscap-0.3.2.10/db/seeds.d/openscap_feature.rb Seeding /opt/rh/ruby193/root/usr/share/gems/gems/foreman_openscap-0.3.2.10/db/seeds.d/openscap_scap_default.rb Saved /usr/share/xml/scap/ssg/content/ssg-rhel6-ds.xml as Red Hat rhel6 default content Saved /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml as Red Hat rhel7 default content All seed files executed We can still see multiple entries in the UI when we run 'foreman-rake db:seed'
Not sure I follow, Does it create *new* scap content each time you run? Or between upgrades?
Yes, this was when directly running the command 'foreman-rake db:seed' as per the initial bug report. We do see multiple entries. I did not try any upgrades on this setup.
Each time you run foreman-rake db:seed you get new entries in the ui, see the screenshot here: https://mmccune.fedorapeople.org/scratch/scap-content-migrate.png I'm moving this to 6.1.4 as we are out of time in 6.1.3
Connecting redmine issue http://projects.theforeman.org/issues/9950 from this bug
Upstream bug assigned to szadok
Should be solved on 6.2 Committed as https://github.com/theforeman/foreman_openscap/commit/15a507db1e66a2cc873adad9c16ca6ef77a2d359
For Satellite 6.1 the command was : "foreman-rake db:seed" For Satellite 6.2 the command is: "foreman-rake foreman_openscap:bulk_upload:default" Actually not applicable for Sat6.2 but, Will still test for Satellite6.2 , by running the command twice, "foreman-rake foreman_openscap:bulk_upload:default".
VERIFIED with sat62-snap12.1 This issue is no longer seen with oscap content. running the sat62 command twice does not duplicate them.
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