Defect #13617
closedInternal error on custum queries after Upgrade 2.2 -> 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.
Files
Related issues
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: =
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.
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)?
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
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.
Updated by F Schroedter over 11 years ago
- Redmine 2.2 stores
:operator: =
instead of:operator: "="
in the database - 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.
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.
Updated by F Schroedter over 11 years ago
I tried redmine 2.3 with rails 3.2.11. No difference to 3.2.13.
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'
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
Updated by Toshi MARUYAMA over 11 years ago
- Category changed from Issues to Database
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.
Updated by Scott H almost 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.
Updated by Jan from Planio www.plan.io over 10 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...
Updated by Toshi MARUYAMA over 9 years ago
- Related to Defect #19305: settings: incompatible character encodings: UTF-8 and ASCII-8BIT: yaml generated on ruby 1.8 added
Updated by Toshi MARUYAMA over 9 years ago
OpenProject (GPL3) provides yaml converter.
https://github.com/opf/openproject/blob/v4.0.8/db/migrate/migration_utils/yaml_migrator.rb
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).
Updated by Marius BĂLTEANU almost 6 years ago
- Status changed from Resolved to Closed
- Resolution set to Invalid