Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2015-08-04 Thread Christian Hammond
Hi,

Just to check, is this repository local to the Review Board server, or
remote?

If local, make sure that your web server's user (usually apache or
www-data) has read access to everything under the git repository.

if remote, you're going to need to use a service like
gitweb/cgit/gitlab/etc, since Git has no support for fine-grained remote
access to files/commits. We have some docs on how to do this:
https://www.reviewboard.org/docs/manual/2.0/admin/configuration/repositories/#raw-file-urls

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

On Tue, Aug 4, 2015 at 10:07 AM, udam.dewar...@gmail.com wrote:

 Hello,

 I'm trying to set up reviewboard on Fedora linux. I've already disabled
 SELinux due to other issues starting up Reviewboard. Running apache with
 the other recommended settings. Now I have review board setup but cannot
 get my git repository set up (even after trying for a day).

 Here's my issue:
 - I could not get the get repository setup with remote pointing to my
 private github repository.
 - Since then I have setup a local git repo using ssh
 - I've put the local git repo in multiple places (/tmp/foo, /home/user/foo
 etc) yet continue to get the same error in the setup repo screen where it
 says permission denied accessing the local git repository
 - In the mirror path, I specify ssh://g...@git.host.lan/github/foo.git
 - I've tried giving the apache user ownership of the foo directory and the
 .git directory and given ugo+rwx on both of those directories.

 If I specify only the ssh://g...@git.host.lan/github/foo.git as the path
 and leave the mirror path empty OR specify the same for the mirror path, I
 can create the repo but cannot post a review to the repo. It fails with the
 error:

 ~/D/P/foo ❯❯❯ rbt post --debug
  RBTools 0.7.4
  Python 2.6.9 (unknown, Sep  9 2014, 15:05:12)
 [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
  Running on Darwin-14.4.0-x86_64-i386-64bit
  Home = /Users/user
  Current directory = /Users/user/Development/Projects/foo
  Running: git version
  Checking for a Subversion repository...
  Running: svn --non-interactive info
  Command exited with rc 1: ['svn', '--non-interactive', u'info']
 svn: E155007: '/Users/user/Development/Projects/foo' is not a working copy
 ---
  Checking for a Git repository...
  Running: git rev-parse --git-dir
  Running: git config core.bare
  Running: git rev-parse --show-toplevel
  Running: git symbolic-ref -q HEAD
  Running: git config --get branch.master.merge
  Running: git config --get branch.master.remote
  Running: git config --get remote.origin.url
  repository info: Path: http://git.domain.lan/host/foo.git, Base path:
 , Supports changesets: False
  Making HTTP GET request to http://host.domain.lan/api/
  Making HTTP GET request to http://host.domain.lan/api/info/
  Running: git rev-parse refs/heads/master
  Running: git merge-base 7811f02d7382c80525973c17f3cd810d191b81db
 origin/master
  Running: git rev-parse 715970e7fa070b836cf00c0af254bee94776dc08
  Running: git status --porcelain --untracked-files=no
  Running: git rev-parse --git-dir
  Running: git -c core.quotepath=false -c diff.noprefix=false diff
 --no-color --full-index --ignore-submodules -M --no-ext-diff
 715970e7fa070b836cf00c0af254bee94776dc08..7811f02d7382c80525973c17f3cd810d191b81db
  Making HTTP GET request to
 http://host.domain.lan/api/review-requests/?only-links=createonly-fields=
  Making HTTP POST request to
 http://host.domain.lan/api/review-requests/
  Making HTTP GET request to
 http://host.domain.lan/api/review-requests/4/diffs/?only-fields=
  Making HTTP POST request to
 http://host.domain.lan/api/review-requests/4/diffs/
  Got API Error 105 (HTTP code 400): One or more fields had errors
  Error data: {u'fields': {u'path': [ufatal: Not a git repository:
 'None'\n]}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had
 errors', u'code': 105}}
 REVIEWBOARD_URL = host.domain.lan
 REPOSITORY = foo.git
 Traceback (most recent call last):
   File /usr/local/bin/rbt, line 9, in module
 load_entry_point('RBTools==0.7.4.dev0', 'console_scripts', 'rbt')()
   File /Library/Python/2.6/site-packages/rbtools/commands/main.py, line
 133, in main
 command.run_from_argv([RB_MAIN, command_name] + args)
   File /Library/Python/2.6/site-packages/rbtools/commands/__init__.py,
 line 612, in run_from_argv
 exit_code = self.main(*args) or 0
   File /Library/Python/2.6/site-packages/rbtools/commands/post.py, line
 797, in main
 base_dir=base_dir)
   File /Library/Python/2.6/site-packages/rbtools/commands/post.py, line
 479, in post_request
 raise CommandError(u'\n'.join(error_msg))
 rbtools.commands.CommandError: Error uploading diff


 One or more fields had errors (HTTP 400, API Error 105)

 path: fatal: Not a git repository: 'None'


 Your review request still exists, but the diff is not attached.

 http://host.domain.lan/r/4/

 - Here 

Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2015-08-04 Thread Christian Hammond
Hi,

There's no additional logs for this, as that's basically all the
information we're given. That error is coming straight from Git.

Best way to reproduce for testing is to `sudo -s` to your web server's
user, then attempt to do a `git ls-remotes` on that repository. See if you
get an error.

This does sound like either a permissions issue or SELinux. However, it
could also be that the user can't access some parent directory of the
repository.

Christian

-- 
Christian Hammond - christ...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

On Tue, Aug 4, 2015 at 12:56 PM, udam.dewar...@gmail.com wrote:

 Hi Christian,

 Thank you for the quick response. I'm using local repo due to not having
 the gitweb/cgit etc. I locally cloned the git repository under my home
 directory. The whole repository has read privileges to all users of the
 system (chmod -R ugo+r foo) already.

 However, the error message when I try to save the repository configuration
 is always Permission denied accessing the local Git repository
 '/home/user/foo/.git'

 Are there any log files where I can see specific logs related to the error?

 I've also installed the beta 2.5 version and tried with that but get the
 same error message.

 Thanks again!



 On Tuesday, August 4, 2015 at 12:41:53 PM UTC-7, Christian Hammond wrote:

 Hi,

 Just to check, is this repository local to the Review Board server, or
 remote?

 If local, make sure that your web server's user (usually apache or
 www-data) has read access to everything under the git repository.

 if remote, you're going to need to use a service like
 gitweb/cgit/gitlab/etc, since Git has no support for fine-grained remote
 access to files/commits. We have some docs on how to do this:
 https://www.reviewboard.org/docs/manual/2.0/admin/configuration/repositories/#raw-file-urls

 Christian

 --
 Christian Hammond - chi...@chipx86.com
 Review Board - https://www.reviewboard.org
 Beanbag, Inc. - https://www.beanbaginc.com

 On Tue, Aug 4, 2015 at 10:07 AM, udam.d...@gmail.com wrote:

 Hello,

 I'm trying to set up reviewboard on Fedora linux. I've already disabled
 SELinux due to other issues starting up Reviewboard. Running apache with
 the other recommended settings. Now I have review board setup but cannot
 get my git repository set up (even after trying for a day).

 Here's my issue:
 - I could not get the get repository setup with remote pointing to my
 private github repository.
 - Since then I have setup a local git repo using ssh
 - I've put the local git repo in multiple places (/tmp/foo,
 /home/user/foo etc) yet continue to get the same error in the setup repo
 screen where it says permission denied accessing the local git repository
 - In the mirror path, I specify ssh://g...@git.host.lan/github/foo.git
 - I've tried giving the apache user ownership of the foo directory and
 the .git directory and given ugo+rwx on both of those directories.

 If I specify only the ssh://g...@git.host.lan/github/foo.git as the path
 and leave the mirror path empty OR specify the same for the mirror path, I
 can create the repo but cannot post a review to the repo. It fails with the
 error:

 ~/D/P/foo ❯❯❯ rbt post --debug
  RBTools 0.7.4
  Python 2.6.9 (unknown, Sep  9 2014, 15:05:12)
 [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
  Running on Darwin-14.4.0-x86_64-i386-64bit
  Home = /Users/user
  Current directory = /Users/user/Development/Projects/foo
  Running: git version
  Checking for a Subversion repository...
  Running: svn --non-interactive info
  Command exited with rc 1: ['svn', '--non-interactive', u'info']
 svn: E155007: '/Users/user/Development/Projects/foo' is not a working
 copy
 ---
  Checking for a Git repository...
  Running: git rev-parse --git-dir
  Running: git config core.bare
  Running: git rev-parse --show-toplevel
  Running: git symbolic-ref -q HEAD
  Running: git config --get branch.master.merge
  Running: git config --get branch.master.remote
  Running: git config --get remote.origin.url
  repository info: Path: http://git.domain.lan/host/foo.git, Base
 path: , Supports changesets: False
  Making HTTP GET request to http://host.domain.lan/api/
  Making HTTP GET request to http://host.domain.lan/api/info/
  Running: git rev-parse refs/heads/master
  Running: git merge-base 7811f02d7382c80525973c17f3cd810d191b81db
 origin/master
  Running: git rev-parse 715970e7fa070b836cf00c0af254bee94776dc08
  Running: git status --porcelain --untracked-files=no
  Running: git rev-parse --git-dir
  Running: git -c core.quotepath=false -c diff.noprefix=false diff
 --no-color --full-index --ignore-submodules -M --no-ext-diff
 715970e7fa070b836cf00c0af254bee94776dc08..7811f02d7382c80525973c17f3cd810d191b81db
  Making HTTP GET request to
 http://host.domain.lan/api/review-requests/?only-links=createonly-fields=
  Making HTTP POST request to
 http://host.domain.lan/api/review-requests/
  Making HTTP GET request to
 

Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2015-08-04 Thread udam . dewaraja
Hi Christian,

Thank you for the quick response. I'm using local repo due to not having 
the gitweb/cgit etc. I locally cloned the git repository under my home 
directory. The whole repository has read privileges to all users of the 
system (chmod -R ugo+r foo) already.

However, the error message when I try to save the repository configuration 
is always Permission denied accessing the local Git repository 
'/home/user/foo/.git'

Are there any log files where I can see specific logs related to the error?

I've also installed the beta 2.5 version and tried with that but get the 
same error message.

Thanks again!



On Tuesday, August 4, 2015 at 12:41:53 PM UTC-7, Christian Hammond wrote:

 Hi,

 Just to check, is this repository local to the Review Board server, or 
 remote?

 If local, make sure that your web server's user (usually apache or 
 www-data) has read access to everything under the git repository.

 if remote, you're going to need to use a service like 
 gitweb/cgit/gitlab/etc, since Git has no support for fine-grained remote 
 access to files/commits. We have some docs on how to do this: 
 https://www.reviewboard.org/docs/manual/2.0/admin/configuration/repositories/#raw-file-urls

 Christian

 -- 
 Christian Hammond - chi...@chipx86.com javascript:
 Review Board - https://www.reviewboard.org
 Beanbag, Inc. - https://www.beanbaginc.com

 On Tue, Aug 4, 2015 at 10:07 AM, udam.d...@gmail.com javascript: 
 wrote:

 Hello,

 I'm trying to set up reviewboard on Fedora linux. I've already disabled 
 SELinux due to other issues starting up Reviewboard. Running apache with 
 the other recommended settings. Now I have review board setup but cannot 
 get my git repository set up (even after trying for a day).

 Here's my issue:
 - I could not get the get repository setup with remote pointing to my 
 private github repository.
 - Since then I have setup a local git repo using ssh 
 - I've put the local git repo in multiple places (/tmp/foo, 
 /home/user/foo etc) yet continue to get the same error in the setup repo 
 screen where it says permission denied accessing the local git repository
 - In the mirror path, I specify ssh://g...@git.host.lan/github/foo.git
 - I've tried giving the apache user ownership of the foo directory and 
 the .git directory and given ugo+rwx on both of those directories.

 If I specify only the ssh://g...@git.host.lan/github/foo.git as the path 
 and leave the mirror path empty OR specify the same for the mirror path, I 
 can create the repo but cannot post a review to the repo. It fails with the 
 error:

 ~/D/P/foo ❯❯❯ rbt post --debug
  RBTools 0.7.4
  Python 2.6.9 (unknown, Sep  9 2014, 15:05:12)
 [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
  Running on Darwin-14.4.0-x86_64-i386-64bit
  Home = /Users/user
  Current directory = /Users/user/Development/Projects/foo
  Running: git version
  Checking for a Subversion repository...
  Running: svn --non-interactive info
  Command exited with rc 1: ['svn', '--non-interactive', u'info']
 svn: E155007: '/Users/user/Development/Projects/foo' is not a working copy
 ---
  Checking for a Git repository...
  Running: git rev-parse --git-dir
  Running: git config core.bare
  Running: git rev-parse --show-toplevel
  Running: git symbolic-ref -q HEAD
  Running: git config --get branch.master.merge
  Running: git config --get branch.master.remote
  Running: git config --get remote.origin.url
  repository info: Path: http://git.domain.lan/host/foo.git, Base 
 path: , Supports changesets: False
  Making HTTP GET request to http://host.domain.lan/api/
  Making HTTP GET request to http://host.domain.lan/api/info/
  Running: git rev-parse refs/heads/master
  Running: git merge-base 7811f02d7382c80525973c17f3cd810d191b81db 
 origin/master
  Running: git rev-parse 715970e7fa070b836cf00c0af254bee94776dc08
  Running: git status --porcelain --untracked-files=no
  Running: git rev-parse --git-dir
  Running: git -c core.quotepath=false -c diff.noprefix=false diff 
 --no-color --full-index --ignore-submodules -M --no-ext-diff 
 715970e7fa070b836cf00c0af254bee94776dc08..7811f02d7382c80525973c17f3cd810d191b81db
  Making HTTP GET request to 
 http://host.domain.lan/api/review-requests/?only-links=createonly-fields=
  Making HTTP POST request to 
 http://host.domain.lan/api/review-requests/
  Making HTTP GET request to 
 http://host.domain.lan/api/review-requests/4/diffs/?only-fields=
  Making HTTP POST request to 
 http://host.domain.lan/api/review-requests/4/diffs/
  Got API Error 105 (HTTP code 400): One or more fields had errors
  Error data: {u'fields': {u'path': [ufatal: Not a git repository: 
 'None'\n]}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had 
 errors', u'code': 105}}
 REVIEWBOARD_URL = host.domain.lan
 REPOSITORY = foo.git
 Traceback (most recent call last):
   File /usr/local/bin/rbt, line 9, in module
 load_entry_point('RBTools==0.7.4.dev0', 'console_scripts', 'rbt')()
   File 

Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2015-08-04 Thread udam . dewaraja
Ok yes, that was the problem. 

For anyone thats in this bad situation in the future, the way to figure out 
the issue is as follows:

As Christian mentioned, do: 
sudo -su apache (or user who runs apache)
cd to git repo
git ls-remote

In my case, it was failing to connect via ssh (public key denied)

My solution was to:
create a .ssh directory in the home directory of the user (apache). In my 
case, this was in /usr/share/httpd
in the .ssh directory, i copied over my ssh keys to connect to the git hub 
repo
cloned the repo under the /usr/share/httpd directory

This succeeds if/when the ssh keys are properly set up.

Once this succeeds, you can submit the repository form with the path set to 
the local .ssh path AND the mirror path set to the ssh:// path of your 
repo.

the misleading thing here is the directory might be given all the 
permissions needed but still gives that same error message when the ssh 
public key auth is failing.

One last question: Do we need to manually keep the git repository 
up-to-date? e.g. cron tab?

Thanks again for the help!!
Udam


On Tuesday, August 4, 2015 at 12:59:31 PM UTC-7, Christian Hammond wrote:

 Hi,

 There's no additional logs for this, as that's basically all the 
 information we're given. That error is coming straight from Git.

 Best way to reproduce for testing is to `sudo -s` to your web server's 
 user, then attempt to do a `git ls-remotes` on that repository. See if you 
 get an error.

 This does sound like either a permissions issue or SELinux. However, it 
 could also be that the user can't access some parent directory of the 
 repository.

 Christian

 -- 
 Christian Hammond - chri...@beanbaginc.com javascript:
 Review Board - https://www.reviewboard.org
 Beanbag, Inc. - https://www.beanbaginc.com

 On Tue, Aug 4, 2015 at 12:56 PM, udam.d...@gmail.com javascript: 
 wrote:

 Hi Christian,

 Thank you for the quick response. I'm using local repo due to not having 
 the gitweb/cgit etc. I locally cloned the git repository under my home 
 directory. The whole repository has read privileges to all users of the 
 system (chmod -R ugo+r foo) already.

 However, the error message when I try to save the repository 
 configuration is always Permission denied accessing the local Git 
 repository '/home/user/foo/.git'

 Are there any log files where I can see specific logs related to the 
 error?

 I've also installed the beta 2.5 version and tried with that but get the 
 same error message.

 Thanks again!



 On Tuesday, August 4, 2015 at 12:41:53 PM UTC-7, Christian Hammond wrote:

 Hi,

 Just to check, is this repository local to the Review Board server, or 
 remote?

 If local, make sure that your web server's user (usually apache or 
 www-data) has read access to everything under the git repository.

 if remote, you're going to need to use a service like 
 gitweb/cgit/gitlab/etc, since Git has no support for fine-grained remote 
 access to files/commits. We have some docs on how to do this: 
 https://www.reviewboard.org/docs/manual/2.0/admin/configuration/repositories/#raw-file-urls

 Christian

 -- 
 Christian Hammond - chi...@chipx86.com
 Review Board - https://www.reviewboard.org
 Beanbag, Inc. - https://www.beanbaginc.com

 On Tue, Aug 4, 2015 at 10:07 AM, udam.d...@gmail.com wrote:

 Hello,

 I'm trying to set up reviewboard on Fedora linux. I've already disabled 
 SELinux due to other issues starting up Reviewboard. Running apache with 
 the other recommended settings. Now I have review board setup but cannot 
 get my git repository set up (even after trying for a day).

 Here's my issue:
 - I could not get the get repository setup with remote pointing to my 
 private github repository.
 - Since then I have setup a local git repo using ssh 
 - I've put the local git repo in multiple places (/tmp/foo, 
 /home/user/foo etc) yet continue to get the same error in the setup repo 
 screen where it says permission denied accessing the local git repository
 - In the mirror path, I specify ssh://g...@git.host.lan/github/foo.git
 - I've tried giving the apache user ownership of the foo directory and 
 the .git directory and given ugo+rwx on both of those directories.

 If I specify only the ssh://g...@git.host.lan/github/foo.git as the path 
 and leave the mirror path empty OR specify the same for the mirror path, I 
 can create the repo but cannot post a review to the repo. It fails with 
 the 
 error:

 ~/D/P/foo ❯❯❯ rbt post --debug
  RBTools 0.7.4
  Python 2.6.9 (unknown, Sep  9 2014, 15:05:12)
 [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
  Running on Darwin-14.4.0-x86_64-i386-64bit
  Home = /Users/user
  Current directory = /Users/user/Development/Projects/foo
  Running: git version
  Checking for a Subversion repository...
  Running: svn --non-interactive info
  Command exited with rc 1: ['svn', '--non-interactive', u'info']
 svn: E155007: '/Users/user/Development/Projects/foo' is not a working 
 copy
 ---
  Checking for a Git repository...

Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2014-08-12 Thread julian . jacobson
I have the same problem on Ubuntu 12.04. All the rest works really well, 
but I still get the same error message when trying to add local git 
repositories.
Has anyone managed to do this successfully?

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2014-08-10 Thread julian . jacobson

Hi Stephen,

Thanks for your fast reply.
 

 Be aware that on Fedora, Review Board is running as the 'apache' user. 
 Also, SELinux is often a culprit (but since you mentioned it above, I 
 suspect you already know how to verify that with permissive mode). 


I'm used to having chown-ed all files for the web server by the 'apache' 
user
(even including the git repository in that case).
SELinux doesn't give me any warnings/problems since I adapted the policy 
according to its suggestions. Therefore, I think the problem is (no longer) 
due
to SELinux.

Julian

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Permission denied accessing the local Git repository '/home/user/foo/.git'

2014-08-09 Thread Stephen Gallagher
On 08/09/2014 04:55 PM, julian.jacob...@arcor.de wrote:
 Hello everybody out there using ReviewBoard,
 
 On Fedora 20 with default ReviewBoard RPM packages, installation of
 ReviewBoards works fine.
 I've tried to set appropriate file permissions for my local git
 repository and modified SELinux policies accordingly. Still, when I try
 to add local repositories, I'm getting the error message
 |
 Permissiondenied accessing the localGitrepository '/home/user/foo/.git'
 |

Be aware that on Fedora, Review Board is running as the 'apache' user.
Also, SELinux is often a culprit (but since you mentioned it above, I
suspect you already know how to verify that with permissive mode).


 I've already read that new versions of ReviewBoard will give more
 descriptive error messages, but I would like to keep the current Fedora
 Package.
 Could anybody point me towards additional diagnostics to run in order to
 pin down the problem?
 Accessing remote repositories also doesn't work, probably because my
 ReviewBoard server is behind a firewall:
 |
 Unableto load feed:[Errno111]Connectionrefused
 |
 How can I tell ReviewBoard to use a proxy in this case?
 
 Kind regards,
 Julian
 
 -- 
 Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
 ---
 Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
 ---
 Happy user? Let us know at http://www.reviewboard.org/users/
 ---
 You received this message because you are subscribed to the Google
 Groups reviewboard group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to reviewboard+unsubscr...@googlegroups.com
 mailto:reviewboard+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.