Bug 1628544 - ActiveRecord::RecordInvalid error when syncing RHEL 7 s390x kickstart repo
Summary: ActiveRecord::RecordInvalid error when syncing RHEL 7 s390x kickstart repo
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.5.0
Assignee: Justin Sherrill
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-13 11:54 UTC by Ales Dujicek
Modified: 2019-11-05 22:32 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:37:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
production log (21.97 KB, text/plain)
2018-09-13 11:54 UTC, Ales Dujicek
no flags Details
verification screenshot (70.81 KB, image/png)
2018-12-11 16:57 UTC, jcallaha
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24988 0 Normal Closed ActiveRecord::RecordInvalid error when syncing RHEL 7 s390x kickstart repo 2020-10-02 21:15:57 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:38:05 UTC

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


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