Project

General

Profile

Actions

Defect #13617

closed

Internal error on custum queries after Upgrade 2.2 -> 2.3

Added by F Schroedter over 11 years ago. Updated almost 6 years ago.

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

0%

Estimated time:
Resolution:
Invalid
Affected version:

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.


Files

20140303094355_fix_query_yaml.rb (196 Bytes) 20140303094355_fix_query_yaml.rb 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 ASCII-8BIT: yaml generated on ruby 1.8ClosedJean-Philippe Lang

Actions
Blocked by Redmine - Defect #13667: Internal error on custum queries after Upgrade 2.2 -> 2.3 (defect column_names)Closed

Actions
Actions #1

Updated by F Schroedter over 11 years ago

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

 :operator: "="

instead of
 :operator: =

Actions #2

Updated by Etienne Massip over 11 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.

Actions #3

Updated by Jean-Philippe Lang over 11 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)?

Actions #4

Updated by F Schroedter over 11 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

Actions #5

Updated by Etienne Massip over 11 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.

Actions #6

Updated by F Schroedter over 11 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.

Actions #7

Updated by Etienne Massip over 11 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.

Actions #8

Updated by F Schroedter over 11 years ago

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

Actions #9

Updated by F Schroedter over 11 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'

Actions #10

Updated by Filou Centrinov over 11 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

Actions #11

Updated by Filou Centrinov over 11 years ago

Category: Database

Actions #12

Updated by Toshi MARUYAMA over 11 years ago

  • Category changed from Issues to Database
Actions #13

Updated by Jean-Philippe Lang over 11 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.

Actions #14

Updated by Scott H about 11 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.

Actions #15

Updated by Jan from Planio www.plan.io almost 11 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...

Actions #16

Updated by Toshi MARUYAMA almost 10 years ago

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

Updated by Toshi MARUYAMA almost 10 years ago

Actions #18

Updated by Marius BĂLTEANU almost 6 years ago

  • Status changed from New to Resolved
  • Target version deleted (Candidate for next major release)

I don't think that is something that we can do here for the next Redmine versions. If someone still has this problem, it can find in the comments how to fix it (the query posted by Jan can be run manually).

Actions #19

Updated by Marius BĂLTEANU almost 6 years ago

  • Status changed from Resolved to Closed
  • Resolution set to Invalid
Actions

Also available in: Atom PDF