Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1628544

Summary: ActiveRecord::RecordInvalid error when syncing RHEL 7 s390x kickstart repo
Product: Red Hat Satellite Reporter: Ales Dujicek <adujicek>
Component: Content ManagementAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4Keywords: Regression, Triaged
Target Milestone: 6.5.0   
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-05-14 12:37:59 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:
Attachments:
Description Flags
production log
none
verification screenshot none

Description Ales Dujicek 2018-09-13 11:54:12 UTC
Created attachment 1483050 [details]
production log

Description of problem:

Sync of RHEL 7 s390x Kickstart repo ends with the following error:

2018-09-13T10:29:31 [I|aud|] create event for Architecture with id 5
2018-09-13T10:29:31 [E|bac|] Validation failed: Name has already been taken (ActiveRecord::RecordInvalid)
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
...
the rest of lo0g is in an attachment

it seems that it failed to create architecture, s390x is not in the database after that:

foreman=# select * from architectures;
 id |  name  |         created_at         |         updated_at         
----+--------+----------------------------+----------------------------
  1 | x86_64 | 2018-09-10 13:15:04.713612 | 2018-09-10 13:15:04.713612
  2 | i386   | 2018-09-10 13:15:04.719019 | 2018-09-10 13:15:04.719019
(2 rows)


Version-Release number of selected component (if applicable):
Sat 6.4 snap 21


How reproducible:
always

Steps to Reproduce:
1. hammer repository-set enable --name 'Red Hat Enterprise Linux 7 for System Z (Kickstart)' --product 'Red Hat Enterprise Linux for IBM z Systems' --organization-id 1 --basearch s390x --releasever 7.2
2. sync

Comment 5 Justin Sherrill 2018-09-19 17:06:32 UTC
Created redmine issue https://projects.theforeman.org/issues/24988 from this bug

Comment 6 Satellite Program 2018-09-19 18:08:37 UTC
Upstream bug assigned to jsherril

Comment 7 Satellite Program 2018-09-19 18:08:39 UTC
Upstream bug assigned to jsherril

Comment 8 Satellite Program 2018-09-20 18:08:40 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24988 has been resolved.

Comment 12 jcallaha 2018-12-11 16:56:58 UTC
Verified in Satellite 6.5 Snap 7

Enabled multiple repos

[vagrant@sat-6-5-qa-rhel7 ~]$ hammer -u admin -p ... repository-set enable --id 2541 --organization-id 1 --product-id 133 --basearch s390x --releasever 7.5
Repository enabled.
[vagrant@sat-6-5-qa-rhel7 ~]$ hammer -u admin -p ... repository-set enable --id 2541 --organization-id 1 --product-id 133 --basearch s390x --releasever 7.4
Repository enabled.
[vagrant@sat-6-5-qa-rhel7 ~]$ hammer -u admin -p ... repository-set enable --id 2541 --organization-id 1 --product-id 133 --basearch s390x --releasever 7.2
Repository enabled.
[vagrant@sat-6-5-qa-rhel7 ~]$ hammer -u admin -p ... repository-set enable --id 2541 --organization-id 1 --product-id 133 --basearch s390x --releasever 7.1
Repository enabled.

After that, syncing them all at the same time worked without issue. See attached screenshot for verification.

Comment 13 jcallaha 2018-12-11 16:57:20 UTC
Created attachment 1513462 [details]
verification screenshot

Comment 16 errata-xmlrpc 2019-05-14 12:37:59 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