Bug 1117554 - Filtering tasks gives SQL error
Summary: Filtering tasks gives SQL error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Infrastructure
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Partha Aji
QA Contact: Kedar Bidarkar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-09 00:20 UTC by Brian J. Atkisson
Modified: 2019-09-26 14:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-11 12:20:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
filtering monitor tasks is now possible (38.29 KB, image/png)
2014-08-26 11:01 UTC, Kedar Bidarkar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 6822 0 None None None 2016-04-22 16:27:50 UTC

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.


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