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 over 5 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 #1

Updated by Ori Rabin over 9 years ago

  • Status changed from New to Assigned
Actions #2

Updated by Dominic Cleal over 9 years ago

  • Category set to Audit Log
  • Target version set to 1.7.5
Actions #3

Updated by Dominic Cleal over 9 years ago

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

Updated by Anonymous over 9 years ago

  • Target version changed from 1.7.5 to 1.7.4
Actions #5

Updated by Anonymous over 9 years ago

  • Target version changed from 1.7.4 to 1.7.3
Actions #6

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release set to 22
Actions #7

Updated by Ori Rabin over 9 years ago

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

Also available in: Atom PDF