Project

General

Profile

Actions

Bug #6712

closed

PGError when media name exceeds 255 characters

Added by Dominic Cleal over 9 years ago. Updated over 9 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
Database
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1121936
Description of problem:
I was trying to perform boundary test are created a install media with more than 255 characters and UI raises following error:

Error
PGError: ERROR: value too long for type character varying(255) : INSERT INTO "media" ("config_path", "created_at", "image_path", "media_path", "name", "os_family", "path", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"

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

How reproducible:
always

Steps to Reproduce:
1. create media with more than 255 characters of name
2.
3.

Actual results:
Error
PGError: ERROR: value too long for type character varying(255) : INSERT INTO "media" ("config_path", "created_at", "image_path", "media_path", "name", "os_family", "path", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"

Expected results:
A proper validation error should be raised.

Additional info:
production.log:

Processing by MediaController#create as */*
Parameters: {"utf8"=>"✓", "search"=>"", "authenticity_token"=>"VX+UKFuIgqWyHwxAdhnLIrzFLAmDgGh5qENjFuLnsso=", "medium"=>{"name"=>"GlQTCDmDxesNUcEJdEXrqTPuIbBUmQwkejHGSrMbHsLGdhADopvRvwnLXHMReeAtIxlkRNpuKAkHGHMziLsnOndDMfemCoDgJewqSrwAXUTLAKeNnCeleDJeGBVnlmzBzZamfDmUBMjqJchefmIxCnJuHGoHilwrnMCRNZuMQnwyEguohCjIMznZRkGHrZXKmHikPGUblhRyBJxoZoadIiUKmlhoAxtzBZtjezFyrIsQSZvcYSjTuwGHwYjUCbM1", "path"=>"http://mirror.fakeos.org/vVcP/$major.$minor/os/$arch", "media_path"=>"", "config_path"=>"", "image_path"=>"", "os_family"=>"Redhat", "location_ids"=>[""], "organization_ids"=>[""]}}
Operation FAILED: PGError: ERROR: value too long for type character varying(255)
: INSERT INTO "media" ("config_path", "created_at", "image_path", "media_path", "name", "os_family", "path", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"
Rendered common/500.html.erb (6.9ms)
Completed 500 Internal Server Error in 23ms (Views: 7.6ms | ActiveRecord: 2.1ms)


Related issues 3 (0 open3 closed)

Related to Foreman - Bug #4153: Model validation errorDuplicateOri Rabin01/21/2014Actions
Related to Foreman - Bug #6658: creating compute resource with name more than 245 chars failsDuplicateOri Rabin07/17/2014Actions
Is duplicate of Foreman - Bug #6694: PGError: while creating OS with long (greater than 5 chars) minor/major version valuesClosedOri Rabin07/20/2014Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Category set to Database
Actions #2

Updated by Dominic Cleal over 9 years ago

  • Related to Bug #4153: Model validation error added
Actions #3

Updated by Dominic Cleal over 9 years ago

Please see the related issue and check for other models so we don't have this again.

Actions #4

Updated by Ori Rabin over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin
Actions #5

Updated by Dominic Cleal over 9 years ago

  • Related to Bug #6658: creating compute resource with name more than 245 chars fails added
Actions #6

Updated by Ori Rabin over 9 years ago

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

Updated by Dominic Cleal over 9 years ago

  • Is duplicate of Bug #6694: PGError: while creating OS with long (greater than 5 chars) minor/major version values added
Actions #8

Updated by Dominic Cleal over 9 years ago

  • Status changed from Ready For Testing to Duplicate
Actions

Also available in: Atom PDF