Project

General

Profile

Bug #6874

PGError: ERROR: bigint out of range: on setting entries_per_page to long integer value

Added by Dominic Cleal almost 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Settings
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1125831
Description of problem:
while performing boundary tests, I tried to set the "entries_per_page" parameter value with long integer value and on save, it was set as some exponential value. but when I navigate to some other tab and get back, the value was displayed correctly.

Later when I navigate to other page(for example: users), UI throws following error:

--
Oops, we're sorry but something went wrong

Error
PGError: ERROR: bigint out of range : SELECT "users".* FROM "users" WHERE (1=1) AND (users.auth_source_id <> 2) LIMIT 299999999999999999999999999999999999999999999999999999999999 OFFSET 0
---

Version-Release number of selected component (if applicable):
sat6 GA snap1

How reproducible:
always

Steps to Reproduce:
1. Go to settings --> general --> select "entries_per_page" and update it with long integer value
2.
3.

Actual results:
Production.logs: when I navigate to 'users' menu:

Processing by UsersController#index as HTML
Rendered users/index.html.erb within layouts/application (7.4ms)
Operation FAILED: PGError: ERROR: bigint out of range
: SELECT "users".* FROM "users" WHERE (1=1) AND (users.auth_source_id <> 2) LIMIT 299999999999999999999999999999999999999999999999999999999999 OFFSET 0
Rendered common/500.html.erb within layouts/application (5.4ms)
Rendered layouts/base.html.erb (1.2ms)
Completed 500 Internal Server Error in 186ms (Views: 9.0ms | ActiveRecord: 0.4ms)

Expected results:
User shouldn't be allowed to set a long value, we should define certain limit for any parameter. And if that limit exceeds, UI should throw an error message.

Additional info:

Associated revisions

Revision c737b10e (diff)
Added by Ori Rabin almost 5 years ago

Fixes #6874: Integers in settings can be up to 8 digits to avoid bigint out of range error

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Category set to Settings

#2 Updated by Ori Rabin almost 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin

#3 Updated by Dominic Cleal almost 5 years ago

  • Target version set to 1.7.4

#4 Updated by Dominic Cleal almost 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1712 added
  • Pull request deleted ()

#5 Updated by Dmitri Dolguikh almost 5 years ago

  • Target version changed from 1.7.4 to 1.7.3

#6 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 21

#7 Updated by Ori Rabin almost 5 years ago

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

Also available in: Atom PDF