Project

General

Profile

Actions

Defect #8883

closed

Issues Rest API returns HTML instead of xml or json payload

Added by zlatko arifhodzic over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
2011-07-22
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Hi,

Seems that the issues Rest API is somehow broken in 1.2.1 version.

Hitting the appropriate url on both xml or json entry points returns a HTML page instead of xml or json payload.

Note that the projects API does not have this behavior, as it returns the expected xml or json payload.

Also note that the issue does not seem related to the http front-end as it is reproducible on both rack and apache2/passenger setups.

Steps to reproduce

  • DO : make sure you have a project with some issues, and an API key for the a given user
  • DO : execute :
    curl -X GET http://<myserver>/redmine/issues.json?key=<key>
  • OBSERVE : the log indicates :
Processing IssuesController#index to xml (for ::1 at 2011-07-22 15:18:41) [GET]
  Parameters: {"format"=>"xml", "action"=>"index", "controller"=>"issues", "key"=>"xxxxxxxxxxxxx"}
Rendering issues/index
Completed in 201ms (View: 144, DB: 10) | 200 OK [http://localhost/redmine/issues.xml?key=xxxxxxxxxxxxx]
  • EXPECT : an xml payload is returned
  • OBSERVE : curl returns the "issues search" page part in HTML format :
   <div class="contextual">
   </div>
   <h2>Issues</h2>
   ....

Environment

  • Fresh Redmine 1.2.1 installation from downloaded tarball
  • Rails 2.3.11
  • Ruby 1.8.7
  • MySQL 5.1.49
  • Debian Squeeze

Files

response-before-patched.out (30.9 KB) response-before-patched.out Response to Issues.json listing with 1.2.1 zlatko arifhodzic, 2011-07-25 11:53
response-patched.out (30.9 KB) response-patched.out Response to Issues.json listing with 1.2.1 + r6309 reported zlatko arifhodzic, 2011-07-25 11:53
Actions #1

Updated by zlatko arifhodzic over 12 years ago

Sorry, in the Steps To Reproduce section there is an inconsistency with the logs.

It should stated :

curl -X GET http://<myserver>/redmine/issues.xml?key=<key>

Nerveless, I tested both xml and json modes and both provide html instead of the API response.

Actions #2

Updated by Jean-Philippe Lang over 12 years ago

Can you attach the full html response please?

Actions #3

Updated by zlatko arifhodzic over 12 years ago

Jean-Philippe Lang wrote:

Can you attach the full html response please?

Not before monday, but I'll post the full response as soon as I get my hands on it.

Also note that only the index/list returns the html rendering. Getting an issue by ID (http://server/redmine/issues/&lt;ID&gt;.json) or even adding/updating issues works fine.

Actions #4

Updated by Jean-Philippe Lang over 12 years ago

I think you're getting html because something goes wrong with your issue query.
See source:/trunk/app/controllers/issues_controller.rb@6210#L99

I have to fix this behaviour.

Actions #5

Updated by zlatko arifhodzic over 12 years ago

Hi, I've tried to patch the 1.2.1 according to the commit in trunk, but the issue persists.

I've attached the responses obtained with and without the patch, and they are both quite the same ( a couple of velues differ, but the result is a html div not json or xml ).

Actions #6

Updated by Etienne Massip over 12 years ago

Are you sure you don't have any plugins which may affect the normal behavior ?

Actions #7

Updated by zlatko arifhodzic over 12 years ago

Well I do have a number of plugins, however I'm unable to indicate whenever they can interfere with the Rest API.

Here is the list of installed plugins :

  • Redmine Charts v0.1.0
  • Redmine Extended Spent Time plugin v0.0.2
  • Redmine Issue Due Date v0.1.0
  • Redmine Issue History plugin v0.0.1
  • Redmine Show Descriptions plugin v0.0.4
  • Redmine Work Time plugin v0.1.2

Most of them provide additional features, I'm not sure whenever they change the default issue listing behavior using the API.

But I can deploy a new instance of Redmine 1.2.1 from SVN skip the plugins, and do some tests on a fresh install. I'll try to do it today, tomorrow morning in worst case.

Actions #8

Updated by zlatko arifhodzic over 12 years ago

You're right Etienne, seems that some of the installed plugins break the Rest API.

I tested a fresh install from SVN and the API issue listing seem to be working !

Now I'll try to go through the installation each of the plugins and try to determine the causing the error ...

Actions #9

Updated by zlatko arifhodzic over 12 years ago

  • Status changed from New to Resolved

And the winner is :

  • Redmine Show Descriptions plugin v0.0.4

Once removed I can use the API to list the issues !

My apologies for reporting the issue and not proceeding sequentially on install time.

Actions #10

Updated by Etienne Massip over 12 years ago

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

Updated by Terence Mill over 12 years ago

Done a fix, Will be available soon on https://github.com/cforce/redmine_show_descriptions

zlatko arifhodzic wrote:

And the winner is :

  • Redmine Show Descriptions plugin v0.0.4

Once removed I can use the API to list the issues !

My apologies for reporting the issue and not proceeding sequentially on install time.

Actions

Also available in: Atom PDF