incubator-allura-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cory Johns" <>
Subject [allura:tickets] #6894 SVN/Git refresh hooks fail for redirects
Date Thu, 09 Jan 2014 23:56:55 GMT


** [tickets:#6894] SVN/Git refresh hooks fail for redirects**

**Status:** code-review
**Labels:** git svn curl 
**Created:** Tue Nov 19, 2013 02:13 PM UTC by Rui Ferreira
**Last Updated:** Thu Jan 09, 2014 10:36 PM UTC
**Owner:** Cory Johns


I've been having a problem where repositories in an Allura instance failed to refresh after
a git or svn commit was pushed into the repository. It turns out that the curl call in the
repository hooks was hitting an HTTP redirect which caused it to never call the /auth/repo_refresh/

Here is a detailed walkthrough.
Whenever a commit is pushed, a hook invokes curl to do a refresh, e.g.


Notice that this particular URL starts with a double slash (__//__). This happened because
the **base_url** option in the settings file had a trailing slash i.e.

    base_url =

Since the hook generators in *ForgeGit/forgegit/model/* and *ForgeSVN/forgesvn/model/*
generate the URL by appending the path to the base_url 

    url=tg.config.get('base_url', 'http://localhost:8080')
            + '/auth/refresh_repo' + self._repo.url())

the URL path will start with a double slash(**//**).

This will cause the webserver to return a 301 redirect with a fixed path

    <title>301 Moved Permanently</title>
    <h1>Moved Permanently</h1>
    <p>The document has moved <a href="">here</a>.</p>

This will cause curl to immediately stop, because curl does not follow redirects by default.

A couple of solutions come to mind, but I don't know if the current behaviour is intentional
or not, so they might not make sense:

1. The quickest solution (for my case at least) was to fix the **base_url**, removing the
trailing slash. But it might make sense in other setups for a redirect to be there. Also this
does not fix existing repositories, since the hooks were already saved.
2. Changing the hooks to pass the **-L** parameter to curl, causes curl to follow redirects
3. Change *ForgeGit/forgegit/model/* and *ForgeSVN/forgesvn/model/* to sanitise
the URL before generating the hook

Like I said, I don't know if the current behaviour (no redirects) is intentional or not, but
at least (3.) would easily avoid trailing slash issues.

Hope this helps, cheers.


Sent from because is subscribed to

To unsubscribe from further messages, a project admin can change settings at
 Or, if this is a mailing list, you can unsubscribe from the mailing list.
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message