Hey, Christian. I think I posted the debug output when the script is run as *www-data*, but it turns out I cannot get ANY OUTPUT when executing from the post-commit script. Here is the post-commit:
*REPOS="$1"* *REV=$(($2))* *OLDREV=$(($REV-1))* *RBSRV="http://reviews.example.test/"* *SVNLOOK=/usr/bin/svnlook* *AUTHOR="$($SVNLOOK author $REPOS -r $REV)"* * * *LogDir="/var/log/svn/"* *#Get only the name of the REPOSITORY as REPOS is a filesystem path:* *RepoName=${REPOS##*/}* *RepoURL="http://xxx.xxx.xxx.xxx/svn/${RepoName}"* * * *#Some debugging info* *echo "=====================================" >> /srv/logs/test* *whoami >> /srv/logs/test* *echo "svnlook: ${SVNLOOK}" >> /srv/logs/test* *echo "authhor: ${AUTHOR}" >> /srv/logs/test* *echo "Commited rev: ${REV}" >> /srv/logs/test* *echo "Old rev: ${OLDREV}" >> /srv/logs/test* *echo "RepoName-REPOS: ${RepoName}" >> /srv/logs/test* *echo "Repository URL: ${RepoURL}" >> /srv/logs/test* * * *post-review --repository-url="${RepoURL}" --revision-range="${OLDREV}":"${REV}" --server="${RBSRV}" --username=reviewposter --password="password" --submit-as="${AUTHOR}" -p --target-groups=reviewers --debug >> /srv/logs/post-rev 2>&1* *exit 0* */srv/logs/post-rev *is writable by www-data. Both *stdout *and *stderr*are redirected correctly. *root@borislav-desktop:/srv/svn/testRepo2/hooks# ll -aFl /srv/logs/* *drwxr-xr-x 2 www-data www-data 4096 2012-09-26 11:42 ./* *drwxr-xr-x 7 root root 4096 2012-09-25 13:27 ../* *-rw-r--r-- 1 www-data www-data 0 2012-09-26 11:44 post-rev* *-rw-r--r-- 1 www-data www-data 0 2012-09-25 17:30 superusr* *-rw-r--r-- 1 www-data www-data 4007 2012-09-26 11:44 test* Any suggestions? Thanks, Borislav. On Wednesday, 26 September 2012 10:38:32 UTC+3, Christian Hammond wrote: > > Hi, > > Unless I'm mistaken, it looks like the debug was for when you executed it > yourself, rather than from the original call site. > > By running it from sudo, it's using your home directory, meaning it may > use your cookies file. I'm interesting in how things look when run from the > environment post-review is running in when not run manually. > > Christian > > -- > Christian Hammond - [email protected] <javascript:> > Review Board - http://www.reviewboard.org > VMware, Inc. - http://www.vmware.com > > > On Wed, Sep 26, 2012 at 12:02 AM, Borislav Sabev > <[email protected]<javascript:> > > wrote: > >> Hello, Christian. >> >> Debug is already there. :) Notice the *-d* which is the same as *--debug* >> . >> Indeed I had missed quoting the password but it works without quoting it >> when I execute it as my user. Thus this seems not to be the thing stopping >> the script. >> >> As I previously stated when I try to execute the *same command* but *as* >> *www-data* for example, I get a prompt for a password for *www-data*! >> *www-data *does not need to enter a password as that user is merely >> executing the script - all other user/password info is stated in the >> arguments passed. >> >> Any suggestions? >> >> Borislav. >> >> >> On Wednesday, 26 September 2012 09:10:13 UTC+3, Christian Hammond wrote: >> >>> Hi, >>> >>> Just a quick sanity check. In your example, for the password, do you >>> have the password quoted? Is there any way that some part of it could be >>> interfering with the rest of the shell command? >>> >>> Can you add --debug to that and output it some place that you can check? >>> >>> Christian >>> >>> -- >>> Christian Hammond - [email protected] >>> >>> Review Board - http://www.reviewboard.org >>> VMware, Inc. - http://www.vmware.com >>> >>> >>> On Tue, Sep 25, 2012 at 6:23 AM, Borislav Sabev <[email protected]>wrote: >>> >>>> Hello all. >>>> >>>> I have a dull problem that I can't seem to solve. >>>> >>>> *What am I trying to do?* >>>> I am trying to do: >>>> *post-review >>>> --repository-url=http://xxx.xxx.xxx.xxx/svn/testRepo2--revision-range=6:7 >>>> --server= >>>> http://reviews.example.test/ --username=reviewposter >>>> --password=mydullpass --submit-as=admin -p --target-groups=reviewers* >>>> All is alright when I try this from bash logged in as my user. Review >>>> is posted, published, etc. ==> All permissions and other miscellaneous >>>> settings are OK. >>>> >>>> *What happens when I try this from SVN's post-commit hook?* >>>> The resources are commited but the svn operation hangs - actually the >>>> post-commit hook does not finish. >>>> >>>> *What is the problem?* >>>> post-review seems to get the user that is executing it and tries to log >>>> it in. The user that's executing it is www-data (apache user) I.e. when I >>>> run the command as www-data: >>>> *sudo -u www-data post-review --repository-url=**http://xxx. >>>> xxx.xxx.xxx/svn/testRepo2** --revision-range=6:7 **--server=ht >>>> tp://reviews.example.test/** --username=reviewposter --password=** >>>> mydullpass**! --submit-as=admin -p --target-groups=reviewers -d* >>>> * >>>> * >>>> I get (notice the -d parameter in the post-review command - DEBUG): >>>> *>>> RBTools 0.4.1* >>>> *>>> Home = /home/borislav* >>>> *Password for 'www-data':* >>>> >>>> This is where it hangs waiting for a password to be entered. The commit >>>> operation cannot finish and it just stays there. On the other hand when I >>>> do the same command with debug output but as myuser I get: >>>> *>>> RBTools 0.4.1* >>>> *>>> Home = /home/borislav* >>>> *>>> HTTP GETting api/* >>>> *>>> HTTP GETting http://reviews.example.test/api/info/* >>>> *>>> Using the new web API* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/1/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/1/info/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/2/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/2/info/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/3/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/3/info/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/4/* >>>> *>>> HTTP GETting http://reviews.example.test/api/repositories/4/info/* >>>> *>>> Attempting to create review request on http://xxx.xxx.xxx.xxx/svn/ >>>> testRepo2 for None* >>>> *>>> Submitting the review request as admin* >>>> *>>> HTTP POSTing to http://reviews.example.test/api/review-requests/: >>>> {'submit_as': 'admin', 'repository': 'http://xxx.xxx.xxx.xxx/svn/ >>>> testRepo2'}* >>>> *>>> Review request created* >>>> *>>> Attempting to set field 'target_groups' to 'reviewers' for review >>>> request '22'* >>>> *>>> HTTP PUTting to http://reviews.example.test/ >>>> api/review-requests/22/draft/: {'target_groups': 'reviewers'}* >>>> *>>> Uploading diff, size: 2316* >>>> *>>> HTTP POSTing to http://reviews.example.test/ >>>> api/review-requests/22/diffs/: {'basedir': '/'}* >>>> *>>> Publishing* >>>> *>>> HTTP PUTting to http://reviews.example.test/ >>>> api/review-requests/22/draft/: {'public': 1}* >>>> *Review request #22 posted.* >>>> * >>>> * >>>> *http://reviews.example.test/r/22/* >>>> * >>>> * >>>> So actually everything with the posting/publishing etc. works. >>>> >>>> One solution I thought of is to execute the command as my user from the >>>> post-commit hook but that seems out-stretched and ugly to me. >>>> Are there any other solutions? >>>> >>>> Thanks, >>>> Borislav. >>>> >>>> -- >>>> Want to help the Review Board project? Donate today at >>>> http://www.reviewboard.org/**donate/<http://www.reviewboard.org/donate/> >>>> Happy user? Let us know at >>>> http://www.reviewboard.org/**users/<http://www.reviewboard.org/users/> >>>> -~----------~----~----~----~--**----~----~------~--~--- >>>> To unsubscribe from this group, send email to reviewboard...@** >>>> googlegroups.com >>>> >>>> For more options, visit this group at http://groups.google.com/** >>>> group/reviewboard?hl=en<http://groups.google.com/group/reviewboard?hl=en> >>>> >>> >>> -- >> Want to help the Review Board project? Donate today at >> http://www.reviewboard.org/donate/ >> Happy user? Let us know at http://www.reviewboard.org/users/ >> -~----------~----~----~----~------~----~------~--~--- >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/reviewboard?hl=en >> > > -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~----------~----~----~----~------~----~------~--~--- To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
