Project

General

Profile

Bug #29682

Unable to update default value of a smart class parameter (Sql query error).

Added by Kavita Gaikwad 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Organizations and Locations
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

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

Description of problem: Unable to update the default value of a smart class parameter

hammer sc-param update --id 3086 --default-value '["ntp3.csv.local iburst trust","ntp4.csv.local iburst"]'
Could not update the parameter:
PG::ProtocolViolation: ERROR: invalid message format
: SELECT "taxonomies".* FROM "taxonomies" WHERE "taxonomies"."id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9.......<Record truncated>......
....$270159, $270160, $270161, $270162, $270163, $270164) ORDER BY "taxonomies"."title" ASC
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `async_exec'

Version-Release number of selected component (if applicable): Satellite 6.6

Actual results: Fails to update default value of smart class parameter.

Expected results: Should able to update default value

Additional info:

It seems the above query fails due to SQL query constructed with large arguments(around 2.7L parameters) and it fails to execute.

Associated revisions

Revision f013e3ca (diff)
Added by Kavita Gaikwad 3 months ago

Fixes #29682 - remove duplicate elements in audit set_taxonomies

Revision 171a2204 (diff)
Added by Kavita Gaikwad 3 months ago

Refs #29682 - added test to verify audit change

Revision f03a1aae (diff)
Added by Kavita Gaikwad 3 months ago

Refs #29682 - refactored test case

Revision 2757f7f8 (diff)
Added by Kavita Gaikwad 3 months ago

Refs #29682 - apply distinct & reorder on taxonomies association

History

#1 Updated by Kavita Gaikwad 3 months ago

  • Assignee set to Kavita Gaikwad

#2 Updated by The Foreman Bot 3 months ago

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

#3 Updated by The Foreman Bot 3 months ago

  • Fixed in Releases 2.2.0 added

#4 Updated by Tomer Brisker 3 months ago

  • Fixed in Releases 2.1.0 added
  • Fixed in Releases deleted (2.2.0)

#5 Updated by Kavita Gaikwad 3 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF