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 1758292 - Check and reset sessions_id_seq in postgres
Summary: Check and reset sessions_id_seq in postgres
Keywords:
Status: CLOSED DUPLICATE of bug 1641223
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Anurag Patel
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-03 18:54 UTC by sthirugn@redhat.com
Modified: 2019-10-07 11:05 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-07 11:05:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3660801 0 None None None 2019-10-03 18:55:23 UTC

Description sthirugn@redhat.com 2019-10-03 18:54:24 UTC
Description of problem:
A Satellite running for many many years may run into integer out of range. This is rare but possible.

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

How reproducible:
Difficult to reproduce but happens very rarely at customer environments

Steps to Reproduce:
1. It is difficult to reproduce as a normal user, but can be reproduced easily with updating the table.
2. sudo su - postgres
   psql foreman
      ALTER SEQUENCE sessions_id_seq RESTART WITH 9223372036854775805;
3. Now, hit some api calls or hammer or UI.

Actual results:
curl -X GET -k -u admin:changeme https://satellite.example.com/api/v2/hosts
{
  "error": {"message":"PG::NumericValueOutOfRange: ERROR:  integer out of range\n: INSERT INTO \"sessions\" (\"session_id\", \"data\", \"created_at\", \"updated_at\") VALUES ($1, $2, $3, $4) RETURNING \"id\""}
}

At this point, you can't login to UI as well.

production.log would show:
==> /var/log/foreman/production.log <==
2019-10-03T18:52:42 [I|app|] Started GET "/api/v2/hosts" for 192.168.121.1 at 2019-10-03 18:52:42 +0000
2019-10-03T18:52:42 [I|app|f447d679] Processing by Api::V2::HostsController#index as JSON
2019-10-03T18:52:42 [I|app|f447d679]   Parameters: {"apiv"=>"v2"}
2019-10-03T18:52:42 [I|app|f447d679] Authorized user admin(Admin User)
2019-10-03T18:52:42 [I|app|f447d679] Current user set to admin (admin)
2019-10-03T18:52:42 [W|app|f447d679] Action failed
ActiveRecord::StatementInvalid: PG::ObjectNotInPrerequisiteState: ERROR:  nextval: reached maximum value of sequence "sessions_id_seq" (9223372036854775807)
: INSERT INTO "sessions" ("session_id", "data", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"


Expected results:
The sessions_id_seq should be reset once in a while to avoid this error.

Additional info:
This kcs article explains how to clear the sessions and reset the sequence: https://access.redhat.com/solutions/3660801

Comment 4 Kavita 2019-10-07 11:05:33 UTC

*** This bug has been marked as a duplicate of bug 1641223 ***


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