Hide Forgot
Description of problem: Executing "hammer role filters" command throws SQL errors Version-Release number of selected component (if applicable): foreman-1.7.2.46-1.el7sat.noarch foreman-compute-1.7.2.46-1.el7sat.noarch foreman-debug-1.7.2.46-1.el7sat.noarch foreman-gce-1.7.2.46-1.el7sat.noarch foreman-libvirt-1.7.2.46-1.el7sat.noarch foreman-ovirt-1.7.2.46-1.el7sat.noarch foreman-postgresql-1.7.2.46-1.el7sat.noarch foreman-proxy-1.7.2.6-1.el7sat.noarch foreman-selinux-1.7.2.16-1.el7sat.noarch foreman-vmware-1.7.2.46-1.el7sat.noarch ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch ruby193-rubygem-foreman_discovery-2.0.0.19-1.el7sat.noarch ruby193-rubygem-foreman_docker-1.2.0.24-1.el7sat.noarch ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch ruby193-rubygem-foreman-redhat_access-0.2.3-1.el7sat.noarch ruby193-rubygem-foreman-tasks-0.6.15.7-1.el7sat.noarch rubygem-hammer_cli-0.1.4.13-1.el7sat.noarch rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch rubygem-hammer_cli_foreman_docker-0.0.3.9-1.el7sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el7sat.noarch rubygem-hammer_cli_gutterball-0.0.1.3-1.el7sat.noarch rubygem-hammer_cli_import-0.10.20-1.el7sat.noarch rubygem-hammer_cli_katello-0.0.7.18-1.el7sat.noarch How reproducible: 100 % Steps to Reproduce: 1. Execute hammer role filters # hammer role filters PGError: ERROR: invalid input syntax for integer: "" LINE 1: ..."id" = "filters"."role_id" WHERE (("roles"."id" = '')) ORDER... ^ : SELECT "filters"."id" AS t0_r0, "filters"."search" AS t0_r1, "filters"."role_id" AS t0_r2, "filters"."created_at" AS t0_r3, "filters"."updated_at" AS t0_r4, "filters"."taxonomy_search" AS t0_r5, "roles"."id" AS t1_r0, "roles"."name" AS t1_r1, "roles"."builtin" AS t1_r2, "roles"."permissions" AS t1_r3 FROM "filters" LEFT OUTER JOIN "roles" ON "roles"."id" = "filters"."role_id" WHERE (("roles"."id" = '')) ORDER BY role_id, filters.id LIMIT 20 OFFSET 0 Actual results: Throws SQL errors when executing the command Expected results: Ideally it should display a warning stating that ID of the role is missing Additional info: "hammer role filters" command is expecting an ID to be passed in with the command, if it finds NULL then it throws the above SQL error. # hammer role list ---|----------------------- ID | NAME ---|----------------------- 1 | Discovery Reader 2 | Discovery Manager 3 | Tasks Manager 4 | Tasks Reader 5 | Red Hat Access Logs 6 | Access Insights Viewer 7 | Access Insights Admin 8 | Boot disk access 9 | Manager 10 | Edit partition tables 11 | View hosts 12 | Edit hosts 13 | Viewer 14 | Site manager 15 | Default user 16 | Anonymous 17 | Admin ---|----------------------- # hammer role filter --id 1 ---> This command works fine ---|---------------|--------|------------|------------------|---------------------- ID | RESOURCE TYPE | SEARCH | UNLIMITED? | ROLE | PERMISSIONS ---|---------------|--------|------------|------------------|---------------------- 1 | Location | none | yes | Discovery Reader | view_locations 2 | Organization | none | yes | Discovery Reader | view_organizations 3 | Host | none | yes | Discovery Reader | view_discovered_hosts 4 | DiscoveryRule | none | yes | Discovery Reader | view_discovery_rules ---|---------------|--------|------------|------------------|----------------------
Moving this out of 6.1.7 due to capacity issues. Will keep it on the 6.1.z and 6.2 trackers to ensure that it is evaluated for both.
Created redmine issue http://projects.theforeman.org/issues/14235 from this bug
Upstream bug component is Provisioning
patch added http://projects.theforeman.org/issues/13064
Upstream bug component is Search
*** Bug 1368408 has been marked as a duplicate of this bug. ***
any chance we can get a target 6.2.z for this one? Karl
Verified on Sat 6.3 Snap 1.0 with automation test: 2017-06-06 09:48:45 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=json role filters 2017-06-06 09:48:47 - robottelo.ssh - INFO - <<< stderr [ERROR 2017-06-06 02:48:47 Exception] Error: At least one of options --name, --id is required See: 'hammer role filters --help'
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