gitolite error after adding a repo in the goitolite.conf - gitolite

I am getting below error while trying to push gitolite-admin repo after adding a repo name in gitolite.conf.
Below is the error.
Cloning works fine and I have already pushed some of the pub keys to the repo.
open conf/gitolite.conf-compiled.pm.new failed: Permission denied<<newline>>
system() failed,gitolite compile,-> 6400
Whereas cloning and pushing works fine for testing repo.
Gitolite user is gitolite3 and apache user writes to it and the protocol which am using is http.
Not sure where exactly it is failing. Help is much appreciated.

Related

hg-ssh - cannot clone repository, but pull/push works

I am trying to setup a new mercurial server (first time for me), serving with hg-ssh and am running into the problem that I can pull and push, but not clone a repository to the server.
In .ssh/authorized_keys on the server, I have the following line before the key:
no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command=".../hg-ssh
repos/*"
Without this line, cloning the repository works, so it's not a path issue.
I am somewhat baffled by this, because I would have expected hg-ssh to allow for cloning - am I wrong in assuming this?
Is there some config I might have missed?
I was unable to determine from the documentation whether hg-ssh should allow cloning to the server.
What I have done is change the line
command=".../hg-ssh repos/*"
to
command="[path]/allowed-commands.sh
and implemented the script following https://serverfault.com/a/803873, redirecting all 'hg init' calls to hg directly, while redirecting all pull/push requests to hg-ssh.
This works fine for pull/push and clone.

GitHub SSH access not working

I have created a new user on github under our organization which will be used for auto deployment. I followed the article on https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-linux.
Somehow, when I tried to clone the repository to the server, it worked once. The code was running properly, and I exit the server. Today, we released an update to the code, and I wanted to deploy the code manually to the server, so I ssh'd into the server and tried to pull the repository with git pull. It gave me Permission denied error. After some debugging I realized that the ssh-agent wasn't running. So I executed the following commands:
eval "$(ssh-agent -s)"
ssh-add .ssh/id_rsa_staging
Now, when I try ssh -T git#github.com, I see the welcome message which is:
Hi *****! You've successfully authenticated, but GitHub does not provide shell access.
But when I try to pull from the repository, I am continuously getting this error message:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I checked the repository and the user has read access to it. I double checked if the keys match on github and server, yes they do. I tried generating new keys. I tried using ssh/config file. Nothing helped...
I appreciate any help & suggestions!
Update:
So I figured out that git clone command is working properly, but even when I try git pull right after git clone, it is giving the error.
If you are using sudo to git pull/push to the remote you need to ensure you used sudo to generate your SSH keys. Otherwise you will not be using the same keys that you originally generated.
github doc for reference
I had the exact same issue.
For me what worked was
Go to repo on github which you have cloned and wanna pull with
Under the code-download option copy SSH link
Enter following command in your terminal -->
git remote set-url origin paste_SSH_link

git push failes with "access denied" error on gitlab 7

When I try to push (from an existing repo) to a new repository on a freshly installed Gitlab CE instance I get an error:
Access Denied.
fatal: The remote end hung up unexpectedly
Strange thing is that pushing actually works for the first repository I created. The second repository gives this error.
I installed Gitlab (gitlab_7.3.2-omnibus-1_amd64.deb) on a fresh DigitalOcean instance (1GB ram) on Debian 7 x64.
An ssh -vT git#[domain] command gives ok: Welcome to GitLab, Ruurd Adema!
Any ideas of what's going on?
Edit: when tying to clone the second (empty) repo I get this error:
fatal: '/var/opt/gitlab/git-data/repositories/ruurdadema/encoder.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Checking the repositories folder tells me that the repository isn't there, but the wiki of the project is indeed there.
Edit: I found this error in the log of omnibus 7.4.2:
E, [2014-10-24T21:09:32.502741 #11717] ERROR -- : API call <POST http://127.0.0.1:8080/api/v3/internal/allowed> failed: 500 => <{"message"=>"500 Internal Server Error"}>.
Make sure you don't have the same public key registered twice (on two different projects).
The issue 6908 mentions:
I had two identical keys on two different projects, but added them separately, it worked before but all of a sudden I get the 'access denied' on git pull.
I tried to delete both keys but the key was not removed from authorized_keys file, so I removed the line manually and added the deploy key again.
Now I added one key and on the second project I just enabled the existing key.
Maybe this is not a bug anymore but I in my opinion the authorized_keys file should be cleaned more carefully.

Only one user can push/pull to github

I have two CentOS servers that are set up the same. I created a git repo on server A and pushed it to github. I then cloned the repo on server B. At first, all seemed to be in order. I could commit on either server, push to the remote, and the pull on to the other server.
The problem is that my co-workers now cannot push or pull on server B (they can run git status or commit). Strangely, this applies to ALL repos on server B, not just the one I cloned. Here is the error they see:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I checked that they are in the collaborators lists (both as owners and on the team assigned to the repo).
I also tried changing to the root user and cloning the repo again--as root I received the same error as above. The global .gitconfig does not reference my user or key, and the local .git/config files are set to use SSH (git#github.com).
What would cause this error to happen all users but one? Where else should I be looking?
Add '-v' to your git command as you run it to get more verbose output, that should tell you what's wrong.
I did resolve this issue. I found the problem by running ssh -T -vvv git#github.com which showed different keys being used for my user vs. the other users on the server. The key being used generally was not tied to a user in our github account. The fix:
Generated a new SSH key
Added key to shared user on github account
Updated .ssh/config to use the new key when accessing github.com
I am not certain how the SSH key got messed up, because it worked before. But this fixed it.

Installing git repository on Oracle Enterprise Linux 5 -- SSH problems

I have been banging my head against a wall for a while now, and none of the people in my immediate vicinity know more than I do at this point.
My office has a lab box that they want to use for a central git repository -- mainly for testing various things. They also, of course, want me to get some experience setting up git so that we can possibly set up other git instances later.
I am running Windows 7 with an OEL 5.7 VM, and the box is running OEL 5.5. From my VM, I SSHed into the lab box and started tinkering. After installing git and gitosis, I have managed to get the instance working locally. I can see the git repository just fine, and if I try to clone it locally, it all works like a dream. But if I try to SSH in from my VM, it either A.) kicks me out with fatal: 'testproject.git' does not appear to be a git repository or B.) kicks me out with Permission denied (publickey,gssapi-with-mic), depending on how I invoke git.
Example: I configured the access to a test project I created (and tested locally) as follows:
[group team]
writable = testproject
members = oracle#RCSDB cwerness cwerness#localhost cwerness#localhost.localdomain
This is my first experience setting up a git repository, so I wanted to cover my bases regarding remote users. Thus, the redundancy in the members section.
When I try to clone the repository with my username only, I get
[cwerness#localhost Desktop]$ git clone cwerness#10.1.1.10:testproject.git
Cloning into testproject...
Enter passphrase for key '/home/cwerness/.ssh/id_rsa':
fatal: 'testproject.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
If, however, I try to clone the repository with more information, I get
[cwerness#localhost Desktop]$ git clone "cwerness#localhost.localdomain"#10.1.1.10:testproject.git
Cloning into testproject...
Permission denied (publickey,gssapi-with-mic).
fatal: The remote end hung up unexpectedly
I have all the public keys stored in the /keydir folders. The repository was created and is owned by the user oracle, and I have tried all permutations of that user and its domain in the above clone commands as well, to no effect. Additionally, I tried setting up a ~/.ssh/config file like this
Host labbox
Hostname 10.1.1.10
User cwerness
IdentityFile /home/cwerness/.ssh/id_rsa
Again, I tried all the different ways to connect, from both users. Nothing is giving me any more information than I already had.
The box is set up to authenticate SSH connections via public keys, and that works fine. I can SSH into the box as cwerness with no problems.
This is getting to be a huge headache for me, and I'd like it if someone could tell me exactly HOW I am being stupid, if not a way to fix this problem.
git clone cwerness#10.1.1.10:testproject.git will look in the home directory for the user cwerness but you state you put the repository in /home/oracle/repositories. Try git clone cwerness#10.1.1.10:/home/oracle/repositories/testproject.git.

Resources