Rest API not working with HTTP/2

Bob Morley May 12, 2016

We have an iOS application that is in development and provides the ability for our customer's to report an issue (creating a JIRA issue and then attaching files). Sometime on Wednesday May 11, 2016 the REST API calls we were making would start to fail "sporadically". Further investigation determined they would (usually) fail on the first call and then work on the second call.

We did some digging and found that the problem appears to be with the HTTP 2.0 support from nginx (https://trac.nginx.org/nginx/ticket/959#comment:10). In fact, if I execute the following (using Windows CURL):

curl -D- -u {username} -X POST --data "{\"fields\":{\"project\":{\"key\":\"AS\"},\"summary\":\"My Test\",\"issuetype\":{\"name\":\"Bug\"}}}" -H "Content-Type: application/json" https://{hostname}/rest/api/2/issue

I will get a failure:

curl: (16) HTTP/2 stream 1 was not closed cleanly: error_code = 7

However, if I add in the --http1.1 argument to curl, it works properly.

We also decided to download the open source "JIRAConnect" and compiled and ran that with the latest version of XCode. Your code fails (same as ours in iOS) with a -1004 "Cannot connect to server" on the first attempt. A second attempt (typically) will be successful.

Can someone look into this as soon as possible. If this investigation is correct, the speculation is that sometime over the past few days you upgraded your REST servers to the nginx that was related a couple of weeks ago. One quick solution (until they fix the bug) is to indicate your server blocks do not support HTTP 2.

1 answer

0 votes
Bob Morley June 8, 2016

FYI - It now appears this is working. I assume JIRAConnect and other clients are now working too with HTTP 2.0.

Suggest an answer

Log in or Sign up to answer