Project

General

Profile

Actions

Bug #17360

closed

Filter on FactValue with like-search fails with "malformed format string - % (ArgumentError)"

Added by Sebastian Bublitz over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Search
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi everyone,

I have been trying to create a filter for a role on the FactValue resource.
Applying filters with equals operator works perfectly fine, but filtering with a like search raises a "malformed format string - %k (ArgumentError)".
This happens both via WebUI and via hammer.
Here is the stacktrace hammer shows me when updating the filter via "hammer filter update --id <id> --search 'host ~ <name>'":

/opt/theforeman/tfm/root/usr/share/gems/gems/fast_gettext-1.1.0/lib/fast_gettext/vendor/string.rb:70:in `%': malformed format string - %k (ArgumentError)
from /opt/theforeman/tfm/root/usr/share/gems/gems/fast_gettext-1.1.0/lib/fast_gettext/vendor/string.rb:70:in `%'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/utils.rb:12:in `format'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/output/adapter/abstract.rb:32:in `print_error'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/output/output.rb:16:in `print_error'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/exception_handler.rb:45:in `print_error'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/exception_handler.rb:62:in `handle_general_exception'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/exception_handler.rb:28:in `handle_exception'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/abstract.rb:189:in `handle_exception'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/abstract.rb:26:in `rescue in run'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/lib/hammer_cli/abstract.rb:22:in `run'
from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
from /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.7.0/bin/hammer:125:in `<top (required)>'
from /bin/hammer:23:in `load'
from /bin/hammer:23:in `<main>'

The same error message (malformed format string - %k) appears in the WebUI when applying a like filter on the facts page in the filter box, or when searching facts via hammer with a like search.

This was tested on Katello 3.1/Foreman 1.12.4, but since I could not find a ticket for this issue, I'm assuming this bug is still around.

Actions

Also available in: Atom PDF