Bug 1125831 - PGError: ERROR: bigint out of range: on setting entries_per_page to long integer value
Summary: PGError: ERROR: bigint out of range: on setting entries_per_page to long int...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
low
medium vote
Target Milestone: Unspecified
Assignee: orabin
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-01 07:55 UTC by Sachin Ghai
Modified: 2017-02-23 21:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:12:31 UTC


Attachments (Terms of Use)
ERROR: bigint out of range on setting parameter with long interger value (18.46 KB, image/png)
2014-08-01 07:55 UTC, Sachin Ghai
no flags Details
UI shows long numerid value for param "entries_per_page" (54.91 KB, image/png)
2014-08-01 07:57 UTC, Sachin Ghai
no flags Details
entries per page value (92.36 KB, image/png)
2014-12-12 13:00 UTC, Tazim Kolhar
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC
Foreman Issue Tracker 6874 None None None 2016-04-22 15:15:32 UTC

Description Sachin Ghai 2014-08-01 07:55:07 UTC
Created attachment 923127 [details]
ERROR: bigint out of range on setting parameter with long interger value

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:

Comment 1 Sachin Ghai 2014-08-01 07:57:23 UTC
Created attachment 923128 [details]
UI shows long numerid value for param "entries_per_page"

Comment 2 Dominic Cleal 2014-08-01 08:00:25 UTC
Created redmine issue http://projects.theforeman.org/issues/6874 from this bug

Comment 3 Sachin Ghai 2014-08-01 08:01:45 UTC
Please note that there are other parameters under general tab, like "idle_timeout", "max_trend". we should define higher limits of these parameters too. As of now I can define any numeric value for these parameters.

Comment 4 Dominic Cleal 2014-08-01 08:04:17 UTC
idle_timeout shouldn't be a problem, it was fixed in bug #1113349.  If there are different issues with extreme values of those settings, new BZs would be best as they're not really related.

Comment 5 Sachin Ghai 2014-08-01 08:10:26 UTC


(In reply to Dominic Cleal from comment #4)
> idle_timeout shouldn't be a problem, it was fixed in bug #1113349.

I can still set long integer value for idle_timeout though I didn't see any error or issue after setting it. But it would be good if we can set certain limit for such parameters.

>  If there
> are different issues with extreme values of those settings, new BZs would be
> best as they're not really related.

Sure. thank you.

Comment 6 Dominic Cleal 2014-08-01 08:11:52 UTC
(In reply to Sachin Ghai from comment #5)
> 
> 
> (In reply to Dominic Cleal from comment #4)
> > idle_timeout shouldn't be a problem, it was fixed in bug #1113349.
> 
> I can still set long integer value for idle_timeout though I didn't see any
> error or issue after setting it. But it would be good if we can set certain
> limit for such parameters.

If it doesn't cause any problems, I don't think there's a reason to limit it.  The bug was easily fixed, but I'm sure a limit would have been introduced if necessary.

It might be this setting will get a limit to fix the bug you found.

Comment 8 Bryan Kearney 2014-08-21 10:04:25 UTC
Upstream bug assigned to orabin@redhat.com

Comment 9 Bryan Kearney 2014-09-15 13:44:51 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/6874 has been closed
-------------
Ori Rabin
Applied in changeset commit:c737b10e70187bfeeb0727edc2282f25cf7165e4.

Comment 10 Tazim Kolhar 2014-12-12 12:59:00 UTC
VERIFIED:

*** This bug is verified in upstream. This fix should eventually land in future downstream builds ***

# rpm -q | grep foreman
rpm: no arguments given for query
[root@qe-foreman-rhel66 ~]# rpm -qa | grep foreman
foreman-ovirt-1.8.0-0.develop.201412111740git287d974.el6.noarch
qe-foreman-rhel66.usersys.redhat.com-puppet-client-1.0-1.noarch
foreman-gce-1.8.0-0.develop.201412111740git287d974.el6.noarch
ruby193-rubygem-foreman-tasks-0.6.10-2.el6.noarch
rubygem-hammer_cli_foreman-0.1.4-1.201412111235git2131f5d.el6.noarch
foreman-release-1.8.0-0.develop.201412111740git287d974.el6.noarch
qe-foreman-rhel66.usersys.redhat.com-foreman-client-1.0-1.noarch
qe-foreman-rhel66.usersys.redhat.com-qpid-client-cert-1.0-1.noarch
ruby193-rubygem-foreman_docker-0.2.0-2.el6.noarch
ruby193-rubygem-foreman_discovery-1.4.1-1.el6.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2-1.el6.noarch
foreman-libvirt-1.8.0-0.develop.201412111740git287d974.el6.noarch
qe-foreman-rhel66.usersys.redhat.com-apache-1.0-1.noarch
qe-foreman-rhel66.usersys.redhat.com-parent-cert-1.0-1.noarch
foreman-1.8.0-0.develop.201412111740git287d974.el6.noarch
foreman-vmware-1.8.0-0.develop.201412111740git287d974.el6.noarch
foreman-selinux-1.8.0-0.develop.201411281557gitf4a857f.el6.noarch
foreman-proxy-1.8.0-0.develop.201412111700gita7c8c34.el6.noarch
foreman-postgresql-1.8.0-0.develop.201412111740git287d974.el6.noarch
qe-foreman-rhel66.usersys.redhat.com-foreman-proxy-1.0-1.noarch
qe-foreman-rhel66.usersys.redhat.com-qpid-broker-1.0-1.noarch
foreman-compute-1.8.0-0.develop.201412111740git287d974.el6.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410gitc96619d.git.0.37f3704.el6.noarch

UI does not allow to set long integer value under 

  settings --> general --> select "entries_per_page"

screen shot attached

Comment 11 Tazim Kolhar 2014-12-12 13:00:08 UTC
Created attachment 967624 [details]
entries per page value

Comment 12 Bryan Kearney 2015-08-11 13:19:39 UTC
This bug is slated to be released with Satellite 6.1.

Comment 13 errata-xmlrpc 2015-08-12 05:12:31 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-2015:1592


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