ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
Error 500 searching issues and filtering on customField value (Bug #912)
Description
I recently upgraded from 2.0.0 to 3.0.0 (no big trouble to upgrade! Thanks for that. I just needed to upgrade the database progressively).
When I try to list issues and filtering results on custom field value I got a 500 server error and the following trace in my logs:
Processing IssuesController#index to xml (for w.x.y.z at xxxx-xx-xx xx:xx:xx) [GET] Parameters: {"cf_10"=>"someValue", "format"=>"xml", "project_id"=>"1", "action"=>"index", "controller"=>"issues", "limit"=>"25", "key"=>"azerty0123456789azerty123456789", "offset"=>"0"} Query::StatementInvalid: PGError: ERROR: syntax error at or near ")" LINE 1: ...ues.id AND custom_values.custom_field_id=10 WHERE ) AND (iss... ^ : SELECT count(DISTINCT "issues".id) AS count_all FROM "issues" LEFT OUTER JOIN "issue_statuses" ON "issue_statuses".id = "issues".status_id LEFT OUTER JOIN "projects" ON "projects".id = "issues".project_id WHERE (issues.id IN (SELECT issues.id FROM issues LEFT OUTER JOIN custom_values ON custom_values.customized_type='Issue' AND custom_values.customized_id=issues.id AND custom_values.custom_field_id=10 WHERE ) AND (issue_statuses.is_closed='f') AND projects.id = 1 AND projects.status=1 AND projects.id IN ( SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))
This error occurs only with the REST API and when no issue exists with the requested custom field value.
History
Updated by Felix Schäfer at 2012-03-01 12:59 am
Could you please post the URL you're querying so that we can to reproduce it? Could you try it out on MySQL to see if the problem is general or limited to postgres? Thanks!
Updated by Jérémie H at 2012-03-01 09:43 pm
This is the request causing the error.
Here is the custom field settings:- Name: Stacktrace MD5 hash
- Type: text
- min-max length: 0 - 0
- regexp: ^[a-f0-9]{32}$
- default value:
- mandatory: yes
- all projects: yes
- filtering: yes
- search: no
If dumping my data and inserting it in a MySQL instance works, I can try. Is it as easy as this ?