0

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

Community
  • 1
  • 1
Quentin
  • 1,085
  • 1
  • 11
  • 29
  • Evidently, something did change... Something crazy to try: move your `~/.gitconfig` to `~/.gitconfig.bak` and try again. This will rule out config change as cause. – janos Dec 07 '13 at 20:40
  • What are the permissions on `~/.ssh` and `~/.ssh/*` and any relevant `.gitconfig`s? If you executed a git command with `sudo` which modified one of these you may no longer be allowed to read them which might cause a failure like this. – asm Dec 07 '13 at 22:32
  • @janos : yes I tried, didn't solve the problem. I also tried `apt-get purge git` and reinstall with `apt-get install git` but still doesn't help – Quentin Dec 08 '13 at 14:32
  • @AndrewMyers: I added the permissions on these files in my post, but I seems ok to me – Quentin Dec 08 '13 at 14:38
  • I wonder if the problem lies in your `root` user having the correct SSH settings. Please compare your ~/.ssh/* with /.ssh/* and see if you find anything useful. – Yam Marcovic Dec 08 '13 at 14:39
  • @YamMarcovic : you mean between `~/.ssh/*` and `/root/.ssh/*` ? I checked but didn't see anything suspect, there is only `known_hosts` in `/root/.ssh`, same permissions as `~/.ssh/known_hosts`. I tried to concatenate the content of `/root/.ssh/known_hosts` to `~/.ssh/known_hosts` but it doesn't change anything – Quentin Dec 08 '13 at 16:04
  • At this point I would `strace` the command and post the `tail` of it in your post. Let me know when it's edited. – Yam Marcovic Dec 08 '13 at 16:07
  • Also, see [this answer](http://stackoverflow.com/questions/8644947/git-http-request-failed). – Yam Marcovic Dec 08 '13 at 16:09
  • I had already tried [the proposed solution](http://stackoverflow.com/questions/8644947/git-http-request-failed) but it didn't help. Note that I'm not behind a proxy. I edited my post with the infos you requested, however not sure if I put enough of it? – Quentin Dec 08 '13 at 16:28
  • @Quentin Can you post a bit more of the tail or just post the entire thing in a pastebin? – asm Dec 09 '13 at 16:24
  • 1
    Just done ;). Also I'm not sure if it is relevant, but it still works with ssh, just https doesn't work anymore. – Quentin Dec 09 '13 at 21:35
  • Are there any differences between `sudo env |grep LANG` and `env |grep LANG`? Any other differences in environment? – asm Dec 10 '13 at 17:16
  • `sudo env|grep LANG` gives `LANG=fr_FR.UTF-8` `LANGUAGE=fr:en`, and `env|grep LANG`. Here are some user environment variables concerning proxy and ssh which are not defined in root environment : `NO_PROXY=localhost,127.0.0.0/8` `SSH_AUTH_SOCK=/tmp/keyring-rPDBti/ssh` `ALL_PROXY=socks://localhost:19920/` `all_proxy=socks://localhost:19920/` `no_proxy=localhost,127.0.0.0/8`. I posted the whole env for root and user here : http://pastebin.com/5chJ7MWd – Quentin Dec 10 '13 at 20:05

0 Answers0