Bug 1117554

Summary: Filtering tasks gives SQL error
Product: Red Hat Satellite Reporter: Brian J. Atkisson <batkisso>
Component: InfrastructureAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bbuckingham, cwelton, dcleal, jmontleo, kbidarka, mmccune, paji
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/6822
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:20:06 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
filtering monitor tasks is now possible none

Description Brian J. Atkisson 2014-07-09 00:20:32 UTC
Description of problem:
Attempting to filter tasks under Monitor -> Tasks results in the following SQL error.  In this case, I just attempted to filter 'Red', but entering any filter string in the search box results in a similar error.


Oops, we're sorry but something went wrong
 
Error
PGError: ERROR: zero-length delimited identifier at or near """" LINE 6: ...ks"."result" ILIKE '%Red%' OR foreman_tasks_locks."" ILIKE '... ^ : SELECT "foreman_tasks_tasks".* FROM "foreman_tasks_tasks" INNER JOIN "foreman_tasks_locks" ON "foreman_tasks_locks"."task_id" = "foreman_tasks_tasks"."id" INNER JOIN foreman_tasks_locks AS foreman_tasks_locks_owner ON (foreman_tasks_locks_owner.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_owner.resource_type = 'User' AND foreman_tasks_locks_owner.name = 'task_owner') INNER JOIN users ON (users.id = foreman_tasks_locks_owner.resource_id) WHERE (("foreman_tasks_tasks"."id" ILIKE '%Red%' OR "foreman_tasks_tasks"."label" ILIKE '%Red%' OR "foreman_tasks_tasks"."state" ILIKE '%Red%' OR "foreman_tasks_tasks"."result" ILIKE '%Red%' OR foreman_tasks_locks."" ILIKE 'Red' OR users."" ILIKE 'Red' OR users."" ILIKE 'Red')) ORDER BY "foreman_tasks_tasks"."started_at" DESC NULLS LAST LIMIT 20 OFFSET 0

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.

ActiveRecord::StatementInvalid
PGError: ERROR: zero-length delimited identifier at or near """" LINE 6: ...ks"."result" ILIKE '%Red%' OR foreman_tasks_locks."" ILIKE '... ^ : SELECT "foreman_tasks_tasks".* FROM "foreman_tasks_tasks" INNER JOIN "foreman_tasks_locks" ON "foreman_tasks_locks"."task_id" = "foreman_tasks_tasks"."id" INNER JOIN foreman_tasks_locks AS foreman_tasks_locks_owner ON (foreman_tasks_locks_owner.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_owner.resource_type = 'User' AND foreman_tasks_locks_owner.name = 'task_owner') INNER JOIN users ON (users.id = foreman_tasks_locks_owner.resource_id) WHERE (("foreman_tasks_tasks"."id" ILIKE '%Red%' OR "foreman_tasks_tasks"."label" ILIKE '%Red%' OR "foreman_tasks_tasks"."state" ILIKE '%Red%' OR "foreman_tasks_tasks"."result" ILIKE '%Red%' OR foreman_tasks_locks."" ILIKE 'Red' OR users."" ILIKE 'Red' OR users."" ILIKE 'Red')) ORDER BY "foreman_tasks_tasks"."started_at" DESC NULLS LAST LIMIT 20 OFFSET 0
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call' 

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

ruby193-rubygem-foreman-redhat_access-0.0.4-1.el6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.el6sat.noarch
foreman-ovirt-1.6.0.21-1.el6sat.noarch
foreman-proxy-1.6.0.9-1.el6sat.noarch
katello-ca-1.0-1.noarch
foreman-compute-1.6.0.21-1.el6sat.noarch
ruby193-rubygem-foreman-tasks-0.6.3-2.el6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.5-2.el6sat.noarch
foreman-selinux-1.6.0-5.el6sat.noarch
foreman-1.6.0.21-1.el6sat.noarch
foreman-vmware-1.6.0.21-1.el6sat.noarch
ruby193-rubygem-foreman_discovery-1.3.0-0.1.rc2.el6sat.noarch
pulp-katello-0.3-3.el6sat.noarch
katello-1.5.0-26.el6sat.noarch
rubygem-hammer_cli_foreman-0.1.1-9.el6sat.noarch
foreman-postgresql-1.6.0.21-1.el6sat.noarch
katello-installer-0.0.53-1.el6sat.noarch
foreman-gce-1.6.0.21-1.el6sat.noarch
foreman-libvirt-1.6.0.21-1.el6sat.noarch
ruby193-rubygem-katello-1.5.0-65.el6sat.noarch
ruby193-rubygem-foreman_bootdisk-2.0.6-1.1.el6sat.noarch
katello-certs-tools-1.5.5-1.el6sat.noarch
rubygem-hammer_cli_katello-0.0.4-7.el6sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Login as Admin
2. Go to Monitor -> Tasks
3. Enter anything into Filter box.

