Defect #13617

Internal error on custum queries after Upgrade 2.2 -> 2.3

Added by F Schroedter about 4 years ago. Updated about 2 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Database
Target version:Candidate for next major release
Resolution: Affected version:2.3.0

Description

After upgrading redmine from 2.2 to 2.3 I get a internal error on custom queries. I created the same query on 2.3 and compared the database column "filter" from table "queries":

 --- 
 status_id: 
   :operator: o
   :values: 
-  - ''
+  - "" 
 author_id: 
-  :operator: =
+  :operator: "=" 
   :values: 
   - me

Adapting the filter on the database manually solved the problem.

And yes, I did run "rake db:migrate RAILS_ENV=production" after upgrading.

20140303094355_fix_query_yaml.rb Magnifier (196 Bytes) Jan from Planio www.plan.io, 2014-03-03 11:47


Related issues

Related to Redmine - Defect #19305: settings: incompatible character encodings: UTF-8 and ASC... Closed
Blocked by Redmine - Defect #13667: Internal error on custum queries after Upgrade 2.2 -> 2.3... New

History

#1 Updated by F Schroedter about 4 years ago

The only problem for all custom issue queries was, that it had to be

 :operator: "="

instead of
 :operator: =

#2 Updated by Etienne Massip about 4 years ago

  • Target version set to 2.3.1

Not confirmed yet but I remember a commit going this way in Query refactoring so it's worth digging into this for next minor release.

#3 Updated by Jean-Philippe Lang about 4 years ago

I don't think it's related to the Query refactoring. Looks like an incompatibility in YAML parsing between ruby versions.

Did you upgrade your ruby while upgrading to 2.3? And could you post your stack trace and your ruby version(s) (see SubmittingBugs)?

#4 Updated by F Schroedter about 4 years ago

I used Redmine 2.2 also with Ruby 1.9.2

My configuration with Redmine 2.3 now:

Ruby version              1.9.2 (x86_64-linux)
RubyGems version          1.8.24
Rack version              1.4
Rails version             3.2.13
Active Record version     3.2.13
Action Pack version       3.2.13
Active Resource version   3.2.13
Action Mailer version     3.2.13
Active Support version    3.2.13

#5 Updated by Etienne Massip about 4 years ago

Jean-Philippe Lang wrote:

I don't think it's related to the Query refactoring. Looks like an incompatibility in YAML parsing between ruby versions.

The commit I was thinking about was indeed more something like using "" instead of "=" as equality operator.

#6 Updated by F Schroedter about 4 years ago

What of these is the problem/unexpected behaviour?
  1. Redmine 2.2 stores :operator: = instead of :operator: "=" in the database
  2. In Redmine 2.3 occures an "internal error" when applying the filter with :operator: =

BTW, my Redmine 2.2 uses the rails version 3.2.11. Ruby and RubyGems version is the same.

I have Redmine 2.2 still on my server, so I can provide you with informations if needed.

#7 Updated by Etienne Massip about 4 years ago

Could you try 2.3 with RoR 3.2.11? There has been some security fixes related to json and xml parsing in latest releases.

#8 Updated by F Schroedter about 4 years ago

I tried redmine 2.3 with rails 3.2.11. No difference to 3.2.13.

#9 Updated by F Schroedter about 4 years ago

My stack trace in Redmine 2.3 with a "bad" filter:

Started GET "/projects/myproject/issues?query_id=9" for 95.113.249.160 at 2013-04-03 20:56:24 +0200
Processing by IssuesController#index as HTML
  Parameters: {"query_id"=>"9", "project_id"=>"myproject"}
  Current user: fschroedter (id=3)
Completed 500 Internal Server Error in 117ms

RuntimeError (Unknown query operator #<Syck::DefaultKey:0x0000000c076348>):
  app/models/query.rb:724:in `sql_for_field'
  app/models/query.rb:544:in `block in statement'
  app/models/query.rb:512:in `each_key'
  app/models/query.rb:512:in `statement'
  app/models/issue_query.rb:230:in `issue_count'
  app/controllers/issues_controller.rb:73:in `index'

#10 Updated by Filou Centrinov about 4 years ago

I tested with Redmine 2.3 where

:operator: =
is stored. It works when requesting the filter.
Ruby version              1.9.3 (i386-mingw32)
RubyGems version          2.0.2
Rack version              1.4
Rails version             3.2.13

#11 Updated by Filou Centrinov about 4 years ago

Category: Database

#12 Updated by Toshi MARUYAMA about 4 years ago

  • Category changed from Issues to Database

#13 Updated by Jean-Philippe Lang almost 4 years ago

  • Target version changed from 2.3.1 to Candidate for next major release

Redmine is not responsible for storing these serialized values, Rails and YAML.dump are. So I don't have any ideas on how to fix this in Redmine. I personnaly did not experience this problem after upgrading to 2.3.

#14 Updated by Scott H over 3 years ago

I started using Redmine 2.3.3 a month ago, updated to 2.4.0 the other day, and noticed the same thing. My Ruby version actually went down though, moving from a Windows machine with 1.9.3 to Linux with 1.8.7.

Also worth noting that not every custom query will get the error, you need to have certain parameters saved for it to matter.

#15 Updated by Jan from Planio www.plan.io about 3 years ago

For various reasons, we're still using Syck at Planio despite running on Ruby 2.0 already. This bug however seems to occur even with the syck gem while it didn't with syck in Ruby < 1.9. The attached migration doesn't hurt and fixes the problem at hand while a more thorough solution would be to load old yaml using syck and re-generate it using psych...

#16 Updated by Toshi MARUYAMA about 2 years ago

  • Related to Defect #19305: settings: incompatible character encodings: UTF-8 and ASCII-8BIT: yaml generated on ruby 1.8 added

Also available in: Atom PDF