Red Hat Bugzilla – Bug 1187480
Searching applicable errata by package_name throwing internal server error on UI and PGError in production.log
Last modified: 2017-02-23 15:36:59 EST
Created attachment 985875 [details] 500 internal server error raised in firebug Description of problem: while searching applicable errata by package_name throwing 500 Internal server error in firebug and PGError on production.log from production.log: ===================== Processing by Katello::Api::V2::ErrataController#index as JSON Parameters: {"errata_restrict_applicable"=>"true", "organization_id"=>"1", "page"=>"1", "paged"=>"true", "repository_id"=>"4", "search"=>" package_name = zsh", "sort_by"=>"updated", "sort_order"=>"DESC", "api_version"=>"v2"} Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0/app/views/katello/api/v2/errata/index.json.rabl within katello/api/v2/layouts/collection (7.5ms) ActiveRecord::StatementInvalid: PGError: ERROR: syntax error at or near "DISTINCT" LINE 1: SELECT DISTINCT DISTINCT "katello_errata".id, katello_errat... ^ : SELECT DISTINCT DISTINCT "katello_errata".id, katello_errata.updated AS alias_0 FROM "katello_errata" INNER JOIN "katello_repository_errata" ON "katello_repository_errata"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_system_errata" ON "katello_system_errata"."erratum_id" = "katello_errata"."id" LEFT OUTER JOIN "katello_erratum_packages" ON "katello_erratum_packages"."erratum_id" = "katello_errata"."id" WHERE "katello_repository_errata"."repository_id" IN (SELECT "katello_repositories"."id" FROM "katello_repositories" WHERE "katello_repositories"."product_id" IN (SELECT "katello_products"."id" FROM "katello_products" ) AND "katello_repositories"."environment_id" IN (4, 3, 2, 1) ORDER BY katello_repositories.name ASC) AND "katello_system_errata"."system_id" IN (SELECT "katello_systems"."id" FROM "katello_systems" ) AND (("katello_errata"."id" IN (SELECT "erratum_id" FROM "katello_erratum_packages" WHERE "katello_erratum_packages"."name" = 'zsh' ))) ORDER BY katello_errata.updated DESC LIMIT 20 OFFSET 0 Version-Release number of selected component (if applicable): * apr-util-ldap-1.3.9-3.el6_0.1.x86_64 * candlepin-0.9.38-1.el6.noarch * candlepin-common-1.0.18-1.el6.noarch * candlepin-selinux-0.9.38-1.el6.noarch * candlepin-tomcat6-0.9.38-1.el6.noarch * elasticsearch-0.90.10-7.el6.noarch * foreman-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-compute-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-gce-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-libvirt-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-ovirt-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-postgresql-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-proxy-1.8.0-0.develop.201501261316git9ea2ac7.el6.noarch * foreman-release-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-selinux-1.8.0-0.develop.201412151103gite2863e4.el6.noarch * foreman-vmware-1.8.0-0.develop.201501270025gite86494a.el6.noarch * katello-2.1.0-1.201411061509gitb0b8f43.el6.noarch * katello-certs-tools-2.0.1-1.el6.noarch * katello-default-ca-1.0-1.noarch * katello-installer-2.2.0-1.201501230914git3dbe606.el6.noarch * katello-installer-base-2.2.0-1.201501230914git3dbe606.el6.noarch * katello-repos-2.1.1-1.el6.noarch * katello-server-ca-1.0-1.noarch * openldap-2.4.39-8.el6.x86_64 * pulp-docker-plugins-0.2.1-0.2.beta.el6.noarch * pulp-katello-0.3-3.el6.noarch * pulp-nodes-common-2.5.1-1.el6.noarch * pulp-nodes-parent-2.5.1-1.el6.noarch * pulp-puppet-plugins-2.5.1-1.el6.noarch * pulp-puppet-tools-2.5.1-1.el6.noarch * pulp-rpm-plugins-2.5.1-1.el6.noarch * pulp-selinux-2.5.1-1.el6.noarch * pulp-server-2.5.1-1.el6.noarch * python-ldap-2.3.10-1.el6.x86_64 * ruby193-rubygem-ldap_fluff-0.3.3-1.el6.noarch * ruby193-rubygem-net-ldap-0.10.0-1.el6.noarch * ruby193-rubygem-runcible-1.3.0-1.el6.noarch * rubygem-hammer_cli-0.1.4-1.201501260908gitf44b8c5.el6.noarch * rubygem-hammer_cli_foreman-0.1.4-1.201501221305git706b057.el6.noarch * rubygem-hammer_cli_foreman_bootdisk-0.1.2-1.el6.noarch * How reproducible: always Steps to Reproduce: 1. Go to Errata page, make sure org is selected 2. select the repo from dropdown 3. Select Applicable check-box 4. search the "package_name = zsh" Make sure firebug is open Actual results: Expected results: firebug: ======= "NetworkError: 500 Internal Server Error - https://dhcp201-185.englab.pnq.redhat.com/katello/api/v2/errata?errata_restrict_applicable=true&organization_id=1&page=1&paged=true&repository_id=4&search=++package_name+%3D+zsh&sort_by=updated&sort_order=DESC" production.log: ================ from production.log: ===================== Processing by Katello::Api::V2::ErrataController#index as JSON Parameters: {"errata_restrict_applicable"=>"true", "organization_id"=>"1", "page"=>"1", "paged"=>"true", "repository_id"=>"4", "search"=>" package_name = zsh", "sort_by"=>"updated", "sort_order"=>"DESC", "api_version"=>"v2"} Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0/app/views/katello/api/v2/errata/index.json.rabl within katello/api/v2/layouts/collection (7.5ms) ActiveRecord::StatementInvalid: PGError: ERROR: syntax error at or near "DISTINCT" LINE 1: SELECT DISTINCT DISTINCT "katello_errata".id, katello_errat... ^ : SELECT DISTINCT DISTINCT "katello_errata".id, katello_errata.updated AS alias_0 FROM "katello_errata" INNER JOIN "katello_repository_errata" ON "katello_repository_errata"."erratum_id" = "katello_errata"."id" INNER JOIN "katello_system_errata" ON "katello_system_errata"."erratum_id" = "katello_errata"."id" LEFT OUTER JOIN "katello_erratum_packages" ON "katello_erratum_packages"."erratum_id" = "katello_errata"."id" WHERE "katello_repository_errata"."repository_id" IN (SELECT "katello_repositories"."id" FROM "katello_repositories" WHERE "katello_repositories"."product_id" IN (SELECT "katello_products"."id" FROM "katello_products" ) AND "katello_repositories"."environment_id" IN (4, 3, 2, 1) ORDER BY katello_repositories.name ASC) AND "katello_system_errata"."system_id" IN (SELECT "katello_systems"."id" FROM "katello_systems" ) AND (("katello_errata"."id" IN (SELECT "erratum_id" FROM "katello_erratum_packages" WHERE "katello_erratum_packages"."name" = 'zsh' ))) ORDER BY katello_errata.updated DESC LIMIT 20 OFFSET 0 Version-Release number of selected component (if applicable): * apr-util-ldap-1.3.9-3.el6_0.1.x86_64 * candlepin-0.9.38-1.el6.noarch * candlepin-common-1.0.18-1.el6.noarch * candlepin-selinux-0.9.38-1.el6.noarch * candlepin-tomcat6-0.9.38-1.el6.noarch * elasticsearch-0.90.10-7.el6.noarch * foreman-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-compute-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-gce-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-libvirt-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-ovirt-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-postgresql-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-proxy-1.8.0-0.develop.201501261316git9ea2ac7.el6.noarch * foreman-release-1.8.0-0.develop.201501270025gite86494a.el6.noarch * foreman-selinux-1.8.0-0.develop.201412151103gite2863e4.el6.noarch * foreman-vmware-1.8.0-0.develop.201501270025gite86494a.el6.noarch * katello-2.1.0-1.201411061509gitb0b8f43.el6.noarch * katello-certs-tools-2.0.1-1.el6.noarch * katello-default-ca-1.0-1.noarch * katello-installer-2.2.0-1.201501230914git3dbe606.el6.noarch * katello-installer-base-2.2.0-1.201501230914git3dbe606.el6.noarch * katello-repos-2.1.1-1.el6.noarch * katello-server-ca-1.0-1.noarch * openldap-2.4.39-8.el6.x86_64 * pulp-docker-plugins-0.2.1-0.2.beta.el6.noarch * pulp-katello-0.3-3.el6.noarch * pulp-nodes-common-2.5.1-1.el6.noarch * pulp-nodes-parent-2.5.1-1.el6.noarch * pulp-puppet-plugins-2.5.1-1.el6.noarch * pulp-puppet-tools-2.5.1-1.el6.noarch * pulp-rpm-plugins-2.5.1-1.el6.noarch * pulp-selinux-2.5.1-1.el6.noarch * pulp-server-2.5.1-1.el6.noarch * python-ldap-2.3.10-1.el6.x86_64 * ruby193-rubygem-ldap_fluff-0.3.3-1.el6.noarch * ruby193-rubygem-net-ldap-0.10.0-1.el6.noarch * ruby193-rubygem-runcible-1.3.0-1.el6.noarch * rubygem-hammer_cli-0.1.4-1.201501260908gitf44b8c5.el6.noarch * rubygem-hammer_cli_foreman-0.1.4-1.201501221305git706b057.el6.noarch * rubygem-hammer_cli_foreman_bootdisk-0.1.2-1.el6.noarch * Additional info:
Created attachment 985876 [details] complete logs from production.log
resolved as part of https://bugzilla.redhat.com/show_bug.cgi?id=1179462 but on a different page, so moving to on-qa
Failed Satellite-6.1.0-RHEL-6-20150224.0
This will be fixed by https://bugzilla.redhat.com/show_bug.cgi?id=1198363 Moving to POST. No additional cherrypick needed.
Verified in Satellite-6.1.0-RHEL-6-20150311.1. I am able to search the package names in errata page.
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. https://access.redhat.com/errata/RHSA-2015:1592