Gitlab was unable to access your Gitolite system - github

I installed GitLab on Ubuntu server 12.
I followed this steps: http://blog.compunet.co.za/gitlab-installation-on-ubuntu-server-12-04/
Everything seems to be right... but when I try to create a new project, I get the error message:
Gitlab was unable to access your Gitolite system.
I ran the diagnostic tool ("bundle exec rake gitlab:app:status RAILS_ENV=production")
(in /home/gitlab/gitlab) Starting diagnostic
config/database.yml.............exists
config/gitlab.yml.............exists
/home/git/repositories/...........exists
/home/git/repositories/ is writable?........YES
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (8/8), done.
Receiving objects: 100% (12/12), 1.12KiB, done.
Resolving deltas: 100% (1/1), done.
remote:Total 12 (delta 1), reused 0 (delta 0)
Can clone gitolite-admin?..............YES
UMASK for .gitolite.rc is 0007?............YES
/home/git/share/gitolite/hooks/common/post-receive exists?............YES
Finished
The log on admin area only shows:
ERROR -> /home/gitlab/gitlab/tmp/gitlabhq-gitolite-1348050652/gitolite
The config/gitlab.yml file is ok.
The permissions on repositories are just like the tutorial (section 3 - permissions).
I even tried to remove the lock...
What would you advise to troubleshoot this?

If it helps, I had a very similar situation happen, except in my gitlab log I had the following error:
ERROR -> Pull error -> unable to clone gitolite-admin repo
I had compared the commit of the gitolite fork metioned, and found that the changes there were already in place in my version of gitlab.
I ended up stopping the gitlab related services, deleting the contents of the gitlab tmp directory, then restarted the gitlab related services.
Afterwards, everything appeared to be working fine.

If the issue comes from permission regex fixed in this commit of this gitolite fork, you can have a look at "GitHub Tip: download commits as patches":
Your commit can be downloaded by adding a .patch at the end of its url: patch.
That way, you can apply it to your current gitolite source (without even using git itself, just by using the patch command)

I was able to resolve this issue on my server by following the installation instructions section titled "Disable StrictHostKeyChecking for localhost and your domain" and adding a new section for my gitolite host, which was set to the IP address of the server rather than localhost. Open:
/etc/ssh/ssh_config
And add the lines:
Host [gitolite hostname/IP here]
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
(replace the bracketed part with the appropriate hostname/IP)
It's already in the setup steps, but I had skipped it earlier because I didn't understand what it was suggesting. Otherwise, the SSH client tries to show the yes/no prompt to accept a new hostname and the Ruby backend interprets that as a failure to connect to gitolite.

Related

Concourse: resource script '/opt/resource/check []' failed: exit status 128

Environment:
OS: Ubuntu 18.04
Concourse: 3.14.0
Server is behind proxy. Concourse installation is binary, non-docker. Proxy has been setup in /etc/environment as:
> http_proxy="http://proxy01.localnet.local:8080/"
> https_proxy="http://proxy01.localnet.local:8080/"
In that server, I can successfully access outside:
$ git clone https://github.com/pivotal-cf/pcf-pipelines
Cloning into 'pcf-pipelines'...
remote: Counting objects: 20990, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 20990 (delta 13), reused 22 (delta 8), pack-reused 20953
Receiving objects: 100% (20990/20990), 25.70 MiB | 8.46 MiB/s, done.
Resolving deltas: 100% (11497/11497), done.
Error:
resource script '/opt/resource/check []' failed: exit status 128
stderr:
Cloning into '/tmp/git-resource-repo-cache'...
ssh: connect to host github.com port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
That's it. I can't find anything that can lead me to troubleshoot the environment.
Any feedback is greatly appreciated!!
Not knowing your git resource's source config, I bet that you're missing the private_key field there. With SSH urls, you always have to authenticate with a private key -- no such thing as anonymous git access. Anonymous access does exist over HTTPS, though, so that's why it fixed the problem.
Answering my own question: In pipelines.yml file I had to modify github URL and change it from
uri: git#github.com:pivotal-cf/pcf-pipelines.git
To this:
uri: https://github.com/pivotal-cf/pcf-pipelines
After that, it started working.
Recently I encountered this error with a 4XX error code. Turns out it was docker. An engineer had made their fork of a docker image public, so when our docker image was tagged no credentials were being supplied to the build and we were handed a 4XX error with this cryptic useless error message.
If you've recently edited a concourse pipeline with a dockerfile and are seeing this message, check the username and password are supplied and valid (can use docker login from cli or login at https://hub.docker.com. A short-term fix can be to make the image public, but a longer-term fix is to provide credentials to fetch a private image.

