LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2012, 09:04 PM   #1
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Rep: Reputation: 38
Cannot pull or push to Git repository as normal user


I am encountering a problem on Arch where I cannot pull or push a Git repository to the Internet.

I receive this error when I push and pull my repository

Code:
error: couldn't connect to host while accessing http://github.com/Nashoba-Robotics/Nashoba-Robotics2012/info/refs
fatal: HTTP request failed
However, when I do this as root, it works perfectly. I also experience this problem when pulling from the kernel Git repository.

Has anybody else experienced this problem?

Alex Brinister
 
Old 10-15-2012, 07:44 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
What does
Code:
git remote -v
give you? My urls have '.git' on the end... And how does this compare to the same command run as root?
 
Old 10-15-2012, 05:39 PM   #3
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Original Poster
Rep: Reputation: 38
I don't think Git cares about the .git at the end if using HTTP/S. Adding it to the end in the repository config file doesn't change anything.

Running git remote -v gives me

Code:
origin	http://github.com/Nashoba-Robotics/Nashoba-Robotics2012.git (fetch)
origin	http://github.com/Nashoba-Robotics/Nashoba-Robotics2012.git (push)
I get the same thing as root.

Thanks for your reply!

Alex Brinister
 
Old 10-15-2012, 08:40 PM   #4
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Original Poster
Rep: Reputation: 38
I might also add that I get a

Code:
curl: (7) couldn't connect to host
every time I try to 'makepkg' as a normal user. I have to

Code:
sudo makepkg --asroot
to get it to download the appropriate archives.

Alex Brinister
 
Old 10-16-2012, 06:36 AM   #5
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Hm... That sounds odd. Can you use curl to grab e.g. google.com ? I never have to run makepkg as root (as it's generally a bad idea), so it may well be a deeper problem (i.e. not git)...
 
Old 10-17-2012, 06:29 PM   #6
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Original Poster
Rep: Reputation: 38
Yes, I don't run makepkg as root on my other Arch sytems. But with this one I have to.

When I try

Code:
curl google.com
It gives me

Code:
curl: (7) couldn't connect to host
Alex Brinister
 
Old 10-18-2012, 07:20 AM   #7
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Right, there's your problem: curl isn't working.

Does

Code:
ping www.google.com
work?

What about visiting google.com in your browser? Do you have a proxy set up that curl doesn't know about, or a firewall that could be blocking the connection? And what about

Code:
telnet www.google.com 80
?
 
Old 10-18-2012, 10:14 PM   #8
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
it works for root
it dose not work for user
this is a permissions problem
common problem on low level distros
(you do the configuration by hand distros)
like arch gentoo and slackware

check the permissions on git make sure it is set for execute by others
is your user a member of group netdev?
don't know how git works but if it sends commands to your NIC user needs to be a member of group netdev
or run it from su

it is considered by some blasphemy but go ahead and run it as root
be warned you can destroy your system as root

Last edited by rob.rice; 10-18-2012 at 10:37 PM.
 
Old 10-19-2012, 02:49 AM   #9
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Quote:
Originally Posted by rob.rice View Post
check the permissions on git make sure it is set for execute by others
is your user a member of group netdev?
We have already established that the problem is wider than git: curl seems to be affected, causing the git errors. However, your comment on permissions would be a good one, except for the fact that curl is obviously running: curl itself produces an error, not the shell saying "permission denied"

Quote:
or run it from su

it is considered by some blasphemy but go ahead and run it as root
be warned you can destroy your system as root
Yep, blasphemy. For the reason you stated, pretty much! And if your default solution is "Run it as root" you neither understand why the problem is occurring, nor learn anything about Linux, nor make your system any securer.

Regards,
 
Old 10-22-2012, 05:44 PM   #10
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Original Poster
Rep: Reputation: 38
There is no group netdev on Arch. There is a network group which I am already a member of.

The problem also occurs when I run makepkg as root when logged through su. Strangely, it works fine when I run it with sudo.

So this does not work:

Code:
su -

makepkg --asroot

curl: (7) couldn't connect to host
But this works

Code:
su -

sudo makepkg --asroot
I don't use any proxys or anything like that. I can access things from my browser and I am able to ping.

Alex Brinister
 
Old 10-25-2012, 07:16 AM   #11
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Hm. Okay, how about running:

Code:
sudo curl www.duckduckgo.com --trace-ascii trace_file_sudo
and

Code:
curl www.duckduckgo.com --trace-ascii trace_file_normal
and comparing the two files.

(also, I would be interested in seeing the output of

Code:
$ su -
$ groups
$ sudo groups
)

Last edited by Snark1994; 10-25-2012 at 07:18 AM.
 
Old 10-25-2012, 05:52 PM   #12
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Original Poster
Rep: Reputation: 38
I get a normal connection as sudo but when I run as normal user, this is what is in the trace file:

Quote:
== Info: About to connect() to proxy 127.0.0.1 port 9050 (#0)
== Info: Trying 127.0.0.1...
== Info: Connection refused
== Info: couldn't connect to host
== Info: Closing connection #0
It is attempting to connect to Tor, which I do have set up but not running.

Alex Brinister
 
Old 10-26-2012, 02:47 AM   #13
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Aha! Tor is, in fact, a proxy server that runs on your local machine. So yes, there's your problem. Root isn't configured to use tor, but you are. So either you'll have to start tor, or change the config so curl doesn't use tor, or do something clever so that it only connects to tor if tor is running...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] git push in a git-init without --bare option? xeon123 Linux - Newbie 1 06-27-2011 03:44 AM
git push origin doesn't update the remote repository immediately mohtasham1983 Linux - Server 1 07-15-2009 01:07 PM
Setup up a Push/Pull type applications MikeyCarter Linux - Server 3 07-31-2007 12:43 PM
An easy way to push and pull files reitzell Linux - Newbie 2 04-27-2005 09:32 PM
backup: push or pull? nielchiano Linux - General 3 02-05-2004 05:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration