Project

General

Profile

Actions

Bug #35990

closed

Parameter 'search' on fact_value API endpoint results in internal server error

Added by Nofar Alfassi about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2162736

Description of problem:
Searching for facts using CLI ends with error 500.

Version-Release number of selected component (if applicable):
Satellite 6.13 SNAP 6.0

How reproducible:
always

Steps to Reproduce:
1. hammer fact list --search="ipaddress"

Actual results:
Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs.

Expected results:
List of facts containing search phrase

Additional info:

production.log contains a note about missing attribute: fact_name_id

2023-01-20T11:58:45 [I|app|7c831d64] Started GET "/api/fact_values?search=ipaddress&page=1&per_page=1000" for 10.1.2.100 at 2023-01-20 11:58:45 -0500
2023-01-20T11:58:45 [I|app|7c831d64] Processing by Api::V2::FactValuesController#index as JSON
2023-01-20T11:58:45 [I|app|7c831d64]   Parameters: {"search"=>"ipaddress", "page"=>"1", "per_page"=>"1000", "apiv"=>"v2", "fact_value"=>{}}
2023-01-20T11:58:45 [I|app|7c831d64] Authorized user admin(Admin User)
2023-01-20T11:58:45 [W|app|7c831d64] Action failed
2023-01-20T11:58:45 [I|app|7c831d64] Backtrace for 'Action failed' error (ActiveModel::MissingAttributeError): missing attribute: fact_name_id
 7c831d64 | /usr/share/gems/gems/activemodel-6.1.7/lib/active_model/attribute.rb:222:in `value'
 7c831d64 | /usr/share/gems/gems/activemodel-6.1.7/lib/active_model/attribute_set/builder.rb:55:in `block in fetch_value'
 --- shrinked ---
 7c831d64 | /usr/share/gems/gems/puma-5.6.5/lib/puma/server.rb:443:in `process_client'
 7c831d64 | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
 7c831d64 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-01-20T11:58:45 [I|app|7c831d64]   Rendered api/v2/errors/custom_error.json.rabl within api/v2/layouts/error_layout (Duration: 1.2ms | Allocations: 318)
2023-01-20T11:58:45 [I|app|7c831d64]   Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 1.9ms | Allocations: 534)
2023-01-20T11:58:45 [I|app|7c831d64] Completed 500 Internal Server Error in 192ms (Views: 3.6ms | ActiveRecord: 16.8ms | Allocations: 12880)

Searching facts using WebUI works correctly.
Same command worked correctly in Satellite 6.12.


Related issues 2 (0 open2 closed)

Has duplicate Foreman - Bug #34990: hammer not inhering facts value DuplicateActions
Has duplicate Foreman - Bug #35591: Can't use 'search' with fact_value via APIDuplicateActions
Actions #1

Updated by Nofar Alfassi about 1 year ago

  • Project changed from Foreman to Ansible
  • Subject changed from Can't search facts using CLI to Can't search facts using CLI
  • Category deleted (Facts)
Actions #2

Updated by Nofar Alfassi about 1 year ago

  • Project changed from Ansible to Foreman
Actions #3

Updated by Nofar Alfassi about 1 year ago

  • Assignee set to Nofar Alfassi
Actions #4

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Description updated (diff)

I think this is a duplicate of #35591 where I already did the analysis.

Actions #5

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Related to Feature #25591: Remove infoblox parameter named use_ranges added
Actions #6

Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/9596 added
Actions #7

Updated by The Foreman Bot about 1 year ago

  • Fixed in Releases 3.6.0 added
Actions #8

Updated by Nofar Alfassi about 1 year ago

  • Status changed from Ready For Testing to Closed
Actions #9

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Has duplicate Bug #34990: hammer not inhering facts value added
Actions #10

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Related to deleted (Feature #25591: Remove infoblox parameter named use_ranges)
Actions #11

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Has duplicate Bug #35591: Can't use 'search' with fact_value via API added
Actions #12

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Subject changed from Can't search facts using CLI to Parameter 'search' on ith fact_value via API
  • Category set to API
  • Triaged changed from No to Yes
Actions #13

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Subject changed from Parameter 'search' on ith fact_value via API to Parameter 'search' on fact_value API endpoint results in internal server error
  • Target version set to 3.5.2
Actions #14

Updated by The Foreman Bot about 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/9641 added
Actions #15

Updated by The Foreman Bot about 1 year ago

  • Fixed in Releases 3.5.3 added
Actions #16

Updated by Ian Ballou about 1 year ago

  • Target version changed from 3.5.2 to 3.5.3
Actions

Also available in: Atom PDF