Project

General

Profile

Actions

Bug #7020

closed

Template: PGError: when comments in "audit comment" exceeds 255 characters

Added by Ori Rabin over 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Audit Log
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1121536
Description of problem:
while creating a template, I filled the audit comments with more than 255 characters and UI raised following error.

Error
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"

Version-Release number of selected component (if applicable):
sat6 GA snap1

How reproducible:
always

Steps to Reproduce:
1. while creating a New template fill the audit comments with more than 255 char.

Actual results:
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"

Expected results:
A proper validation error should be raised

Additional info:

production.log:

Processing by ConfigTemplatesController#create as */*
Parameters: {"utf8"=>"✓", "search"=>"", "authenticity_token"=>"CLZgGQh3Z80gTOE6iG1eaDPvDAf4ISpF73pxHLoz0K4=", "config_template"=>{"name"=>"testtemp", "template"=>"test", "audit_comment"=>"ojJELjrEfavaKHSkSDTncoiqjwik12345yyteyNSBmqcshsFlNcAsGExwayeTXjFOQmXTuVNWCotNUBMbiJmDKtsPtLnXqYJSjTUyNIlSNAAucqVkKXGFrViwyGLTRnqqBaLuGskexxWkYHTLHdLFMEXTmRLiGZgvkTGGmqGEKpGwzEOerEAbVJWBLaKytzydTwJcIQOUdBxowqKqIUSJKZkYHwUzkPWGjQMkpdpadzBctjvjBMDmpfPYurKybz1", "snippet"=>"0", "template_kind_id"=>"1", "operatingsystem_ids"=>["", "", "", ""]}, "keybinding"=>"Default"}
Operation FAILED: 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"
Rendered common/500.html.erb (7.2ms)
Completed 500 Internal Server Error in 30ms (Views: 7.9ms | ActiveRecord: 2.7ms)

Actions

Also available in: Atom PDF