https://issues.rhodecode.com/https://issues.rhodecode.com/favicon.ico?16960560042019-02-22T17:19:50ZRhodeCode - issuesRhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=263962019-02-22T17:19:50ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>Hi Markus,</p>
<p>The issue you're desribing looks like a problem with cache invalidation. This is indeed somehow related to vcs_full_cache setting. Normally how it works is that during the push rhodecode notifies it's caches that something changed and cache should be invalidated. This for SVN backend is handled by hooks inside SVN repositories. I suspect that maybe your repositories already have some hooks and RhodeCode doesn't override them preventing any data losses.</p>
<p>You could force install the hooks by going to such url:</p>
<p><a href="http://you-server-address/REPO_NAME/settings/advanced/hooks" class="external">http://you-server-address/REPO_NAME/settings/advanced/hooks</a></p>
<p>This should re-install RhodeCode SVN hooks for this particular repository.</p>
<p>Regarding the second issue, could you share the test repository with us so we can investigate this?</p>
<p>Best,</p>
RhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=264002019-02-25T11:53:34ZMarkus Leitold
<ul><li><strong>File</strong> <a href="/attachments/3044">8.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3044/8.png">8.png</a> added</li></ul><p>Hi Marcin,</p>
<p>now things become clear .... in our productive repo we indeed already have post- and pre-commit hooks (perl-written) which weren't overwritten by RhodeCodes "Remap and Rescan" and they have to stay and work beside RhodeCode. So it was very good they where not overwritten, so force - install RhodeCodes Hooks will not be a solution.</p>
<p>In the mentioned test repo we didn't have hooks, of course. After "Remap and Rescan" we noticed, that every SVN commit fails with an error like "Commit was blocked by pre-commit hook with no output (error 255)":</p>
<p><img src="https://issues.rhodecode.com/attachments/download/3044/8.png" alt="" loading="lazy" /></p>
<p>At this point we noticed for the first time the hooks which RhodeCode installed. After deleting them, commits work again but "Remap and Rescan" re-installed the RhodeCode hooks and commits failed again. So we delete the hooks again and installed a "dummy" pre- and post-commit hook which just do an "exit 0" to prevent RhodeCode from installing its own hooks, which don't work in our environment. We assumed we safely could do that, because we thought the RhodeCode hooks just where neccessary when our own hooks would be managed in RhodeCode, too.</p>
<p>All this now leads to two questions when RhodeCodes hooks are needed for the caching beahviour:<br>
-> How could the RhodeCode hooks exists beside our own hooks?<br>
-> Why do RhodeCode hooks errors out in our environment? They are written in python, arn't they? Python 2.7.13 is installed... </p>
<p>Ahh... and what about the secons issue, the reproducable "500 internal server error" while opening one specific commit in the productive repo? ("TypeError: expected a string or other character buffer object")</p>
RhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=264012019-02-25T11:59:15ZMarkus Leitold
<ul></ul><p>I just noticed the #! line in the RhodeCode hooks... this could be the cause that the hooks fail, this line is:</p>
<pre><code>#!/root/.rccontrol/vcsserver-1/profile/bin/python
</code></pre>
<p>The commits are triggered by Apache, as the Windows Tortoise clients access the repos with "https://...." over Apaches mod_dav_svn. <br>
Apache is running as non-root user, so of course Apache may not access "/root/...."... I track this down further...</p>
RhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=264022019-02-25T16:16:15ZMarkus Leitold
<ul></ul><p>Indeed .... wwwrun (the user which runs Apache) isn't (of course) allowed to run anything under /root ... </p>
<p>So to make RhodeCodes hooks work in this constellation one has to install it as "wwwrun", not "root". Then the hooks will work ... but what about the existing perl-written hooks?</p>
RhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=264032019-02-25T16:25:02ZMarcin Kuzminski [CTO]marcin@rhodecode.com
<ul></ul><p>Dear Markus - </p>
<p>Our hooks are a simple self-contained python script. I believe in the case of your perl custom SVN hooks, you could simply run our hook from within your perl scripts (maybe as a subprocess call?) The hooks use environment variables to read some data, just make sure the execution from Perl passed the environment into our script.</p>
<p>Why those hooks are required? They act as a trigger for:</p>
<ul>
<li>cache invalidation </li>
<li>integrations triggering</li>
<li>rcextensions calls</li>
</ul>
<p>Potentially you don't need to have those hooks as all 3 are optional, and cache invalidation can be trigger via API call from your perl script, or even periodically every N minutes or so.</p>
RhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=264042019-02-25T16:36:00ZMarkus Leitold
<ul></ul><p>Hi Marcin,</p>
<p>thx for the explanations ... as we will use RhodeCode just for simple Code-Reviews and not for anything else the cache invalidation would be the only reason to use your hooks IMHO. <br>
How could these be triggered from our own perl hooks? 1.) They aren't installed when our hooks are existing, 2.) the permission problem as describe above will remain 3.) if we simply copy/rename (from) your installed hooks then newer hook versions during RhodeCode updates will never be considered.</p>
<p>So I think the cache invalidation would best be done through API Calls, I'll try to figure out how this exactly works</p>
RhodeCode CE/EE - Bug #5540: Rhode Code 4.15.2 VCS Caching(?) behaviourhttps://issues.rhodecode.com/issues/5540?journal_id=264052019-02-25T17:01:08ZMarkus Leitold
<ul></ul><p>OK, very simple... I managed to trigger the cache - invalidation by a curl - request in a post-commit hook in the test-repo ... now everything concerning caching seems to work now</p>