Unable to push to github, Remote end hung up unexpectedly

I'm trying to upload a relatively large Unreal engine 4 project through sourcecontrol on Github.
It uploads completely, and when it reaches 100% it fails giving me this error:
Writing objects: 100% (8901/8901), 11.30 GiB | 33.67 MiB/s
Writing objects: 100% (8901/8901), 11.32 GiB | 31.25 MiB/s, done.
Total 8901 (delta 632), reused 8579 (delta 403)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; curl 56 Send failure: Connection was reset
Everything up-to-date
(The error was parsed as 4: The remote disconnected. Check your Internet connection and try again.)
My connection is fine, because I tried it several times, and it always fails at 100%.
I tried it with Sourcetree and Github Desktop, and it produces the same error.
Check first if this is a client setting issue:
git config http.postBuffer 524288000
(and you can increase that setting since Git 2.13)
Also make sure to not exceed a GitHub size limit.
Had this issue recently, when I was using the HTTPs url of the repo for push, later switched to SSH and it works like expected. My Repo size was 500MB and using SSH fixed it for me.
Setting up SSH keys if you don't have one
create the SSH Key:
ssh-keygen -t rsa -b 4096 -C "github_registered_mail_id#xyz.com"
copy the key(everything) from the created public key file usually present in ".ssh/id_rsa.pub"
logon to github and add the public key under
settings->SSH_and_GPG_Keys->new_key
after adding the public SSH Key into Github, test the SSH connection using
ssh -vT git#github.com
Once you have your SSH ready.
Setup upstream(push) remote URL which will be SSH url of the repo instead of usual HTTPS url.
git remote add <remote-name> git#github.com:username/repo_name
Set your branches to use the new upstream url
git push --set-upstream <remote-name> <branch_name>
Push the large repository as usual
git push <remote-name> <branch_name>

cloning github through SSH auth with multiple accounts freezes

