Defect #4820

500 Internal Server Error if add related issue with NaN value

Added by Andrew Rudenko over 11 years ago. Updated over 11 years ago.

Status:ClosedStart date:2010-02-12
Priority:NormalDue date:
Assignee:-% Done:


Target version:0.9.3
Resolution:Fixed Affected version:0.9.2


  1. Open any issue
  2. Click 'Add' near 'Related issues' block
  3. Specify any NaN value into 'related to Issue #' field
  4. Press Add and observe log file

Actual Results:

Processing IssueRelationsController#new (for 1xx.1x.7x.xx at 2010-02-12 15:40:11) [POST]
  Parameters: {"commit"=>"Add", "action"=>"new",
"authenticity_token"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "id"=>"975", "issue_id"=>"4390", "controller"=>"issue_relations", "relation"=>{"delay"=>"", "issue_to_id"=>":1:", "relation_type"=>"relates"}}

ActiveRecord::StatementInvalid (PGError: ERROR:  invalid input syntax for integer: ":1:" 
: SELECT "issues"."id" AS t0_ 
WHERE ("issues"."id" = ':1:') AND (projects.status=1 AND IN (SELECT em.project_id FROM enabled_modules em WHERE'issue_tracking'))  LIMIT 1):
  app/controllers/issue_relations_controller.rb:25:in `new'
  passenger (2.2.5) lib/phusion_passenger/rack/request_handler.rb:95:in `process_request'
  passenger (2.2.5) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.5) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /var/redmine/public/500.html (500 Internal Server Error)

I'm using Redmine 0.9.2.devel.3412 (PostgreSQL) ~ $ RAILS_ENV=production ruby script/about
About your application's environment
Ruby version              1.8.6 (i486-linux)
RubyGems version          1.3.5
Rack version              1.0
Rails version             2.3.5
Active Record version     2.3.5
Active Resource version   2.3.5
Action Mailer version     2.3.5
Active Support version    2.3.5
Application root          /var/redmine
Environment               production
Database adapter          postgresql
Database schema version   20091227112908

About your Redmine plugins
Redmine Wiki Extensions plugin   0.2.0
Redmine Code Review plugin

Associated revisions

Revision 3413
Added by Jean-Philippe Lang over 11 years ago

Issue relation: fixes error with postgres when entering a non-numeric id (#4820) + accept hash (#) before id.


#1 Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from New to Resolved
  • Target version set to 0.9.3
  • Resolution set to Fixed

Fixed in r3413.

#2 Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from Resolved to Closed

Merged in 0.9-stable in r3432.

Also available in: Atom PDF