Actual results:
Error above

Expected results:
Search results should be displayed.

Comment 1 RHEL Program Management 2014-07-09 00:33:45 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Walden Raines 2014-07-29 18:49:50 UTC
Created redmine issue http://projects.theforeman.org/issues/6822 from this bug

Comment 5 Walden Raines 2014-07-29 21:32:43 UTC
PR: https://github.com/Katello/katello/pull/4497

Comment 6 Walden Raines 2014-07-29 21:41:30 UTC
(In reply to Walden Raines from comment #5)
> PR: https://github.com/Katello/katello/pull/4497

Oops, wrong bug.

Comment 7 Partha Aji 2014-08-14 21:09:28 UTC
Should be fixed when https://github.com/theforeman/foreman-tasks/pull/82 gets accepted and a new release of foreman-task happens

Comment 9 Kedar Bidarkar 2014-08-26 11:01:20 UTC
Created attachment 930824 [details]
filtering monitor tasks is now possible

Comment 10 Kedar Bidarkar 2014-08-26 11:03:08 UTC
Tested with Sat6-GA-Snap6-compose3


Installed Packages

    candlepin-0.9.23-1.el6_5.noarch
    candlepin-common-1.0.1-1.el6_5.noarch
    candlepin-scl-1-5.el6_4.noarch
    candlepin-scl-quartz-2.1.5-5.el6_4.noarch
    candlepin-scl-rhino-1.7R3-1.el6_4.noarch
    candlepin-scl-runtime-1-5.el6_4.noarch
    candlepin-selinux-0.9.23-1.el6_5.noarch
    candlepin-tomcat6-0.9.23-1.el6_5.noarch
    createrepo-0.9.9-21.2.pulp.el6sat.noarch
    elasticsearch-0.90.10-6.el6sat.noarch
    katello-1.5.0-29.el6sat.noarch
    katello-certs-tools-1.5.6-1.el6sat.noarch
    katello-default-ca-1.0-1.noarch
    katello-installer-0.0.61-1.el6sat.noarch
    katello-server-ca-1.0-1.noarch
    m2crypto-0.21.1.pulp-10.el6sat.x86_64
    mod_wsgi-3.4-1.pulp.el6sat.x86_64
    pulp-katello-0.3-3.el6sat.noarch
    pulp-nodes-common-2.4.0-0.30.beta.el6sat.noarch
    pulp-nodes-parent-2.4.0-0.30.beta.el6sat.noarch
    pulp-puppet-plugins-2.4.0-0.30.beta.el6sat.noarch
    pulp-puppet-tools-2.4.0-0.30.beta.el6sat.noarch
    pulp-rpm-plugins-2.4.0-0.30.beta.el6sat.noarch
    pulp-selinux-2.4.0-0.30.beta.el6sat.noarch
    pulp-server-2.4.0-0.30.beta.el6sat.noarch
    python-gofer-qpid-1.3.0-1.el6sat.noarch
    python-isodate-0.5.0-1.pulp.el6sat.noarch
    python-kombu-3.0.15-12.pulp.el6sat.noarch
    python-pulp-bindings-2.4.0-0.30.beta.el6sat.noarch
    python-pulp-common-2.4.0-0.30.beta.el6sat.noarch
    python-pulp-puppet-common-2.4.0-0.30.beta.el6sat.noarch
    python-pulp-rpm-common-2.4.0-0.30.beta.el6sat.noarch
    python-qpid-0.22-14.el6sat.noarch
    python-qpid-qmf-0.22-37.el6.x86_64
    qpid-cpp-client-0.22-42.el6.x86_64
    qpid-cpp-server-0.22-42.el6.x86_64
    qpid-cpp-server-linearstore-0.22-42.el6.x86_64
    qpid-java-client-0.22-6.el6.noarch
    qpid-java-common-0.22-6.el6.noarch
    qpid-proton-c-0.7-1.el6.x86_64
    qpid-qmf-0.22-37.el6.x86_64
    qpid-tools-0.22-12.el6.noarch
    ruby193-rubygem-katello-1.5.0-85.el6sat.noarch
    rubygem-hammer_cli_katello-0.0.4-14.el6sat.noarch
    rubygem-smart_proxy_pulp-1.0.1-1.1.el6sat.noarch

Comment 11 Bryan Kearney 2014-09-11 12:20:06 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.