Project

General

Profile

Bug #5807

PGError: "value too long for type character varying(255)" for INSERT INTO "audits" when overriding "smart variable" in hostgroup with >255 characters value.

Added by Petter Hassberg over 5 years ago. Updated over 5 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

After upgrading to foreman 1.5.0-1.el6, when overriding smart class variable in hostgroup, setting the value to something long, >255 characters, upon clicking "submit" button, instead of setting said variable, an error is thrown.

The following is the failing SQL statement in the postgres db:

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" 
   (0.2ms)  ROLLBACK

Both the fields "auditable_name" and "audited_changes" exceed 255 chars.

Instead, I would prefer it to accept these changes, and add said row to the database. It should either truncate too long values, or else permit longer texts to be inserted into these fields.


Related issues

Is duplicate of Foreman - Bug #5671: Stack trace due to audit table field being too shortClosed2014-05-12

History

#1 Updated by Dominic Cleal over 5 years ago

  • Is duplicate of Bug #5671: Stack trace due to audit table field being too short added

#2 Updated by Dominic Cleal over 5 years ago

  • Status changed from New to Duplicate
  • Legacy Backlogs Release (now unused) deleted (16)

Thanks for the report, a patch is being tracked in #5671.

Also available in: Atom PDF