Bug 1467722

Summary: Internal Server error when searching product repository by numbers with more than 9 digits
Product: Red Hat Satellite Reporter: Djebran Lezzoum <dlezzoum>
Component: RepositoriesAssignee: Jonathon Turel <jturel>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, ehelms, jturel, nkathole, oshtaier, satellite6-bugs
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-bastion-5.0.10 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:30:48 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:
Attachments:
Description Flags
screen1
none
screen2
none
screenshot of UI repositories created
none
Search with ID
none
Search with name none

Description Djebran Lezzoum 2017-07-04 20:44:07 UTC
Created attachment 1294334 [details]
screen1

Description of problem:
Internal Server error when searching product repository by numbers with more than 9 digits


Version-Release number of selected component (if applicable):
* candlepin-2.0.37-1.el7.noarch
* candlepin-selinux-2.0.37-1.el7.noarch
* foreman-1.15.1-1.el7sat.noarch
* foreman-cli-1.15.1-1.el7sat.noarch
* foreman-compute-1.15.1-1.el7sat.noarch
* foreman-debug-1.15.1-1.el7sat.noarch
* foreman-discovery-image-3.1.1-22.el7sat.noarch
* foreman-ec2-1.15.1-1.el7sat.noarch
* foreman-gce-1.15.1-1.el7sat.noarch
* foreman-installer-1.15.1-1.el7sat.noarch
* foreman-installer-katello-3.4.1.3-1.el7sat.noarch
* foreman-libvirt-1.15.1-1.el7sat.noarch
* foreman-openstack-1.15.1-1.el7sat.noarch
* foreman-ovirt-1.15.1-1.el7sat.noarch
* foreman-postgresql-1.15.1-1.el7sat.noarch
* foreman-proxy-1.15.0-2.el7sat.noarch
* foreman-rackspace-1.15.1-1.el7sat.noarch
* foreman-selinux-1.15.0-1.el7sat.noarch
* foreman-vmware-1.15.1-1.el7sat.noarch
* katello-3.4.2-1.el7sat.noarch
* katello-ca-consumer-sat-r220-02.lab.eng.rdu2.redhat.com-1.0-2.noarch
* katello-certs-tools-2.4.0-1.el7sat.noarch
* katello-client-bootstrap-1.4.0-1.el7sat.noarch
* katello-common-3.4.2-1.el7sat.noarch
* katello-debug-3.4.2-1.el7sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-base-3.4.1.3-1.el7sat.noarch
* katello-selinux-3.0.2-1.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* katello-service-3.4.2-1.el7sat.noarch
* openldap-2.4.40-13.el7.x86_64
* pulp-client-1.0-1.noarch
* pulp-docker-plugins-2.3.0-1.el7sat.noarch
* pulp-katello-1.0.2-1.el7sat.noarch
* pulp-ostree-plugins-1.2.1-1.el7sat.noarch
* pulp-puppet-plugins-2.12.2-1.el7sat.noarch
* pulp-puppet-tools-2.12.2-1.el7sat.noarch
* pulp-rpm-plugins-2.12.2-2.el7sat.noarch
* pulp-selinux-2.12.2-2.el7sat.noarch
* pulp-server-2.12.2-2.el7sat.noarch
* python-ldap-2.4.15-2.el7.x86_64
* tfm-rubygem-ldap_fluff-0.4.6-1.el7sat.noarch
* tfm-rubygem-net-ldap-0.15.0-1.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1.Goto products 
2. Create a product
3. Select the created product
4. create a repository (of any type) named 9876543210
5. in created and selected product select the repository tab
6. in the search box type 9876543210 

Actual results:
repository list became disabled and no result is returned, the repo created is not listed, in the inspect screen we can see the server response:
500 internal server error

Expected results:
The repo must be listed

Additional info:
this does not happen with all numbers, for example numbers that begin with 0 and 1, the error is reproduced with a search number of 11 digits.

This also does not happen because of the repository name, as if the repo name is for example "zoo" and we search by the numbers the error is also reproduced

Comment 1 Djebran Lezzoum 2017-07-04 20:44:39 UTC
Created attachment 1294335 [details]
screen2

Comment 4 Djebran Lezzoum 2017-07-05 06:49:39 UTC
After this error, it became impossible to search the product repositories a full page refresh is needed to be able to search by other works/keys

Comment 6 Brad Buckingham 2017-07-07 15:18:15 UTC
Are you able to search for the same, if specifying id= or name= ?

Comment 9 Jonathon Turel 2017-08-01 14:57:44 UTC
Connecting redmine issue http://projects.theforeman.org/issues/20350 from this bug

Comment 10 Jonathon Turel 2017-08-01 14:57:59 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20350 has been resolved.

Comment 11 Jonathon Turel 2017-08-01 15:01:07 UTC
Djebran,

Thanks for the report. I looked into it and found that the queries which are failing do so because those numbers are greater than the maximum value that can be held in a Postgres integer field. So, I believe the stack trace / error is a valid one.

However, I think the user experience of having to reload the page when the search breaks is very poor, so I fixed that problem in Katello.

Comment 12 Djebran Lezzoum 2017-08-02 14:40:25 UTC
Thanks Jonathon,

I guessed that it was the case, but also that the default search should be by "name" and not by "id"

Comment 17 Jonathon Turel 2017-09-19 19:56:44 UTC
Connecting redmine issue http://projects.theforeman.org/issues/21017 from this bug

Comment 18 Nikhil Kathole 2017-10-10 05:41:04 UTC
VERIFIED

Version Tested:
Satellite-6.3 Snap 19

steps:

1. Created product test
2. Created repository 
3. Search with 9876543210 , name = 9876543210, id = 9876543210

Successfully shows result for 9876543210 and name = 9876543210. For id = 9876543210, it shows Field 'id' not recognized for searching! (See attachments)

Comment 19 Nikhil Kathole 2017-10-10 05:41:51 UTC
Created attachment 1336610 [details]
screenshot of UI repositories created

Comment 20 Nikhil Kathole 2017-10-10 05:42:22 UTC
Created attachment 1336611 [details]
Search with ID

Comment 21 Nikhil Kathole 2017-10-10 05:42:52 UTC
Created attachment 1336612 [details]
Search with name

Comment 22 Bryan Kearney 2018-02-21 17:30:48 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-2018:0336