Project

General

Profile

Actions

Bug #5807

closed

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 10 years ago. Updated over 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Difficulty:
Triaged:
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 1 (0 open1 closed)

Is duplicate of Foreman - Bug #5671: Stack trace due to audit table field being too shortClosedDominic Cleal05/12/2014Actions
Actions

Also available in: Atom PDF