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
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
Steps to Reproduce:
1. Go to settings --> general --> select "entries_per_page" and update it with long integer value
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)
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.
Created attachment 923128 [details]
UI shows long numerid value for param "entries_per_page"
Created redmine issue http://projects.theforeman.org/issues/6874 from this bug
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.
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.
(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.
(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.
Upstream bug assigned to email@example.com
Moving to POST since upstream bug http://projects.theforeman.org/issues/6874 has been closed
Applied in changeset commit:c737b10e70187bfeeb0727edc2282f25cf7165e4.
*** 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
UI does not allow to set long integer value under
settings --> general --> select "entries_per_page"
screen shot attached
Created attachment 967624 [details]
entries per page value
This bug is slated to be released with Satellite 6.1.
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.