Bug #31773
closedTasks view fails for non-admin with PG::SyntaxError: ERROR: syntax error at or near "\'1,6,4,3,5\'"
Description
b'Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1921150 \n\n*Description of problem:*\nViewing the tasks page as non admin user with cloned manager role that has organizations assigned fails in ui with:\n\nCould not receive data: Request failed with status code 500\n\nprodlog (attached) shows:\n\n[I|app|f5671e24] Backtrace for \'Action failed\' error (ActionView::Template:: Error): PG::SyntaxError: ERROR: syntax error at or near "\'1,6,4,3,5\'"\n f5671e24 | LINE 9: ...foreman_tasks_locks_taxonomy5f5e24.resource_id IN \'1,6,4,3,5...\n f5671e24 | ^\n\n*Version-Release number of selected component (if applicable):*\n\nSatellite 6.8 snap 10\n\n*How reproducible:*\nalways\n\n*Steps to Reproduce:*\n1. Have a satellite with mutliple orgs\n2. Clone a manager role, assign it to all or some orgs\n3. Create a user, assign the role to it, assign it to one or more of the role\'s orgs\n4. Log in as the user or impersonate, navigate to Monitor > Tasks\n\n*Actual results:*\nNo tasks listed, above errors shown\n\n*Expected results:*\nTasks viewed as exoected\n\n*Additional info:*\nSeems to be related to org assignment in cloned role, using the default manager role or using a cloned role with no org assigned doesn\'t produce this issue'
Updated by Adam Ruzicka over 4 years ago
- Subject changed from b'Tasks view fails for non-admin with PG::SyntaxError: ERROR: syntax error at or near "\'1,6,4,3,5\'"' to Tasks view fails for non-admin with PG::SyntaxError: ERROR: syntax error at or near "\'1,6,4,3,5\'"
Alternative steps to reproduce:
1) run foreman-rake console
2) Enter ForemanTasks::Task.search_for("organization_id ^ (1)").first
Note:
Searching by taxonomies on tasks still uses a custom external method, which doesn't handle queries with IN well.
Updated by Adam Ruzicka about 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 6cc246f1b44f62bf1010df807dd0d35872c8aad7.