Git connection error : HTTP request failed - linux

I've got a problem with git, which I used for years without problem, and which suddenly doesn't work anymore for any operation concerning remote repository (pull, push, clone).
Any of these operations returns :
error: couldn't connect to host while accessing https://me#bitbucket.org/me/myrepo.git/info/refs
fatal: HTTP request failed
I also tried with a repo hosted on github, it's the same.
BUT it works as sudo for example sudo git pull.
It really annoy me since it has always worked perfectly, and since I don't remember doing anything that could affect its behaviour (no system updates, no change of network configuration)
I already had a look to similar questions (this one and this another one) but it didn't help.
My config:
git version 1.7.9.5
Linux Mint 13 Maya
EDIT :
permissions of ~/.ssh and ~/.ssh/*
drwx------ 2 quentin quentin 4096 déc. 7 21:35 .ssh
-rw------- 1 quentin quentin 1766 déc. 7 21:34 id_rsa
-rw-r--r-- 1 quentin quentin 401 déc. 7 21:16 id_rsa.pub
-rw-r--r-- 1 quentin quentin 4968 déc. 7 21:32 known_hosts
EDIT 2:
Here's the result of strace git pull : http://pastebin.com/bAvBac22
Thanks to everyone that have an idea of what is wrong

Related

fatal: repository does not exist when cloning shared repository

I'm trying to create a shared bare repository from an existing project so that multiple developers within the same group can have access. I have cloned the repository located in my project's directory to a bare shared repository in another centralized directory on the same machine and am able to create a clone of bare repo myself, however the clone fails with a fatal: repository does not exist error when logged in as another user within the group.
I've tried following the instructions on the git website for creating a bare repository and for cloning a repository.
https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server
https://git-scm.com/docs/git-clone
Based on the instructions, I used the following commands to create the bare repository and make it shared.
$ git clone --bare /path/to/my_dir/my_project /path/to/repos/project.git
$ cd /path/to/repos/project.git
$ git init --bare --shared
I am able to successfully make a clone using the following commands when I'm logged in as myself.
$ cd /path/to/their_dir
$ git clone /path/to/repos/project.git their_project
However, when logged in as a different user, the following error occurs when trying to use the same commands, even though I can do an ls on and cd into the project.git directory as the other user.
fatal: repository '/path/to/repos/project.git' does not exist
As far as permissions go, my account is listed as the owner of the repository and it's files, and the other user belongs to the group that is associated with the files.
$ ls -l /path/to/repos
drwxrws---. 6 me devs 4096 Jul 24 12:53 project.git
$ ls -l /path/to/repos/project.git
drwx------. 2 me devs 4096 Jul 24 12:46 branches
-rw-rw----. 1 me devs 177 Jul 24 12:53 config
-rw-------. 1 me devs 73 Jul 24 12:46 description
-rw-------. 1 me devs 23 Jul 24 12:46 HEAD
drwx------. 2 me devs 4096 Jul 24 12:52 hooks
drwx------. 2 me devs 4096 Jul 24 12:46 info
drwx------. 104 me devs 4096 Jul 24 12:46 objects
-rw-------. 1 me devs 98 Jul 24 12:46 packed-refs
drwxrws---. 4 me devs 4096 Jul 24 12:46 refs
How can I fix this so that another user can clone the repository while logged in under his or her account?

Jenkins build from git repository in Dropbox

I have a main Git bare repository in my Dropbox folder and I'm using a headless Debian server which runs Jenkins to build my projects.
Until now I've been using this approach to build my projects: I created a bare git repository on my headless server and configured the Jenkins job to pull the sources from this repository with the following URL: /var/cache/git/project. So when I want Jenkins to build my changes, I have to push them to this repository. This works fine, but it's not very convenient because I have to manually push to two repositories (Dropbox and Debian) and also when I want to add a new project, I need to create a new repository on the Debian server.
So I decided to configure the Jenkins jobs to pull directly from the Dropbox repositories. I've set up Dropbox on my Debian server at /home/jardo/Dropbox.
But when I try to configure the Jenkins job to pull drom URL /home/jardo/Dropbox/git/project.git, I get the following error:
Failed to connect to repository : Command "git ls-remote -h /home/jardo/Dropbox/git/project.git HEAD" returned status code 128:
stdout:
stderr: fatal: '/home/jardo/Dropbox/git/project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
How come Jenkins is able to clone from /var/cache/git/project, but not from my Dropbox folder? Dropbox is completely synced and the repository content looks ok. I've set permissions on the whole repository recursively to 777 and that didn't help.
Here is the output of ls -l on my Dropbox repository:
-rwxrwxrwx 1 jardo jardo 104 Dec 15 21:10 config
-rwxrwxrwx 1 jardo jardo 73 Dec 15 21:10 description
-rwxrwxrwx 1 jardo jardo 23 Dec 15 21:10 HEAD
drwxrwxrwx 2 jardo jardo 4096 Dec 24 13:16 hooks
drwxrwxrwx 2 jardo jardo 4096 Dec 24 13:01 info
drwxrwxrwx 150 jardo jardo 4096 Dec 24 13:01 objects
drwxrwxrwx 4 jardo jardo 4096 Dec 24 12:59 refs
It turned out that user Jenkins could not access the GIT repository, which was owned by user Jardo, even when I tried to set its permissions recursively to 777. The solution was to setup Dropbox also for user Jenkins.

Redmine installation

i have been fighting for many years to install Redmine on Debian/Wheezy.
I followed the following tutorial: enter link description here.
But when I restart my Apache server, the redmine web page only displays the list of the files of the Remdine directory.
Could you please help to solve this problem?
Thank you
EDIT:
I am making progress... Phusion Passenger was not installed, so I did it.
But, I still have another error which is displayed when I connect to my Redmine web page:
Permission denied - /etc/redmine/default/database.yml (Errno::EACCES)
/usr/lib/ruby/vendor_ruby/rails/application/configuration.rb:115:in `read'
/usr/lib/ruby/vendor_ruby/rails/application/configuration.rb:115:in `database_configuration'
/usr/lib/ruby/vendor_ruby/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>'
The permissions are the following ones:
-rw-r--r-- 1 www-data www-data 112 août 8 18:11 database.yml
-rw-r--r-- 1 www-data www-data 911 août 8 18:11 session.yml
I finally successed to install and run Redmine.
The permission on the database.yml file was correct but not on the parent directory.
Now it works.

CentOS and fontconfig: Cannot load default config file

I'm getting following error when using imagick:
Fontconfig error: Cannot load default config file
My script is working but i would like to fix this (is filling up log file).
OS is:
# cat /etc/redhat-release
CentOS release 5.10 (Final)
I was looking trough internet little bit and this is causing problem:
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
Folder exists:
# ls /etc/fonts/ -all
total 64
drwxr-xr-x 4 root root 4096 Jul 9 2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x 2 root root 4096 Jan 3 2012 conf.avail/
drwxr-xr-x 2 root root 4096 Apr 14 2013 conf.d/
-rw-r--r-- 1 root root 5239 Jan 12 2008 fonts.conf
-rw-r--r-- 1 root root 6907 Jan 12 2008 fonts.dtd
But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.
Account under with script is run is created with WHM.
Please help :)
I manage to solve my problem. chroot was making trouble.
I need to:
log with root account
find jailed environment of account on with i run script (in my case /home/virtfs/[username])
to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts
Posting an answer for CentOS 7 in 2021:
yum install fontconfig
More info here:
https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

svn permission issue - txn-current-lock: Permission denied

I setup svn on my local system /svn/repos/myproject by following this tutorial. I'm able to view the repo in browser.
But when it try to import new project I couldn't through svn client ( rapid svn ) it shows following error:
Execute: Import
Error while performing action:
Can't open file '/svn/repos/myproject/db/txn-current-lock': Permission denied
Svn directory permissions:
→ ls -l /svn
total 12
drwxrwxr-x 2 root root 4096 Feb 15 12:09 permissions
drwxrwxr-x 4 apache apache 4096 Feb 15 12:09 repos
drwxrwxr-x 2 root root 4096 Feb 15 12:09 users
Repo directory:
→ ls -l
total 8
drwxrwxr-x 3 root root 4096 Feb 15 12:09 conf
drwxrwxr-x 7 apache apache 4096 Feb 15 12:09 myproject
How to solve this issue?
I've given 777 permission to repos directory which solved this issue. But i got another issue like Couldn't perform atomic initialization.
I think this is due to incompatible sqlite version with subversion we're using, this can be solved by updating svnadmin command,
svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/repos/myproject

Resources