Project

General

Profile

Bug #7020

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

Added by Ori Rabin about 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Audit Log
Target version:
Difficulty:
Triaged:
Bugzilla link:
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)

Associated revisions

Revision 37021330 (diff)
Added by Ori Rabin almost 8 years ago

Fixed #7020: Validation instead or error when comments in 'audit comment' exceeds 255 characters

Revision 0c2caea8 (diff)
Added by Ori Rabin almost 8 years ago

Fixed #7020: Validation instead or error when comments in 'audit comment' exceeds 255 characters

(cherry picked from commit 370213303f77037dc508c20d9a16bd5d2a393bb2)

History

#1 Updated by Ori Rabin about 8 years ago

  • Status changed from New to Assigned

#2 Updated by Dominic Cleal about 8 years ago

  • Category set to Audit Log
  • Target version set to 1.7.5

#3 Updated by Dominic Cleal about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1681 added
  • Pull request deleted ()

#4 Updated by Dmitri Dolguikh almost 8 years ago

  • Target version changed from 1.7.5 to 1.7.4

#5 Updated by Dmitri Dolguikh almost 8 years ago

  • Target version changed from 1.7.4 to 1.7.3

#6 Updated by Dominic Cleal almost 8 years ago

  • Legacy Backlogs Release (now unused) set to 22

#7 Updated by Ori Rabin almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF