Project

General

Profile

Bug #23662

Unable to promote content views due to 'null' value for timestamps.

Added by Rimma Ashkinadze about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

After an upgrade to Foreman 1.17 and Katello 3.6.0

Actions::Katello::Repository::IndexContent
Input:{"id"=>40715, "current_user_id"=>45}
Output:{}
Exception:
ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR: null value in column "created_at" violates not-null constraint
DETAIL: Failing row contains (279572806, 399867, 40715, null, null).
: insert into katello_repository_rpms (repository_id, rpm_id)
select 40715 as repository_id, rpm_id from katello_repository_rpms
where repository_id = 155539 and rpm_id not in (select rpm_id
from katello_repository_rpms where repository_id = 40715)

foreman=# \d katello_repository_rpms
Table "public.katello_repository_rpms"
Column | Type | Modifiers
---------------+-----------------------------+----------------------------------------------------------------------
id | integer | not null default nextval('katello_repository_rpms_id_seq'::regclass)
rpm_id | integer | not null
repository_id | integer |
created_at | timestamp without time zone | not null
updated_at | timestamp without time zone | not null
Indexes:
"katello_repository_rpms_pkey" PRIMARY KEY, btree (id)
"index_katello_repository_rpms_on_rpm_id_and_repository_id" UNIQUE, btree (rpm_id, repository_id)
"index_katello_repository_rpms_on_repository_id" btree (repository_id)
Foreign-key constraints:
"katello_repository_rpms_repository_id_fk" FOREIGN KEY (repository_id) REFERENCES katello_repositories(id)
"katello_repository_rpms_rpm_id_fk" FOREIGN KEY (rpm_id) REFERENCES katello_rpms(id)

Associated revisions

Revision 31b9d1da (diff)
Added by Justin Sherrill about 3 years ago

Fixes #23662 - fixes not null insert on content-repo

association. Rails 4.2 changed the default timestamp creation from
null => true to null => false. This corrects these tables

History

#1 Updated by Justin Sherrill about 3 years ago

  • Project changed from Foreman to Katello

#2 Updated by The Foreman Bot about 3 years ago

  • Assignee set to Justin Sherrill
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7390 added

#3 Updated by Jonathon Turel about 3 years ago

  • Legacy Backlogs Release (now unused) set to 338

#4 Updated by Justin Sherrill about 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF