Bug 1660646

Summary: UUID error on syncing repo with module errata
Product: Red Hat Satellite Reporter: Partha Aji <paji>
Component: RepositoriesAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: vijsingh
Severity: high Docs Contact:
Priority: unspecified    
Version: NightlyCC: cdonnell, zhunting
Target Milestone: ReleasedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.10.0.45-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 19:57:30 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:

Description Partha Aji 2018-12-18 21:50:20 UTC
Sync a repo with module errata but missing module definition (https://partha.fedorapeople.org/test-repos/rpm-with-modules-el8-missing-modules/).
During indexing of the errata Katello tries to create a ModuleStream if it cant find the module listed in the errata.
During the creation of that module stream if that module does not exist in Pulp we get a non null violation.

"""
[[0m|675c0] PG::NotNullViolation: ERROR:  null value in column "uuid" violates not-null constraint
 | DETAIL:  Failing row contains (9, duck, null, 201809302113907, deadbeef, 0, noarch, 2018-12-11 23:25:08.111841, 2018-12-11 23:25:08.111841, null, null).
 | : INSERT INTO "katello_module_streams" ("name", "version", "context", "stream", "arch", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" (ActiveRecord::NotNullViolation)
"""

Steps:
1) Sync https://partha.fedorapeople.org/test-repos/rpm-with-modules-el8-missing-modules/

Expected:
Successful sync with the missing duck:0.9 module ignored

Actual
"""
[[0m|675c0] PG::NotNullViolation: ERROR:  null value in column "uuid" violates not-null constraint
 | DETAIL:  Failing row contains (9, duck, null, 201809302113907, deadbeef, 0, noarch, 2018-12-11 23:25:08.111841, 2018-12-11 23:25:08.111841, null, null).
 | : INSERT INTO "katello_module_streams" ("name", "version", "context", "stream", "arch", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" (ActiveRecord::NotNullViolation)

 | /home/vagrant/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.1/lib/active_record/relation.rb:108:in `first_or_create!'
 | /home/vagrant/git/katello/app/models/katello/erratum.rb:221:in `block (2 levels) in update_modules'
 | /home/vagrant/git/katello/app/models/katello/erratum.rb:218:in `each'
 | /home/vagrant/git/katello/app/models/katello/erratum.rb:218:in `block in update_modules'
 | /home/vagrant/git/katello/app/models/katello/erratum.rb:162:in `run_until'
 | /home/vagrant/git/katello/app/models/katello/erratum.rb:244:in `update_modules'
 | /home/vagrant/git/katello/app/models/katello/erratum.rb:122:in `update_from_json'
 | /home/vagrant/git/katello/app/models/katello/concerns/pulp_database_unit.rb:57:in `block (2 levels) in import_all'

""""

Comment 3 Partha Aji 2018-12-18 21:52:20 UTC
Connecting redmine issue https://projects.theforeman.org/issues/25676 from this bug

Comment 4 Satellite Program 2018-12-18 23:03:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25676 has been resolved.

Comment 5 Brad Buckingham 2019-04-09 19:44:16 UTC
*** Bug 1698192 has been marked as a duplicate of this bug. ***

Comment 8 vijsingh 2019-04-17 08:11:06 UTC
ON_QA Verified

@Satellite 6.5.0 snap 24.0

Steps:

 Created and synced repo using :https://partha.fedorapeople.org/test-repos/rpm-with-modules-el8-missing-modules/

Observation:
 
 Successful sync with the missing duck:0.9 module and module duck:0.9 ignored/not synced.

Comment 10 Bryan Kearney 2019-05-14 19:57:30 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:1222