I get 404 when I try to use this plugin

Issue #18 on hold
Robert Dailey created an issue

I installed this through msysgit on Windows using git 1.9.2. I run the following command, which also contains the XML response for the 404:

$ stash pull-request bugs/5457-survey-crash-on-bad-data releases/4.2.0 -o
error: 757: unexpected token at '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>404 - File or directory not found.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>404 - File or directory not found.</h2>
  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
 </fieldset></div>
</div>
</body>
</html>
'. Use --trace to view backtrace

I have setup stash to live behind an IIS server, which proxies to it, this is the reason why 404 comes back. But I have no idea what URL it is trying to pass to Stash. Any help?

Comments (7)

  1. Seb Ruiz Account Deactivated

    The command line tools is constructs a URL from the combination of the stash url which you configured the tool to use, and the project/repo info from the git remote (defaulting to origin).

    It will also use proxy information if configured.

  2. Robert Dailey reporter

    How can I see the URL that it is generating for the request? I need to see this to diagnose the problem. I have entered the correct base URL:

    http://m0014/stash

    My "origin" remote points to my fork. My "upstream" remote points to the central repo.

    My configuration seems pretty simple & correct. It seems wrong to me that the tool is assuming a remote named "origin". I should be able to specify the remote location of the source branch and the destination branch separately. My pull requests are usually as follows:

    origin/topic-branch --> upstream/release-branch

  3. Seb Ruiz Account Deactivated

    Unfortunately to see the URL which is being generated you'll need to patch the ruby file called pull_request.rb. I have some plans to add further debugging to the tool to help diagnose these issues, but this is a spare time project that I have been putting together over a few weekends! It started with minimal functionality and is slowly growing, so it is great to hear your use case. Pull requests and contributions are of course welcomed with open arms :)

    It is certainly possible to configure the default origin. You can set the flag -r remote to specify the remote, or use the global config option remote: upstream in stashconfig.yml to set it as a global default.

  4. Robert Dailey reporter

    Thanks Seb. I'd really love to toss you a pull request, but unfortunately Ruby isn't on my list of languages that I know. If you had written this in Python or C++ that'd be a different story :)

    I'm not quite sure I understand the tool. Does it just open the web browser with default options selected based on the commands passed in? Or does it create the pull request completely without any manual intervention? If the latter, then how does the tool use the "origin" remote? For example, if my source branch and destination branches are on two different repositories, how will it use "origin" to refer to one or the other?

  5. Seb Ruiz Account Deactivated

    The tool creates a pull request using Stash's REST API, and will optionally open the browser window at the url. The remote url is used to extract the project and repository info, as this is encoded into the Stash git remote url.

    Currently, it only supports branch based workflows, and assumes that the source and destination refs are in the same repo – obviously this doesn't work with forked repositories. This is a limitation of the tool and almost certainly a function of not personally using a forked repository workflow.

    I would be happy to implement such a feature if you would have a suggestion on how to pass in these options, but it would also be feasible to ask Stash for the parent repo. I would suggest that this discussion gets moved to issue #15 however.

  6. Log in to comment