Cannot clone nor push with http://username@stash:7990/scm

その他

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

While running Stash connected to JIRA User Directory, it is not possible to clone nor push in the following combination:

git clone http://username@stash:7990/scm/ACME/acmerepo.git

診断

To simulate the request that Stash is making to JIRA and see what JIRA is returning: 

  1. Create a file named "post-data" with the following contents:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <password>
    <value></value>
    </password>
  2. Run the following cURL command (from the directory where the file was created) with <application-name> and <application-password> replaced with the application name and application password that Stash is using to connect to JIRA as a user directory:

    curl -v -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u <application-name>:<application-password> https://www.acme.com/jira/rest/usermanagement/1/authentication?username=bbunny --data @post-data
  3. If JIRA is integrated with IIS, the response should contain something like:

    Server: Microsoft-IIS/7.5
    ...
    X-Powered-By: ASP.NET

原因

JIRA uses a 400 response code with a specific message in the body to indicate to Stash that authentication for a particular user has failed. In this case the response body and content-type are being mangled by IIS behavior.

This causes Stash to mis-parse the response from JIRA and fall over with a 500 error on the client.

ソリューション

  • Edit the web.config system.webServer section and set httpErrors existingResponse attribute to "PassThrough":

    <system.webServer>
        ...
        <httpErrors existingResponse="PassThrough"></httpErrors>
        ...
    </system.webServer>

    (info) For more information check Integrating JIRA with IIS.

最終更新日 2016 年 3 月 30 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.