https://issues.rhodecode.com/https://issues.rhodecode.com/favicon.ico?16960560042019-07-01T02:39:35ZRhodeCode - issuesRhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264572019-07-01T02:39:35ZRicardo Rodrigues
<ul></ul><p>I'm also having this issue. Were you able to fix it? How?</p>
<p>It seems that when it tries to redirect, the file is already closed.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264582019-07-01T08:32:07ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>Hi Rocardo,</p>
<p>Have you tried to set force_ssl in rhodecode.ini configuration ?</p>
<p>Maybe that would solve it.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264592019-07-01T12:41:32ZRicardo Rodrigues
<ul></ul><p>Hi Marcin, thank you for your reply.</p>
<p>I've tried with both force_ssl false and true. Either way git-lfs tries to use HTTP instead of HTTPS.</p>
<p>The problem can arise from several places. It is a git-lfs bug? Is it a file permission problem? Is it a Rhodecode bug?</p>
<p>I'm running Rhodecode 4.16.2 Community on a Debian 8.11 jessie. If you want I can run some tests here.</p>
<p>PS: The option "Require SSL for vcs operations" always fails to allow pulls and pushes. Is it related? I don't know how to fix it, but that should be another issue.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264602019-07-02T12:57:56ZRicardo Rodrigues
<ul></ul><p>Ok, here's an update.</p>
<p>The issue is in the LFS server implementation regarding how it deals with HTTP to HTTPS redirects. I posted an issue on git-lfs Github and this is the response:</p>
<blockquote>
<p>Thanks for this information.</p>
<p>The problem here is that your server is producing a 302 in this case. Go's HTTP redirection support changes the request from a PUT to a GET in this case (since that's what web browsers do), so even if we rewound the body, this request wouldn't work, since GET requests can't have a body and the server wouldn't accept the request. You'll need to adjust your LFS server implementation so that it provides the correct URL (one using HTTPS) in the batch request. Git LFS doesn't provide a way to rewrite these requests, since the server is presumed to know where the data should be sent.</p>
<p>If the response were a 307 or 308, we could add support for that in Git LFS, but a 301 or 302 won't work here.</p>
</blockquote>
<p>Here is the link for the conversation: <a href="https://github.com/git-lfs/git-lfs/issues/3698#issuecomment-507415888" class="external">https://github.com/git-lfs/git-lfs/issues/3698#issuecomment-507415888</a></p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264622019-07-02T14:08:17ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>HI,</p>
<p>Thanks for the provided details. Our GIT-LFS server doesn't generate any 3XX codes at all: <a href="https://code.rhodecode.com/rhodecode-vcsserver/files/90644f979fa029551ff1daf50ed5ba123925519c/vcsserver/git_lfs/app.py" class="external">https://code.rhodecode.com/rhodecode-vcsserver/files/90644f979fa029551ff1daf50ed5ba123925519c/vcsserver/git_lfs/app.py</a></p>
<p>We only generate an url for obj in this call:<br>
<code>request.route_url('lfs_objects_oid', repo=repo, oid=oid)</code></p>
<p>This can generate either HTTP or HTTPS url based on headers sent from Apache/Nginx web-server. <br>
Please check if you have in your Apache: </p>
<pre><code>RequestHeader set X-Forwarded-Proto "https"
SetEnvIf X-Url-Scheme https HTTPS=1
</code></pre> RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264632019-07-02T14:15:50ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>On second thought it might be actually a problem with RhodeCode. </p>
<p>Since vcsserver <-> rc communicate over http the URLs generate might be in fact wrong. <br>
We'll confirm this and see if HTTPS headers are sent correctly from RhodeCode into vcsserver, so the URL generation is ok.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264642019-07-02T14:18:46ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>You could try to modify that inside vcsserver source code followed by restart of vcsserver</p>
<p>from</p>
<pre><code>request.route_url('lfs_objects_oid', repo=repo, oid=oid)
</code></pre>
<p>to</p>
<pre><code>request.route_url('lfs_objects_oid', repo=repo, oid=oid, _scheme='https')
</code></pre>
<p>to quickly check !</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264652019-07-02T14:42:15ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>High</i></li><li><strong>Target version</strong> set to <i>v4.17</i></li></ul><p>Confirmed it's a bug, and we'll add a proper fix to the next release.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264662019-07-02T16:16:28ZRicardo Rodrigues
<ul></ul><p>Newer update. (sorry for the spam)</p>
<p>It's both an error from my end and Lyndsi.</p>
<p>I am serving Rhodecode with Apache and using Proxy mod. Meaning that when accessing the website url (through port 443 HTTPS) I proxy it to 10002 (where Rhodecode is running).</p>
<p>My problem is that, when I received a request for port 80, I made Apache redirect it to 443. Therefore I was breaking the git-lfs push.</p>
<p>To fix it, instead of redirecting I proxy port 80 to port 10002, and in the Rhodecode.ini toggle the <code>force_https = true</code>. This fixes the issue and shows it is not related with Rhodecode, but with its setup.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264672019-07-02T16:19:47ZRicardo Rodrigues
<ul></ul><p>From what you wrote it does seem to be a bug. Mainly because if I blocked every HTTP request to my server it wouldn't work right?</p>
<p>Because instead of using the HTTPS urls, it would create a HTTP instead and be blocked because of it.</p>
<p>My "fix" simply allows HTTP requests to be called. Correct?</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264682019-07-02T17:05:05ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>Yes, it seems that your fix just allowed communication over http. We discovered that the LFS object urls generated that are sent to the git client are always using HTTP. The simple change i posted would fix that. We have a fix already in place so it will be included in the next release.</p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264762019-07-07T22:18:52ZRedmine Integration
<ul></ul><p>Commit <code>43af4e52b104</code> by Daniel Dourvaris <a href="mailto:daniel@rhodecode.com">daniel@rhodecode.com</a> on <code>default</code> branch references this issue.<br>
<a href="https://code.rhodecode.com/rhodecode-vcsserver/changeset/43af4e52b104b7272ba3a54cb1064900b1ce380c" class="external">https://code.rhodecode.com/rhodecode-vcsserver/changeset/43af4e52b104b7272ba3a54cb1064900b1ce380c</a></p>
RhodeCode CE/EE - Bug #5399: Issues with Git LFS integrationhttps://issues.rhodecode.com/issues/5399?journal_id=264792019-07-07T22:21:07ZRedmine Integration
<ul></ul><p>Commit <code>b4126386c108</code> by Daniel Dourvaris <a href="mailto:daniel@rhodecode.com">daniel@rhodecode.com</a> on <code>default</code> branch references this issue.<br>
<a href="https://code.rhodecode.com/rhodecode-enterprise-ce/changeset/b4126386c108692e32713750ccb5874a9e59ecc5" class="external">https://code.rhodecode.com/rhodecode-enterprise-ce/changeset/b4126386c108692e32713750ccb5874a9e59ecc5</a></p>