install hook failed - curl init.d/gitlab does not handle redirect

Bug #1360594 reported by Martijn Evers
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gitlab (Juju Charms Collection)
Fix Released
High
Martin Hilton

Bug Description

The init_script function in the install hook executes this line:

sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab

Because github sends an HTTP/1.1 301 Moved Permanently back and curl doesn't follow it by default it fails the next statement in the init_script function. The 301 redirects to: https://raw.githubusercontent.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab

To fix this, line 165 in /hooks/install stating: "sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab" should be changed to: "sudo curl -L --output /etc/init.d/gitlab https://raw.githubusercontent.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab".

Notice:
* I changed the URI to point to the new location at raw.githubusercontent.com.
* I added the -L option to curl so curl will follow future 301 responses.

Tags: audit
Revision history for this message
Matt Bruzek (mbruzek) wrote :

I can confirm that gitlab does not install on precise.

I also can confirm that -L seems to fix the problem with the redirect. Also the following command seems to work:
sudo wget -O /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab

tags: added: audit
Matt Bruzek (mbruzek)
Changed in gitlab (Juju Charms Collection):
importance: Undecided → High
Changed in gitlab (Juju Charms Collection):
assignee: nobody → Martin Hilton (martin-hilton)
Changed in gitlab (Juju Charms Collection):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.