Project

General

Profile

Actions

Defect #15483

closed

Error 500 on Issue Update (postgres)

Added by M. Rohrmoser over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Symptom:

Update a issue description with more then 255 chars causes a HTTP 500.

$ tail -f current/log/*
> current/log/production.log <
ActiveRecord::StatementInvalid (PG::StringDataRightTruncation: ERROR: value too long for type character varying(255)
: INSERT INTO "journal_details" ("journal_id", "old_value", "prop_key", "property", "value") VALUES ($1, $2, $3, $4, $5) RETURNING "id"):
app/models/journal.rb:54:in `save'
app/models/issue.rb:1506:in `create_journal'
app/models/issue.rb:163:in `create_or_update'
app/controllers/issues_controller.rb:470:in `save_issue_with_child_records'
app/controllers/issues_controller.rb:458:in `save_issue_with_child_records'
app/controllers/issues_controller.rb:184:in `update'

Cause:

$ grep -A5 'create_table "journal_details"' db/schema.rb 
create_table "journal_details", :force => true do |t|
t.integer "journal_id", :default => 0, :null => false
t.string "property", :limit => 30, :default => "", :null => false
t.string "prop_key", :limit => 30, :default => "", :null => false
t.string "old_value"
t.string "value"

The last 2 need a larger datatype than the default `varchar(255)`.


$ psql --version
psql (PostgreSQL) 8.4.17
$ ruby script/about
sh: darcs: command not found
sh: hg: command not found
sh: cvs: command not found
sh: bzr: command not found
Environment:
Redmine version 2.4.0.stable
Ruby version 1.8.7-p358 (2012-02-08) [x86_64-linux]
Rails version 3.2.15
Environment production
Database adapter PostgreSQL
SCM:
Subversion 1.6.12
Git 1.7.2.5
Filesystem
Redmine plugins:
kramdown_formatter 0.0.1
redmine_redcarpet_formatter 2.0.1

Related issues

Related to Redmine - Defect #20831: journal_details table reverted value and old_value back to String on update from 2.6.0 to 3.1.1Closed

Actions
Actions #1

Updated by M. Rohrmoser over 10 years ago

table issues has

t.text     "description"

so above value + old_value have to be text as well.

Actions #2

Updated by Jean-Philippe Lang over 10 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid
Actions #3

Updated by M. Rohrmoser over 10 years ago

Sorry for reporting a duplicate - obviously there's been a hiccup during some past migrations.

Any hint how I can dump the DB + reload into a proper schema?

Thx,
M

Actions #4

Updated by Go MAEDA over 8 years ago

  • Related to Defect #20831: journal_details table reverted value and old_value back to String on update from 2.6.0 to 3.1.1 added
Actions

Also available in: Atom PDF