HTTP/1.1 401 Unauthorized Issue when using CURL on Jira Atlassian DEMO server

sureng July 29, 2014

Hello All,

Can some one please let me know where i am doing wrong? I am trying to create a JIRA issue using Perl and Rest API calls. Before doing perl stuff i tried below CURL command:

curl -D- -u sureng.reddy:password -X POST --data @json.txt -H "Content-Type: application/json" https://jira.atlassian.com/rest/api/2/issue-k

json.txt:

---------

{

"fields": {

"project":

{

"key": "Demo"

},

"summary": "Suren-REST ye merry gentlemen.",

"description": "Creating of an issue using project keys and issue type names using the REST API",

"issuetype": {

"name": "Bug"

}

}

}

and got error 401 like below

HTTP/1.1 401 Unauthorized

Server: nginx

Date: Wed, 30 Jul 2014 06:41:38 GMT

Content-Type: text/html;charset=UTF-8

Transfer-Encoding: chunked

Connection: keep-alive

X-AREQUESTID: 401x10226088x2

X-ANODEID: node2

X-ASEN: TestSEN

WWW-Authenticate: OAuth realm="https%3A%2F%2Fjira.atlassian.com"

X-Content-Type-Options: nosniff

X-Robots-Tag: noarchive

Vary: Accept-Encoding

Set-Cookie: __atl_path=172.24.36.107.1406702498230918; path=/; expires=Sat, 27-Jul-24 06:41:38 GMT; domain=.atlassian.com

Set-Cookie: JSESSIONID=62C6E56EE14A966AF32C365140E615B8.node2; Path=/

<html>

<head>

<title>Unauthorized (401)</title>

<!--[if IE]><![endif]-->

