Defect #7850

Possible broken JSON REST API

Added by Artem Konoplin over 10 years ago. Updated over 1 year ago.

Status:ClosedStart date:2011-03-13
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:-
Resolution:Cant reproduce Affected version:1.1.1

Description

When i try to create a project using XML all is gone right.
For ex.: XML post to /projects.xml:

<project name="test123" identifier="test123"/>

Answer:

RC: 201 Message: Created

but when i try to make same thing in JSON format - error is occurred.
Ex.: JSON post to /projects.json:

{"project": {"name": "test123", "identifier": "test123"}}

Answer:

RC: 500 Message: Internal Server Error

development.xml.log (11.3 KB) Artem Konoplin, 2011-03-15 05:42

development.json.log (6.17 KB) Artem Konoplin, 2011-03-15 05:42

History

#1 Updated by Jean-Philippe Lang over 10 years ago

You need to provide the error stack trace for your Redmine log.

#2 Updated by Jean-Philippe Lang over 10 years ago

No error with current trunk or 1.1-stable.

#3 Updated by Artem Konoplin over 10 years ago

Check again on latest 1.1.2 version. Return code is changed to 422.

RC: 422 Message: null

In attached files development log both from xml (working) and json (non-working).

#4 Updated by Daniel Gruen over 10 years ago

I have similar problems both with redmine-1.1.1 and redmine-1.1.2.

wget my.server.url/projects.xml
works and downloads list of projects correctly

wget my.server.url/projects.json
causes a HTTP/406 error

#5 Updated by Daniel Gruen over 10 years ago

Let me specify this a little more: GETting projects.json causes a HTTP/406 error both with and without API access key. GETting issues.json works both with and without API access key. Either issues.xml or projects.xml work fine. users/current.json causes a HTTP/404 error. This is on a fresh upgrade of redmine-1.1.2 with local gems

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
fastthread (1.0.7)
i18n (0.4.2)
mysql (2.8.1)
passenger (2.2.14)
rack (1.0.1)
rails (2.3.8)
rake (0.8.7)

running on Apache/2.2.9 (Debian) Phusion_Passenger/2.2.14 PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g.

#6 Updated by Jean-Philippe Lang over 10 years ago

I've just re-checked with current 1.1-stable. GET requests /projects.json or /users/current.json work as expected.

#7 Updated by Daniel Gruen over 10 years ago

Also works for me on a fresh install -- have still no idea what's wrong with the old updated install, though.

#8 Updated by Go MAEDA over 1 year ago

  • Status changed from New to Closed
  • Resolution set to Cant reproduce

Also available in: Atom PDF