tag:support.hglabhq.com,2012-10-18:/discussions/problems/1100-hglabs-existing-repository-import-http-error-400-bad-requestHgLab: Discussion 2017-06-13T13:51:11Ztag:support.hglabhq.com,2012-10-18:Comment/427424672017-06-11T18:29:18Z2017-06-11T18:29:18ZHgLabs Existing Repository Import - HTTP Error 400: Bad Request<div><p>Stephen,</p>
<p>This is most likely due to the fact that the payload you are pushing exceeds all allowed limits.</p>
<p>Let's start with verifying this hypothesis. Does "hg push -r 1" work for you?</p></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/427424672017-06-11T19:09:58Z2017-06-11T19:09:58ZHgLabs Existing Repository Import - HTTP Error 400: Bad Request<div><p>Ooooooh – it does indeed ☺</p>
<p>(Thank you for responding over the weekend too!)</p>
<p>So, assuming a one-by-one push approach works to import my repository history, I could take a piecemeal approach, pushing revisions 2 through……. 10000 (just a guess; our tip is currently something like 35447 or so, so perhaps in thirds would keep things fitting nicely). Then again another hg push –r 10001 through 20000.</p>
<p>Not totally sure of the exact syntax there, but I think I recall seeing another support question article about that process. … and I’m sure I can google the exact syntax.</p>
<p>Thoughts?</p>
<hr>
<p>Steve Dominguez<br>
Team Lead, Seismic Intepretation<br>
CGG GeoSoftware</p>
<p>M +01 303 570 1581</p></div>stephen.domingueztag:support.hglabhq.com,2012-10-18:Comment/427424672017-06-13T09:53:37Z2017-06-13T09:53:37ZHgLabs Existing Repository Import - HTTP Error 400: Bad Request<div><p>Steve,</p>
<p>Three workarounds I see.</p>
<ol>
<li>Just copy the repository over to HgLab Server manually. Take the <code>.hg</code> directory and copy it to <code>HGLAB_HOME_DIRECTORY\repositories\mainline\PROJECT_SLUG\REPOSITORY_NAME</code>, overwriting what's already there<br></li>
<li>Take the piecemeal approach. To smarten things up, you could try a "bisection" of sorts: if <code>hg push -r 15000</code> fails, try <code>hg push -r 7500</code>, <code>hg push -r 3200</code>, etc.<br></li>
<li>Tune IIS to allow for larger POST payloads (this is done in <code>Web.config</code>):</li>
</ol>
<pre>
<code><system.web>
<httpRuntime
enableVersionHeader="false"
executionTimeout="3600"
maxRequestLength="2097152"
maxUrlLength="8192"
maxQueryStringLength="8192" />
</httpRuntime>
</system.web>
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxQueryString="8192" maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
</system.webServer></code>
</pre></div>Anton Gogolevtag:support.hglabhq.com,2012-10-18:Comment/427424672017-06-13T13:51:10Z2017-06-13T13:51:10ZHgLabs Existing Repository Import - HTTP Error 400: Bad Request<div><p>Absolutely correct – in fact, all three approaches seem to work just fine!</p>
<p>Had a little bit of trouble figuring out where to drop the .hg directory at first, but I tracked it down…</p>
<p>The piecemeal approach worked perfectly well also until I encountered our rev#27839 which was a single rev too large to push… at which point item 3 worked perfectly as well.</p>
<p>I’ll be submitting a next support ticket regarding ‘subrepo’ support… but that’s a separate issue, so we can surely mark this one as closed!</p>
<p>Thanks for all the attention and help!</p>
<hr>
<p>Steve Dominguez<br>
Team Lead – Seismic Interpretation Software<br>
P +01 832 351 5626<br>
M +01 303 570 1581</p></div>stephen.dominguez