Help with subversion post-commit hooks, permissions, and drupal

apps

#1

//EDIT INCLUDED BELOW

Hi there,

So I’ve been trying to solve my problem by reading the wiki and just about every post out there on this topic for the past two days. It is time to tap the resources of the community. So, thank you for your time, I have put in mine and you are saving the other side of my forehead from being pounded into the desk.

I followed the dreamhost wiki post on subversion and am getting some errors.

I have 2 Dreamhost accounts (mine and the clients) which I am trying to get to play nice with subversion post-commits. My account, where I am hosting the repos, is a VPS. The post-commit hook runs:

wget --http-user=username --http-passwd=password -Oq - http://cgi.domain.com/path/to/script

Please note, I had to create a sub domain which points away from the Druapl site root (domain.com) so that Drupal’s internal engine did not try to run the URL for the script (I don’t know if I had to do that but it seems logical that it removes a layer of complexity). Domain.com’s root is at /home/user/domain.com/current/ (where the drupal core files are located) while cgi.doamin.com’s root is at /home/user/domain.com/ (this was done in the dreamhost cpanel)

When I run the wget command in the terminal without the quiet param (from the repo’s hooks directory) to test what would be in the post-commit hook, I get the following error:

--15:42:46--  http://cgi.boobooska.com/cgi-bin/pri/post-commit.cgi
           => `-'
Resolving cgi.domain.com... 99.999.999.9
Connecting to cgi.domain.com|99.999.999.9|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
15:42:46 ERROR 500: Internal Server Error.

I tried navigating to the URL (http://cgi.domain.com/path/to/script) in the browser to see if I can run the script, but get the same internal server error 500 on the page. So I believe that is where my problem is happening. I looked at just cgi.domain.com and it loads the directory list.

Since both directories of domian.com are owned by the same user and group, I can’t imagine a permissions issue on these folders. They are listed below:

Directory
drwxr-xr-x 2 user group 4096 2010-07-20 10:49 pri

Script
-rwxr-xr-x 1 user group 165 2010-08-08 13:21 post-commit.cgi

So that is isuue #1. I’m not sure I have an issue #2 but I might as well ask the question if you are still reading…

The post-commit file in the repo’s hooks directory was created by my shell user so it is not owned by the dhapache user. I of course tried it with the dhapache user as owner way but got stuck in the wiki instructions when I needed to chmod 755 to give exectute permissions. Once I created the file myself, I was able to give execute permissions. So, assuming that is correct and I can get my post commit command (wget …) to fire, it should run find for the post-commit hook when I svn omit from a working copy. Just putting that out there in case I should need to change that files owner back to dhapache by nuking the repo and recreating it.

Can someone point me in the correct direction? Thank you for you time.
Steve

PS – Forgot to mention that with everything in place, when I run svn commit from my working copy, I get the following error:

Committed revision 66.

Warning: post-commit hook failed (exit code 1) with no output.

//EDIT 8-11-10

So I got the cgi script working when I run the wget command listed in the tutorial from the post-commit directory of my repo. Everything updates nicely.
When I apply the code into the post-commit file and then svn commit from my local working copy I get the following error:

Warning: post-commit hook failed (exit code 127) with output:
/home/username/svn/dir1/hooks/post-commit: line 48: http://domain.com/cgi-bin/pri/post-commit.cgi: No such file or directory

So I don’t get why this would happen if the very same wget call from the command line within the very same directory of the repo/hooks works. I’ve also tried hitting the url to the script directly in the browser and it works.

Any ideas or help is much appreciated.