Bug #6280
closedcrash adding a smart variable matcher
Description
When entering a smart variable for a puppet class with a really long value in a matcher i get the following crash
ActiveRecord::StatementInvalid
PGError: ERROR: value too long for type character varying(255) : INSERT INTO "audits" ("action", "associated_id", "associated_name", "associated_type", "auditable_id", "auditable_name", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "user_id", "user_type", "username", "version") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) RETURNING "id"
app/controllers/puppetclasses_controller.rb:32:in `update'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
the value attempting to be saved is over 400 characters long
sample value that causes the issue
["10.50.14.67600","10.50.14.77600","10.50.14.87600","10.50.14.97600","10.50.14.107600","10.50.14.117600","10.50.14.127600","10.50.14.147600","10.50.14.147600","10.50.14.157600","10.50.14.167600","10.50.14.177600","10.50.14.167600","10.50.14.177600","10.50.14.207600","10.50.14.217600","10.50.14.227600","10.50.14.237600","10.50.14.287600","10.50.14.297600","10.50.14.407600","10.50.14.417600","10.50.14.427600","10.50.14.437600"]
the smart variable is an array
the match key is a hostgroup of the form gppbase/int1/gppxxxxxxxx
I placed it against the audit log because of the table it was updating