2

I get a SVN post commit failed: Error msg is :

post-commit hook failed (exit code 255) with no output.

I tried few different scenerios: 1) Login putty as root and run the cmd in post-commit manually, able to execute the cmd successfully. 2) Login using user xxxx and run the same cmd, the cmd run failed.

So, i thought is the permission issue. but my question is that, whenever we SVN commit using SVN tortoise, are we committing as a xxxx user ? or as a root?

Note: I had included the user xxxx in the conf/passwd.

=============

My cmd in post-commit is :

#!/bin/sh
svn checkout svn://mmmm.my/mstardev /home/mmmm/public_html/mstardev
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
redcoder
  • 2,233
  • 4
  • 22
  • 24
  • 1
    Post-commit hook runs on server side, so mentioning Tortoise in the title is misleading. – Dialecticus Aug 01 '14 at 08:04
  • 1
    Also, it appears that you are using SVN as poor man's deployment tool. SVN is not meant to be used like that. Use proper deployment tool. – Dialecticus Aug 01 '14 at 08:05
  • I was thinking that, after SVN commit from local to web server,then the post-commit in web server will execute that post-commit cmd. Is this not a correct use of SVN? I mention SVNTortoise was refering to the client I use to commit file to server. – redcoder Aug 01 '14 at 08:20

1 Answers1

2

255 exit code in SVN hooks is (usually) "Permission problem" or "File not found"

You may be victim of both:

  • Hooks are executed in empty environment, thus - plain svn without full path to it may be (must be) problematic
  • Hooks executed under user, which runs used SVN-server and svnserver-user may have not rights for writing into /home/mmmm/public_html/mstardev

If you'll redirect stdout of checkout to stderr (/usr/bin/svn co --username ... --password ... 1>&2), you'll see results of svn co attempt

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110