I've created and set up multiple ssh keys for authenticating with multiple github accounts. After successfully tried it out by means of ssh -Tcommand, I tried to clone a repo, but this freezes unexpectedly:
MacBook-Pro-di-Matteo:.ssh matteo$ ssh -T git#github.com-bertamini.matteo
Hi bertuz-gist! You've successfully authenticated, but GitHub does not provide shell access.
MacBook-Pro-di-Matteo:.ssh matteo$ git clone git#github.com-bertamini.matteo:bertuz/bertuzFox.git tst
Cloning into 'tst'...
remote: Counting objects: 253, done.
remote: Compressing objects: 100% (12/12), done.
I can't figure out if it is my fault or a temporary github glitch. Any help?
As illustrated by "Git fetch/pull/clone hangs on receiving objects", that kind of issue is generally caused by:
the remote side having an issue (but GitHub status history doesn't show any issue)
the network (middle or client side)
the ssh config, if ssh url are used (ServerAliveInterval 60)
The OP Bertuz confirms in the comments the reason is the second one (network):
The wifi I was using used to block git connections.
Now everything works smoothly. Shall I delete the question?

Could not read from remote repository

I have received the following error multiple times:
Could not read remote repository. Please make sure you have the correct access rights and the repository exists.
I am very confused about how to remedy this error.
Make sure you are using the correct SSH keys/usernames on both your GitHub account and your local machine. Here's how you can
do that on GitHub
Also, you might consider using an alternative Git manager. I've never heard of Aptana, but I do know that GitHub has an awesome GUI program for managing your repositories.
In the future, this is all much easier and more streamlined on Linux/Unix operating systems like Ubuntu. Ubuntu is geared towards developers and has things like Git and SSH installed correctly by default.
I had the exact same issue with a private repo.
Cloning through the same error both through https and ssh
Then I made a commit through github (simply updated the README.md with an empty line)
Surprisingly enough, this resolved the issue. It would be nice to know why though!
I had the same problem - it was caused by me using the SSH key instead of the HTTPS URL. I created my repository by importing a project via Intellij and it must have pushed via HTTPS.
Assuming you have done the proper SSH keys configuration according to github's instructions it might be a problem of pull with https and later pushing with git+ssh
to make it more clear
if you have used https to pull
git pull https://github.com/user/repo.git
then you have changed remote URL
git remote set-url origin git+ssh://github.com/user/repo.git
and tried to push after some changes and commits
git push origin master
you might get this error it happened to me
erase the local repository and re-clone using git+ssh
git pull git+ssh://github.com/user/repo.git
and now your push should work
ssh-add -A resolved my issue in MacOS Sierra 10.12.6.
I had no problem both for public and private repo before.
Today I tried to clone or git pull for private repo, but it hit the above issues.
After search around, this is the perfect solution for me.
On Windows open file:
C:\Users\<USER_NAME>\.ssh\config
You should have your host defined in the "config" file:
host gitlab.com
HostName gitlab.com
IdentityFile ~/.ssh/id_rsa_user_private_key
host bitbucket.org
HostName bitbucket.org
IdentityFile ~/.ssh/id_rsa_user_private_key
host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa_user_private_key
Try these 3 Simple Steps:
It's pretty straight forward. See the 3 step summary of the links below.
Check for the existence of SSH keys. If one exists, then great: you can use it. If not, then you will have to create one.
You will need to add the ssh key to the ssh-agent. If the agent is snoozing on the job, then you will need to wake the agent by writing this to your console/terminal: eval $(ssh-agent -s). Then you can simply add the key,
Try pushing your repository. Hopefully it should work.
I had same issue on my private Ubuntu server using ssh.
My workaround solution was:
open shell on my private server
git init --bare /path/<myapp>.git
and then, from my developer laptop
git push <remote_repo> <local branch>
has finally worked well.
PS:
I've never tried, but remote repo with https seems working better than ssh.
I hope this help.
In addition to setting the identity files in the ssh config, I also had to set the git remote to the right user - complete solution in https://www.keybits.net/post/automatically-use-correct-ssh-key-for-remote-git-repo/
vi ~/.ssh/config
Host github.com-myuser
HostName github.com
User git
IdentityFile ~/.ssh/mykey
I made sure I had this identity file loaded with ssh-add -l
ssh-add -l
4096 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX mykey (RSA)
Then I set my remote to include the right user
git remote set-url origin git#github.com-myuser:myuser/myrepo.git
Then the push worked
git push -u origin master
Enumerating objects: 146, done.
Counting objects: 100% (146/146), done.
Delta compression using up to 4 threads
Compressing objects: 100% (144/144), done.
Writing objects: 100% (146/146), 9.71 MiB | 7.48 MiB/s, done.
Total 146 (delta 10), reused 0 (delta 0)
remote: Resolving deltas: 100% (10/10), done.
To git#github.com-myuser:myuser/myrepo.git
* [new branch] master -> master
Voila
If you have updated you OSX recently you have to call ssh-add -A. Have a look at this answer: https://apple.stackexchange.com/questions/254468/macos-sierra-doesn-t-seem-to-remember-ssh-keys-between-reboots
Installing a root/CA Certificate
Given a CA certificate file foo.crt, follow these steps to install it on Ubuntu:
Create a directory for extra CA certificates in /usr/share/ca-certificates:
sudo mkdir /usr/share/ca-certificates/extra
Copy the CA .crt file to this directory:
sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt
Let Ubuntu add the .crt file's path relative to /usr/share/ca-certificates to /etc/ca-certificates.conf:
sudo dpkg-reconfigure ca-certificates
This is an old post, but this is they only thing that I found that worked.
I also had the exact same error and for some reason restarting my pc solved the error. Maybe it works for somone else too :P
If it's a public repo, just clone using https. No need to use passwords or setup SSH keys.
if you want to push/pull any repository from local to remote(git hub)
first checkout
$ git push https://<git-hub url>
working fine with username and passwd credential
$ git push git#<git-hub url>
fail
Could not read remote repository. Please make sure you have the correct access rights and the repository exists.
this means you need to add id_rsa.pub to authorized_keys
goto
$ cd /home/admin/.ssh
$ls
$vi authorized_keys
add id_rsa keys(n no of keys you can add)
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA0KJDLOiiXj9XdMxiCT9KvaKfuxFQi+CIiklaN5hHsNgYOu7TijqyONEu5fONLoAo/cshLa+KuargyTrtizwcP4TPcTXZhhJrM0GUDJragw7SMVIs/5xJBGAyHKJ1YUMGO7+nJTmsCLx6PFOlQYveuriiVVCCZerGCLH+UtSXK3z+l7hx9NiDg3/ylOLc3f3SLxrJKn0gMTgK7BHJFXo4PguuPjWZLVdUDX+XKiqtT2n4IsYs6N9qVFG3zUgNlEjZM47NK/ytAC0max98pK+QNzsuaQOo/IShJ1TOw5wwScflPArVJ2AyROqAe7cfQg7q12I9olASFd3U5NazfZCTYAvWA1kz9UZEWLJ1Br1XOkPqOleMM8KCp/PXzz8H0kISkMIji0/QuiZOPEBsKlszXjlALcXR8Mg1uiZVWy48i9JheyXyj1ToCj6cPScpgFHp3DAGSlKKbE1EFaVfeeyGAnHESlnDDg3Gq5xSsB9Okqm3V5t8GpFaJbV68BxQ4BK6HJ21A3CinV4LdV3hR/OBUbDG2EcI+ZKRDjlpJuu4YU= stace#pretend-machine
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAywWhrwq4FjHt+UuwZcZePxtjtZOENFpOjufycaYso2nTlzNwnAQEQRfbqsUxKVtOtGxgApIkUvjRIjNBdJE6iOzvBXZhhJrM0GUDJragw7SMVIs/5xJBGAyHKJ1YUMGO7+nJTmsCLx6PFOlQYveuriiVVCCZerGCLH+UtSXK3z+l7hx9NiDg3/ylOLc3f3SLxrJKn0gMTgK7BHJFXo4PguuPjWZLVdUDX+XKiqtT2n4IsYs6N9qVFG3zUgNlEjZM47NK/ytAC0max98pK+QNzsuaQOo/IShJ1TOw5wwScflPArVJ2AyROqAe7cfQg7q12I9olASFd3U5NazfZCTYAvWA1kz9UZEWLJ1Br1XOkPqOleMM8KCp/PXzz8H0kISkMIji0/QuiZOPEBsKlszXjlALcXR8Mg1uiZVWy48i9JheyXyj1ToCj6cPScpgFHp3DAGSlKKbE1EFaVfeeyGAnHESuXC9wkSeFZCEyMJ+RgJxMkBXNZmyycbwsSqAeGJpMEUDlwzu2GD0obBz0HXqg9J1Xallop5AVDKfeszZcc= stace#another-machine
:wq!
goto github-->settings--->ssh---->add new key---->id_rsa.pub
$git push git#<git-hub url>
I had the same issue with Pycharm on Ubuntu the solution is to use https instead of SSH
for example :
https://github.com/Bedo1212/myrepo.git
If you're using SSH, make sure you're using a network that allows SSH. Most public networks allow only HTTP(S) traffic.
Hi my problem was that my client did not ask if I recognized the key. Opening a terminal and doing ssh -T git#github.com worked. The response in the terminal asked if I wanted to add the key, I said yes and after that, my client worked fine
I had a similar issue, Until I realized, I was running my machine through a proxy address for my internet connection and it happens to close the host connection. This could be one of the few reasons too.
For me, I had followed all the steps mentioned in Adding new ssh key and rest of the auxiliary links related to this issue.
But the issue was network access. Solution - using VPN to access my Github Enterprise. (in my case Georgia Tech VPN for github.gatech.edu)
In my case, I generated new key pairs but forgot to update public key in github.com (settings).
A simple solution to this is delete the old ssh key from github/gitlab and add the same key again. This is easy work around and you have to hussle with anything

Receiving Error Code: 255 when pushing to Mercurial repo from Eclipse Plugin

I am using HgEclipse from here: http://www.javaforge.com/project/HGE
I have created a new repository on my server to test the plugin. I cloned the repository, added some files, committed and attempted to push but received the following error message...
abort: HTTP Error 500: Internal Server Error. Command line:
/home/james/workspace/project:hg -y push http://***#[repository location],
error code: 255
From some Googling I can find that the 255 error is to do with Authentication, but the password is correct, otherwise I wouldn't be able to clone in the first place.
Any help or suggestions would be much appreciated.
Thanks
EDIT:
After updating my system to the latest versions I am now also getting this from the command line when pushing (which was previously working):
abort: HTTP Error 500: Permission denied: .hg/store/data/path-to-file.i
Your webserver can't write into the repository. You can either
change the permissions in the local repo so that the webserver get write permissions there (which means you need to set up write permissions with chmod for all files and directories under (and including) .hg, also you need to set the sticky-bit to all directories)
give the webserver an own repo, which is owned by the server.
Giving the web serve a repo of its own looks like this:
$ sudo bash
# mkdir /srv/repo-base
# chown www-data /srv/repo-base
# cd /srv/repo-base
# su -c "hg clone /path/to/current/repo web-repo-name" www-data
# vi /etc/apache2/sites-available/$SITE_CONFIG_FILE # change the repo path to /srv/repo-base/web-repo-name
# /etc/init.d/apache2 reload
A drawback of this method is that you need to push via http even on the machine with the webserver, since as a normal user you don't have write permissions to the webserver repo.
This answered it for me, although it's a different system set-up: TortoiseHg.
In the Repository Settings -> Server, I set Allow Push to *
This was on a private network so secured behind a firewall.