Bug 2278566

Summary: Content view publish failing with katello_repository_rpms_id_seq reached maximum value error
Product: Red Hat Satellite Reporter: Ashfaqur Rahaman <arahaman>
Component: Content ViewsAssignee: Ian Ballou <iballou>
Status: CLOSED MIGRATED QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.13.6CC: iballou, jpasqual, juqiao, mkushwah, sajha, satellite6-bugs, sbible, zhunting
Target Milestone: streamKeywords: MigratedToJIRA, WorkAround
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: 2024-06-06 17:36:18 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 Ashfaqur Rahaman 2024-05-02 04:35:25 UTC
Description of problem:

Unable to publish the content view due to limitation of katello_repository_rpms_id_seq because it is set as integer type. The "id" column of the table "katello_repository_rpms" is set as bigint however, the sequence "katello_repository_rpms_id_seq" is set as Integer. Therefore, the sequence limit to max integer value +2,147,483,647. When this limit reaches, CU can not publish/promote content view with this below error:  
~~~
PG::SequenceGeneratorLimitExceeded: ERROR: nextval: reached maximum value of sequence "katello_repository_rpms_id_seq" (2147483647)
~~~

Version-Release number of selected component (if applicable):
6.13

How reproducible:
100%

Actual results:
CV publish failing with the maximum value reached error. 

Expected results:
CV publish should be successful 

Additional info:

# \d katello_repository_rpms;
                                          Table "public.katello_repository_rpms"
    Column     |            Type             | Collation | Nullable |                       Default
---------------+-----------------------------+-----------+----------+-----------------------------------------------------
 id            | bigint                      |           | not null | nextval('katello_repository_rpms_id_seq'::regclass). <===========
 rpm_id        | integer                     |           | not null |
 repository_id | integer                     |           |          |
 created_at    | timestamp without time zone |           |          |
 updated_at    | timestamp without time zone |           |          |


# \d katello_repository_rpms_id_seq;'"
           Sequence "public.katello_repository_rpms_id_seq"
  Type   | Start | Minimum |  Maximum   | Increment | Cycles? | Cache 
---------+-------+---------+------------+-----------+---------+-------
 integer |     1 |       1 | 2147483647 |         1 | no      |     1


# select * from pg_sequences where sequencename='katello_repository_rpms_id_seq';
 schemaname |          sequencename          | sequenceowner | data_type | start_value | min_value | max_value  | increment_by | cycle | cache_size | last_value
 
------------+--------------------------------+---------------+-----------+-------------+-----------+------------+--------------+-------+------------+-----------
-
 public     | katello_repository_rpms_id_seq | foreman       | integer   |           1 |         1 | 2147483647 |            1 | f     |          1 | 2147483647
(1 row)

There was a Bug-1793701 which fixed (6.7) the "id" column from "int" type to "Biginit" , but it it seems for new installation the seq is still set as "int" type. checked in 6.11/6.12/6.13

Comment 9 Ian Ballou 2024-05-02 19:16:57 UTC
Created redmine issue https://projects.theforeman.org/issues/37403 from this bug

Comment 12 Eric Helms 2024-05-16 16:18:49 UTC
Upstream bug assigned to iballou

Comment 13 Eric Helms 2024-05-16 16:18:52 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37403 has been resolved.

Comment 14 Sam Bible 2024-05-22 21:20:45 UTC
Version-Release number of selected component (if applicable):
6.16 - Stream 60

How reproducible:
Always

Steps to Reproduce:
1. Login to the command line of Satellite, and access the foreman postgres shell (sudo -u postgres psql foreman)
2. Run the following command: select * from pg_sequences where sequencename='katello_repository_rpms_id_seq'; 

Actual results:
The data_type of this field (katello_repository_rpms_id_seq) is bigint, and isn't integer.

Expected results:
The data_type of this field (katello_repository_rpms_id_seq) is bigint, and isn't integer.

Comment 15 Eric Helms 2024-06-06 17:36:18 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.

Comment 16 Red Hat Bugzilla 2024-10-05 04:27:44 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days