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)


Added by Jérémie H at 2012-02-28 11:17 pm. Updated at 2012-03-01 09:43 pm.


Status:Open Start date:2012-02-28
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:REST API
Target version:-
Remote issue URL: Affected version:3.0.0

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
This is very strange... I noticed most (all?) values beginning with c cause the error.
value request error?
c https://bugtracker.dudie.fr/issues.xml?cf_12=c FAIL
C https://bugtracker.dudie.fr/issues.xml?cf_12=C ok
a https://bugtracker.dudie.fr/issues.xml?cf_12=a ok
a https://bugtracker.dudie.fr/issues.xml?cf_12=A ok
ca https://bugtracker.dudie.fr/issues.xml?cf_12=ca FAIL
ca https://bugtracker.dudie.fr/issues.xml?cf_12=Ca ok

If dumping my data and inserting it in a MySQL instance works, I can try. Is it as easy as this ?

Also available in: Atom PDF