Project

General

Profile

Actions

Defect #12496

open

Updates through REST API return status 200 response but still fail

Added by Adam Lacoste almost 12 years ago. Updated over 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Cant reproduce
Affected version:

Description

I am building an internal application for my company which depends on being able to read and update Redmine issues. Although the REST API's GET behavior appears to be working perfectly fine, my attempts to PUT data to Redmine always fail. I discussed this with another developer who previously had done some simple Redmine integration and we found that the little app he had written, which used to be able to send updates to Redmine, now did not work at all either. We believe this is a result of our recent upgrade to 2.0.4, but this is only speculation.

To narrow the possible factors which could cause problems, I have been attempting to test the REST API update feature using cURL. Here's an example. (Domains and IPs obscured for privacy and to get past the spam filter.)

Request:

curl -v -H "Content-Type: application/json" -X PUT --data '{ "issue": { "subject": "Example subject linke" } }' -u username:password DOMAIN/issues/12345.json
* About to connect() to DOMAIN port 80 (#0)
*   Trying IP_ADDR... connected
* Connected to DOMAIN (IP_ADDR) port 80 (#0)
* Server auth using Basic with user 'username'
> PUT /issues/12345.json HTTP/1.1
> Authorization: Basic YnVpbGRkdWRlOkJ1MTFk
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: DOMAIN
> Accept: */*
> Content-Type: application/json
> Content-Length: 88
> 
< HTTP/1.1 200 OK
< Date: Mon, 03 Dec 2012 22:14:47 GMT
< Server: Apache/2.2.22 (Debian)
< X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.18
< X-UA-Compatible: IE=Edge,chrome=1
< ETag: "7215ee9c7d9dc229d2921a40e899ec5f" 
< Cache-Control: max-age=0, private, must-revalidate
< X-Request-Id: fc14a612df055c426e5b93090d3210c6
< X-Runtime: 0.196459
< X-Rack-Cache: invalidate, pass
< Set-Cookie: _redmine_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTgxMGNiYTRjNWM3YWI2MDM0MmZiMjZkMDA4ZTBmZWIwBjsAVA%3D%3D--1a77c7214ab3dff0d1c7facff14dfe92338f276f; path=/; HttpOnly
< Set-Cookie: autologin=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
< Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT
< Access-Control-Allow-Headers: Content-Type, Authorization
< Status: 200
< Access-Control-Allow-Origin: *
< Content-Length: 1
< Content-Type: application/json; charset=utf-8
< 
* Connection #0 to host DOMAIN left intact
* Closing connection #0

That last line there is the empty space response Redmine sends back, along with the status 200.

When I go and check the issue I just updated in Redmine's issue browser, the subject has not changed, but I'll be told that the issue was updated less than a minute ago.

I've tried this with several different fields (description, status, project). I've tried it as JSON and XML. I've tried authenticating using a username/password and by using the app key. Nothing works.

Here are some additional details about our Redmine setup:

Environment:
  Redmine version                          2.0.4.stable.10796
  Ruby version                             1.9.3 (x86_64-linux)
  Rails version                            3.2.6
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  redmine_backlogs                         v0.9.26
  redmine_code_review                      0.5.0
  redmine_custom_workflows                 0.0.4
  redmine_embedded                         0.0.2
  redmine_fix_title                        0.0.1
  redmine_impasse                          1.2.2
  redmine_issue_templates                  0.0.3
  redmine_query_current_sprint             0.0.1
  redmine_wiki_issue                       0.0.1

Actions

Also available in: Atom PDF