<script type="text/javascript">(window.NREUM||(NREUM={})).loader_config={xpid:"XQEHVUVSDgIAVVlR"};window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e){function n(t,e,n){n||(n={});for(var r=o[t],a=r&&r.length||0,s=n[i]||(n[i]={}),u=0;a>u;u++)r[u].apply(s,e);return s}function r(t,e){var n=o[t]||(o[t]=[]);n.push(e)}var o={},i="nr@context";e.exports={on:r,emit:n}},{}],2:[function(t){function e(t,e,n,i,s){return u?u-=1:r("err",[s||new UncaughtException(t,e,n)]),"function"==typeof a?a.apply(this,o(arguments)):!1}function UncaughtException(t,e,n){this.message=t||"Uncaught error with no additional information",this.sourceURL=e,this.line=n}function n(t){r("err",[t,(new Date).getTime()])}var r=t("handle"),o=t(6),i=t(5),a=window.onerror,s=!1,u=0;t("loader").features.push("err"),window.onerror=e,NREUM.noticeError=n;try{throw new Error}catch(d){"stack"in d&&(t(1),t(2),"addEventListener"in window&&t(3),window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&t(4),s=!0)}i.on("fn-start",function(){s&&(u+=1)}),i.on("fn-err",function(t,e,r){s&&(this.thrown=!0,n(r))}),i.on("fn-end",function(){s&&!this.thrown&&u>0&&(u-=1)}),i.on("internal-error",function(t){r("ierr",[t,(new Date).getTime(),!0])})},{1:5,2:4,3:3,4:6,5:1,6:14,handle:"D5DuLP",loader:"G9z0Bl"}],3:[function(t){function e(t){r.inPlace(t,["addEventListener","removeEventListener"],"-",n)}function n(t){return t[1]}var r=t(1),o=(t(3),t(2));if(e(window),"getPrototypeOf"in Object){for(var i=document;i&&!i.hasOwnProperty("addEventListener");)i=Object.getPrototypeOf(i);i&&e(i);for(var a=XMLHttpRequest.prototype;a&&!a.hasOwnProperty("addEventListener");)a=Object.getPrototypeOf(a);a&&e(a)}else XMLHttpRequest.prototype.hasOwnProperty("addEventListener")&&e(XMLHttpRequest.prototype);o.on("addEventListener-start",function(t){if(t[1]){var e=t[1];"function"==typeof e?this.wrapped=e["nr@wrapped"]?t[1]=e["nr@wrapped"]:e["nr@wrapped"]=t[1]=r(e,"fn-"):"function"==typeof e.handleEvent&&r.inPlace(e,["handleEvent"],"fn-")}}),o.on("removeEventListener-start",function(t){var e=this.wrapped;e&&(t[1]=e)})},{1:15,2:1,3:14}],4:[function(t){var e=(t(3),t(1)),n=t(2);e.inPlace(window,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame"],"raf-"),n.on("raf-start",function(t){t[0]=e(t[0],"fn-")})},{1:15,2:1,3:14}],5:[function(t){function e(t){var e=t[0];"string"==typeof e&&(e=new Function(e)),t[0]=n(e,"fn-")}var n=(t(3),t(1)),r=t(2);n.inPlace(window,["setTimeout","setInterval","setImmediate"],"setTimer-"),r.on("setTimer-start",e)},{1:15,2:1,3:14}],6:[function(t){function e(){o.inPlace(this,s,"fn-")}function n(t,e){o.inPlace(e,["onreadystatechange"],"fn-")}function r(t,e){return e}var o=t(1),i=t(2),a=window.XMLHttpRequest,s=["onload","onerror","onabort","onloadstart","onloadend","onprogress","ontimeout"];window.XMLHttpRequest=function(t){var n=new a(t);try{i.emit("new-xhr",[],n),o.inPlace(n,["addEventListener","removeEventListener"],"-",function(t,e){return e}),n.addEventListener("readystatechange",e,!1)}catch(r){try{i.emit("internal-error",r)}catch(s){}}return n},window.XMLHttpRequest.prototype=a.prototype,o.inPlace(XMLHttpRequest.prototype,["open","send"],"-xhr-",r),i.on("send-xhr-start",n),i.on("open-xhr-start",n)},{1:15,2:1}],7:[function(t){function e(){function e(t){if("string"==typeof t&&t.length)return t.length;if("object"!=typeof t)return void 0;if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&t.byteLength)return t.byteLength;if("undefined"!=typeof Blob&&t instanceof Blob&&t.size)return t.size;if("undefined"!=typeof FormData&&t instanceof FormData)return void 0;try{return JSON.stringify(t).length}catch(e){return void 0}}function n(t){var n=this.params,r=this.metrics;if(!this.ended){this.ended=!0;for(var i=0;u>i;i++)t.removeEventListener(s[i],this.listener,!1);if(!n.aborted){if(r.duration=(new Date).getTime()-this.startTime,4===t.readyState){n.status=t.status;var a=t.responseType,d="arraybuffer"===a||"blob"===a||"json"===a?t.response:t.responseText,f=e(d);if(f&&(r.rxSize=f),this.sameOrigin){var c=t.getResponseHeader("X-NewRelic-App-Data");c&&(n.cat=c.split(", ").pop())}}else n.status=0;r.cbTime=this.cbTime,o("xhr",[n,r])}}}function r(t,e){var n=i(e),r=t.params;r.host=n.hostname+":"+n.port,r.pathname=n.pathname,t.sameOrigin=n.sameOrigin}t("loader").features.push("xhr");var o=t("handle"),i=t(1),a=t(5),s=["load","error","abort","timeout"],u=s.length,d=t(2);t(3),t(4),a.on("new-xhr",function(){this.totalCbs=0,this.called=0,this.cbTime=0,this.end=n,this.ended=!1,this.xhrGuids={}}),a.on("open-xhr-start",function(t){this.params={method:t[0]},r(this,t[1]),this.metrics={}}),a.on("open-xhr-end",function(t,e){"loader_config"in NREUM&&"xpid"in NREUM.loader_config&&this.sameOrigin&&e.setRequestHeader("X-NewRelic-ID",NREUM.loader_config.xpid)}),a.on("send-xhr-start",function(t,n){var r=this.metrics,o=t[0],i=this;if(r&&o){var d=e(o);d&&(r.txSize=d)}this.startTime=(new Date).getTime(),this.listener=function(t){try{"abort"===t.type&&(i.params.aborted=!0),("load"!==t.type||i.called===i.totalCbs&&(i.onloadCalled||"function"!=typeof n.onload))&&i.end(n)}catch(e){try{a.emit("internal-error",e)}catch(r){}}};for(var f=0;u>f;f++)n.addEventListener(s[f],this.listener,!1)}),a.on("xhr-cb-time",function(t,e,n){this.cbTime+=t,e?this.onloadCalled=!0:this.called+=1,this.called!==this.totalCbs||!this.onloadCalled&&"function"==typeof n.onload||this.end(n)}),a.on("xhr-load-added",function(t,e){var n=""+d(t)+!!e;this.xhrGuids&&!this.xhrGuids[n]&&(this.xhrGuids[n]=!0,this.totalCbs+=1)}),a.on("xhr-load-removed",function(t,e){var n=""+d(t)+!!e;this.xhrGuids&&this.xhrGuids[n]&&(delete this.xhrGuids[n],this.totalCbs-=1)}),a.on("addEventListener-end",function(t,e){e instanceof XMLHttpRequest&&"load"===t[0]&&a.emit("xhr-load-added",[t[1],t[2]],e)}),a.on("removeEventListener-end",function(t,e){e instanceof XMLHttpRequest&&"load"===t[0]&&a.emit("xhr-load-removed",[t[1],t[2]],e)}),a.on("fn-start",function(t,e,n){e instanceof XMLHttpRequest&&("onload"===n&&(this.onload=!0),("load"===(t[0]&&t[0].type)||this.onload)&&(this.xhrCbStart=(new Date).getTime()))}),a.on("fn-end",function(t,e){this.xhrCbStart&&a.emit("xhr-cb-time",[(new Date).getTime()-this.xhrCbStart,this.onload,e],e)})}window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&!/CriOS/.test(navigator.userAgent)&&e()},{1:8,2:11,3:3,4:6,5:1,handle:"D5DuLP",loader:"G9z0Bl"}],8:[function(t,e){e.exports=function(t){var e=document.createElement("a"),n=window.location,r={};e.href=t,r.port=e.port;var o=e.href.split("://");return!r.port&&o[1]&&(r.port=o[1].split("/")[0].split(":")[1]),r.port&&"0"!==r.port||(r.port="https"===o[0]?"443":"80"),r.hostname=e.hostname||n.hostname,r.pathname=e.pathname,"/"!==r.pathname.charAt(0)&&(r.pathname="/"+r.pathname),r.sameOrigin=!e.hostname||e.hostname===document.domain&&e.port===n.port&&e.protocol===n.protocol,r}},{}],handle:[function(t,e){e.exports=t("D5DuLP")},{}],D5DuLP:[function(t,e){function n(t,e){var n=r[t];return n?n.apply(this,e):(o[t]||(o[t]=[]),void o[t].push(e))}var r={},o={};e.exports=n,n.queues=o,n.handlers=r},{}],11:[function(t,e){function n(t){if(!t||"object"!=typeof t&&"function"!=typeof t)return-1;if(t===window)return 0;if(o.call(t,"__nr"))return t.__nr;try{return Object.defineProperty(t,"__nr",{value:r,writable:!0,enumerable:!1}),r}catch(e){return t.__nr=r,r}finally{r+=1}}var r=1,o=Object.prototype.hasOwnProperty;e.exports=n},{}],loader:[function(t,e){e.exports=t("G9z0Bl")},{}],G9z0Bl:[function(t,e){function n(){var t=p.info=NREUM.info;if(t&&t.agent&&t.licenseKey&&t.applicationID&&u&&u.body){p.proto="https"===c.split(":")[0]||t.sslForHttp?"https://":"http://",a("mark",["onload",i()]);var e=u.createElement("script");e.src=p.proto+t.agent,u.body.appendChild(e)}}function r(){"complete"===u.readyState&&o()}function o(){a("mark",["domContent",i()])}function i(){return(new Date).getTime()}var a=t("handle"),s=window,u=s.document,d="addEventListener",f="attachEvent",c=(""+location).split("?")[0],p=e.exports={offset:i(),origin:c,features:[]};u[d]?(u[d]("DOMContentLoaded",o,!1),s[d]("load",n,!1)):(u[f]("onreadystatechange",r),s[f]("onload",n)),a("mark",["firstbyte",i()])},{handle:"D5DuLP"}],14:[function(t,e){function n(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=Array(0>o?0:o);++r<o;)i[r]=t[e+r];return i}e.exports=n},{}],15:[function(t,e){function n(t,e,r,s){function nrWrapper(){try{var n,a=u(arguments),d=this,f=r&&r(a,d)||{}}catch(c){i([c,"",[a,d,s],f])}o(e+"start",[a,d,s],f);try{return n=t.apply(d,a)}catch(p){throw o(e+"err",[a,d,p],f),p}finally{o(e+"end",[a,d,n],f)}}return a(t)?t:(e||(e=""),nrWrapper[n.flag]=!0,nrWrapper)}function r(t,e,r,o){r||(r="");var i,s,u,d="-"===r.charAt(0);for(u=0;u<e.length;u++)s=e[u],i=t[s],a(i)||(t[s]=n(i,d?s+r:r,o,s,t))}function o(t,e,n){try{s.emit(t,e,n)}catch(r){i([r,t,e,n])}}function i(t){try{s.emit("internal-error",t)}catch(e){}}function a(t){return!(t&&"function"==typeof t&&t.apply&&!t[n.flag])}var s=t(1),u=t(2);e.exports=n,n.inPlace=r,n.flag="nr@wrapper"},{1:1,2:14}]},{},["G9z0Bl",2,7]);</script><script type="text/javascript">var contextPath = '';</script>

<script>

window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};

WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\"\"";

</script>

<link type="text/css" rel="stylesheet" href="/s/1afa34a7f984eeabdbb0a7d494132ee5-CDN/en_UKmj019b/6328/131/147/_/download/superbatch/css/batch.css" media="all">

<!--[if lte IE 9]>

<link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_UKmj019b/6328/131/147/_/download/superbatch/css/batch.css?conditionalComment=lte+IE+9" media="all">

<![endif]-->

<link type="text/css" rel="stylesheet" href="/s/1afa34a7f984eeabdbb0a7d494132ee5-CDN/en_UKmj019b/6328/131/9be4b9c6b8765a698e28299f26449fd7/_/download/contextbatch/css/atl.general,jira.global/batch.css" media="all">

<link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-T/en_UKmj019b/6328/131/1.2.11/_/download/batch/com.atlassian.labs.hipchat.hipchat-for-jira-plugin:resources/com.atlassian.labs.hipchat.hipchat-for-jira-plugin:resources.css" media="all">

<script type="text/javascript" src="/s/51e71d10c92809d5d5f14ae552dccb70-CDN/en_UKmj019b/6328/131/147/_/download/superbatch/js/batch.js?locale=en-UK" ></script>

<script type="text/javascript" src="/s/86506fba2dd11135475bc19370743b85-CDN/en_UKmj019b/6328/131/9be4b9c6b8765a698e28299f26449fd7/_/download/contextbatch/js/atl.general,jira.global/batch.js?locale=en-UK" ></script>

<script type="text/javascript" src="/s/4c985c39d6d68e69ba6bf47e7a99d0ad-T/en_UKmj019b/6328/131/1.5/_/download/batch/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources.js?locale=en-UK" ></script>

<script type="text/javascript" src="/s/d41d8cd98f00b204e9800998ecf8427e-T/en_UKmj019b/6328/131/1.2.11/_/download/batch/com.atlassian.labs.hipchat.hipchat-for-jira-plugin:resources/com.atlassian.labs.hipchat.hipchat-for-jira-plugin:resources.js" ></script>

<script type="text/javascript" src="/s/4c985c39d6d68e69ba6bf47e7a99d0ad-T/en_UKmj019b/6328/131/2.1.7/_/download/batch/com.atlassian.jira.ext.calendar:browse-project-tip/com.atlassian.jira.ext.calendar:browse-project-tip.js?locale=en-UK" ></script>

<script type="text/javascript" src="/rest/api/1.0/shortcuts/6328/2588ddce81d5d35eebf805144068c5d2/shortcuts.js"></script>

<meta name="application-name" content="JIRA" data-name="jira" data-version="6.3">

</head>

<body id="jira" class="aui-layout aui-style-default page-type-message" data-version="6.3" >

<div class="aui-page-panel"><div class="aui-page-panel-inner">

<section class="aui-page-panel-content">

<header class="aui-page-header"><div class="aui-page-header-inner">

<div class="aui-page-header-main">

<h1>Unauthorized (401)</h1>

</div><!-- .aui-page-header-main -->

</div><!-- .aui-page-header-inner --></header><!-- .aui-page-header -->

<div class="aui-message aui-message-warning warning">

<p>Encountered a <code>&quot;401 - Unauthorized&quot;</code> error while loading this page.</p>

<p><a href="/secure/MyJiraHome.jspa">Go to JIRA home</a></p>

<span class="aui-icon icon-warning"></span></div>

</section><!-- .aui-page-panel-content -->

</div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel -->

<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"applicationID":"1610183,1487456,1373569","applicationTime":22,"beacon":"beacon-1.newrelic.com","queueTime":0,"licenseKey":"4558326637","transactionName":"MlRaZhBTVhcAAhAPWQsecmEyHVwNEhEIB08gQ0pdEBxSFxE=","agent":"js-agent.newrelic.com\/nr-411.min.js","errorBeacon":"bam.nr-data.net"}</script></body>

</html>

Thanks!

4 answers

0 votes
Mister X October 10, 2014

I have the same issue.
Please, help to solve it.

[root@node1 //]# curl -u root:root -X POST --data @data.txt -H "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/issue/

 

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Unauthorized (401)&lt;/title&gt;

&lt;!--[if IE]&gt;&lt;![endif]--&gt;
&lt;script type="text/javascript"&gt;var contextPath = '';&lt;/script&gt;
&lt;script&gt; 
window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};
WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\"\"";
WRM._unparsedData["com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources.resource-uris"]="{\"deployJava.html\":\"/s/en_USh97jhf/6337/4/1.5.11/_/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/deployJava.html\",\"clipboard.jar\":\"/s/en_USh97jhf/6337/4/1.5.11/_/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/clipboard.jar\",\"clipboard-legacy.jar\":\"/s/en_USh97jhf/6337/4/1.5.11/_/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/clipboard-legacy.jar\"}"; 
&lt;/script&gt; 
&lt;link type="text/css" rel="stylesheet" href="/s/a87ff679a2f3e71d9181a67b7542122c-CDN/en_USh97jhf/6337/4/3/_/download/superbatch/css/batch.css" media="all"&gt; 
&lt;!--[if lte IE 9]&gt; 
&lt;link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/3/_/download/superbatch/css/batch.css?conditionalComment=lte+IE+9" media="all"&gt; 
&lt;![endif]--&gt; 
&lt;link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/8cf774b8fab5fc69dfcb4f354abb2aa8/_/download/contextbatch/css/atl.general/batch.css" media="all"&gt; 
&lt;link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/8d26f49c7d4aa3dbb86c5bfb0f595b57/_/download/contextbatch/css/jira.general/batch.css" media="all"&gt;
&lt;link type="text/css" rel="stylesheet" href="/s/a87ff679a2f3e71d9181a67b7542122c-CDN/en_USh97jhf/6337/4/70e0f36a09c70d4ec7ba475fa61d1407/_/download/contextbatch/css/jira.global/batch.css" media="all"&gt;
&lt;script type="text/javascript" src="/s/7b640bac8949aa5154ea9a8109414da4-CDN/en_USh97jhf/6337/4/3/_/download/superbatch/js/batch.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/e7f6f697fc688acc37ab3513fc080ea0-CDN/en_USh97jhf/6337/4/8cf774b8fab5fc69dfcb4f354abb2aa8/_/download/contextbatch/js/atl.general/batch.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/8d26f49c7d4aa3dbb86c5bfb0f595b57/_/download/contextbatch/js/jira.general/batch.js" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/e0bc9dbb2733d223feed22419efae43f-CDN/en_USh97jhf/6337/4/70e0f36a09c70d4ec7ba475fa61d1407/_/download/contextbatch/js/jira.global/batch.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/618cdcf7eba9a12a6d1169e207b96d15-T/en_USh97jhf/6337/4/1.5/_/download/batch/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/rest/api/1.0/shortcuts/6337/7c50ab94944583add27652c583fe1f6e/shortcuts.js"&gt;&lt;/script&gt;

&lt;meta name="application-name" content="JIRA" data-name="jira" data-version="6.3.7"&gt;
&lt;/head&gt;
&lt;body id="jira" class="aui-layout aui-style-default page-type-message" data-version="6.3.7" &gt;
&lt;div class="aui-page-panel"&gt;&lt;div class="aui-page-panel-inner"&gt;
&lt;section class="aui-page-panel-content"&gt;
&lt;header class="aui-page-header"&gt;&lt;div class="aui-page-header-inner"&gt;
&lt;div class="aui-page-header-main"&gt;
&lt;h1&gt;Unauthorized (401)&lt;/h1&gt;
&lt;/div&gt;&lt;!-- .aui-page-header-main --&gt;
&lt;/div&gt;&lt;!-- .aui-page-header-inner --&gt;&lt;/header&gt;&lt;!-- .aui-page-header --&gt;
&lt;div class="aui-message aui-message-warning warning"&gt;
&lt;p&gt;Encountered a &lt;code&gt;&amp;quot;401 - Unauthorized&amp;quot;&lt;/code&gt; error while loading this page.&lt;/p&gt;
&lt;p&gt;&lt;a href="/secure/MyJiraHome.jspa"&gt;Go to JIRA home&lt;/a&gt;&lt;/p&gt;
&lt;span class="aui-icon icon-warning"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/section&gt;&lt;!-- .aui-page-panel-content --&gt;
&lt;/div&gt;&lt;!-- .aui-page-panel-inner --&gt;&lt;/div&gt;&lt;!-- .aui-page-panel --&gt;
&lt;/body&gt;
&lt;/html&gt;


[root@node1 //]#

 

Any ideas?

 

The same result if to enter code in one row.

 

curl -D- -u root:root -X POST --data {{ "fields": { "project": { "key": "CI" }, "summary": "REST ye merry gentlemen.","description": "Creating of an issue using project keys and issue type names using the REST API", "issuetype": { "name": "Bug" }}}} -H "Content-Type: application/json" http://localhost:8080/rest/api/2/issue/

 

&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Unauthorized (401)&lt;/title&gt;
                                     

&lt;!--[if IE]&gt;&lt;![endif]--&gt;
&lt;script type="text/javascript"&gt;var contextPath = '';&lt;/script&gt;
&lt;script&gt;                                                     
window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};
WRM._unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="\"\"";
WRM._unparsedData["com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources.resource-uris"]="{\"deployJava.html\":\"/s/en_USh97jhf/6337/4/1.5.11/_/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/deployJava.html\",\"clipboard.jar\":\"/s/en_USh97jhf/6337/4/1.5.11/_/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/clipboard.jar\",\"clipboard-legacy.jar\":\"/s/en_USh97jhf/6337/4/1.5.11/_/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/clipboard-legacy.jar\"}";                             
&lt;/script&gt;                                                                                                                                                               
&lt;link type="text/css" rel="stylesheet" href="/s/a87ff679a2f3e71d9181a67b7542122c-CDN/en_USh97jhf/6337/4/3/_/download/superbatch/css/batch.css" media="all"&gt;             
&lt;!--[if lte IE 9]&gt;                                                                                                                                                      
&lt;link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/3/_/download/superbatch/css/batch.css?conditionalComment=lte+IE+9" media="all"&gt;                                                                                                                                                         
&lt;![endif]--&gt;                                                                                                                                                            
&lt;link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/8cf774b8fab5fc69dfcb4f354abb2aa8/_/download/contextbatch/css/atl.general/batch.css" media="all"&gt;                                                                                                                                        
&lt;link type="text/css" rel="stylesheet" href="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/8d26f49c7d4aa3dbb86c5bfb0f595b57/_/download/contextbatch/css/jira.general/batch.css" media="all"&gt;
&lt;link type="text/css" rel="stylesheet" href="/s/a87ff679a2f3e71d9181a67b7542122c-CDN/en_USh97jhf/6337/4/70e0f36a09c70d4ec7ba475fa61d1407/_/download/contextbatch/css/jira.global/batch.css" media="all"&gt;
&lt;script type="text/javascript" src="/s/7b640bac8949aa5154ea9a8109414da4-CDN/en_USh97jhf/6337/4/3/_/download/superbatch/js/batch.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/e7f6f697fc688acc37ab3513fc080ea0-CDN/en_USh97jhf/6337/4/8cf774b8fab5fc69dfcb4f354abb2aa8/_/download/contextbatch/js/atl.general/batch.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_USh97jhf/6337/4/8d26f49c7d4aa3dbb86c5bfb0f595b57/_/download/contextbatch/js/jira.general/batch.js" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/e0bc9dbb2733d223feed22419efae43f-CDN/en_USh97jhf/6337/4/70e0f36a09c70d4ec7ba475fa61d1407/_/download/contextbatch/js/jira.global/batch.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/s/618cdcf7eba9a12a6d1169e207b96d15-T/en_USh97jhf/6337/4/1.5/_/download/batch/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources.js?locale=en-US" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/rest/api/1.0/shortcuts/6337/7c50ab94944583add27652c583fe1f6e/shortcuts.js"&gt;&lt;/script&gt;

    &lt;meta name="application-name" content="JIRA" data-name="jira" data-version="6.3.7"&gt;
&lt;/head&gt;
&lt;body id="jira" class="aui-layout aui-style-default page-type-message"  data-version="6.3.7" &gt;
    &lt;div class="aui-page-panel"&gt;&lt;div class="aui-page-panel-inner"&gt;
            &lt;section class="aui-page-panel-content"&gt;
                    &lt;header class="aui-page-header"&gt;&lt;div class="aui-page-header-inner"&gt;
                            &lt;div class="aui-page-header-main"&gt;
                                    &lt;h1&gt;Unauthorized (401)&lt;/h1&gt;
                                &lt;/div&gt;&lt;!-- .aui-page-header-main --&gt;
                        &lt;/div&gt;&lt;!-- .aui-page-header-inner --&gt;&lt;/header&gt;&lt;!-- .aui-page-header --&gt;
                    &lt;div class="aui-message aui-message-warning warning"&gt;
                            &lt;p&gt;Encountered a &lt;code&gt;&amp;quot;401 - Unauthorized&amp;quot;&lt;/code&gt; error while loading this page.&lt;/p&gt;
                            &lt;p&gt;&lt;a href="/secure/MyJiraHome.jspa"&gt;Go to JIRA home&lt;/a&gt;&lt;/p&gt;
                        &lt;span class="aui-icon icon-warning"&gt;&lt;/span&gt;&lt;/div&gt;
                &lt;/section&gt;&lt;!-- .aui-page-panel-content --&gt;
        &lt;/div&gt;&lt;!-- .aui-page-panel-inner --&gt;&lt;/div&gt;&lt;!-- .aui-page-panel --&gt;
&lt;/body&gt;
&lt;/html&gt;
WTF?
 
credentials for root are correct!!!!
0 votes
sureng July 29, 2014

Also for JIRA when i log in manually i use my email id(sureng.reddy@gmail.com). In the settings i created 'sureng' for user name. I used sureng and emaild id when using CURL but same issue all the time...

0 votes
sureng July 29, 2014

Nope i don't have any proxies installed. I can log into atlassian and create a defect manually..

As you have seen i am trying to connect to DEMO server: https://jira.atlassian.com

0 votes
Pedro Cora
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 29, 2014

This is clearly an authentication issue. Do you happen to have a webproxy where you're running this CURL?

Also, what is the URL of the instance that you are trying to reach?

Suggest an answer

Log in or Sign up to answer