Connection Refused - proxy

I'm getting the following error when I type git clone --recursive https://github.com/projectname:
fatal: unable to access 'https://github.com/projectname': Failed to connect to 127.0.0.1 port 1080 after 2057 ms: Connection refused
I've been searching for the solution but I haven't find yet.
I also cloned repository with SSH key but while downloading the submodules I get the same message.

Check first your environment variables, looking for any HTTP_PROXY/HTTPS_PROXY.
For instance, at work, I have mine set to 127.0.0.1:3128, because I use an intermediate local proxy px, in order to avoid entering my credentials whenever I need to use the company proxy.

Related

Cannot access Gitlab repo from browser or from terminal

I cannot access Gitlab from the browser.
I am getting the following message:
This site can’t be reached
gitlab.com took too long to respond.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_TIMED_OUT
I am not able to use git pull origin master and git push -u origin master from the terminal.
It is showing the following error message:
**fatal: unable to access "https://gitlab.com/myproject.git/" : OpenSSL SSL_connect: SS_ERROR_SYSCALL in connection to gitlab.com:443**
Help me to fix the isssue,
Thanks.
Check your DNS settings, can you reach other sites? This doesn't seem to be a gitlab specific problem.
Also, your remote URL seems quite weird. It's usually gitlab.com/user/repo.git
Try other sites, do they work?
Try acquiring the IP Address from gitlab using an online whois service. Does opening this IP work?
Adjust your origin:
git remote rm origin
git remote add origin "https://username#gitlab.com/username/password.git"
Try this and report back if something worked.

Any available solution for Mac Air : ssh githup operation timed out?

I've searched and tried kinds of solution before I ask this question, but obviously it doesn't work. That may be a common problem of Mac Air:
And the problem is that when I tried to establish new repo for git and type:
git remote add origin https://githup.com/username/reponame.git
git push -u origin master
I got this error:
fatal : unable to access 'https://githup.com/....': failed to connect to githup.com443; Operation timed out.
If I use git like this:
git remote add origin git#githup.com:username/repo.git
git push -u origin master
I got these:
ssh: connect to host githup.com port 22: Operation timed out
fatal: Could not read from remote repository.
I just begin to doubt that ssh service of Mac Air may be not available.
Any useful solution ?
Thanks very much in advance!!!
Have you tried https://github.com instead of https://githup.com.
I guess that is the error.

Cannot clone git repo from ubuntu server with TortoiseGit

I'm facing some problems while git clone a repo from my ubuntu server running gitolite.
First, I got a public key from the developer who wants to clone the repository from the server. It was a rsa key created with putty. So I did the following to parse it from the putty-style to openssh format with:
ssh-keygen -i -f /tmp/ssh2/YourName.pub > /tmp/openssh/YourName.pub (taken from http://gitolite.googlecode.com/git/doc/ssh-troubleshooting.mkd?r=d3a663d03f1027f909732d55d0519bdd84edb62c)
and uploaded the public key along with a new entry for the repo and the new user in the config file to gitolite-admin repo.
So far, so good.
The developer is using **** along with putty to connect to the server, which is running git on a non-standard port and he keeps on getting the same error over and over again:
Cloning into 'D:\path\to\dirctory'...
error: Recv failure: Connection was reset while accessing http://sub.domain.com/info/refs
fatal: HTTP request failed
git did not exit cleanly (exit code 128)
Could anyone give me some advice about this issue?
EDIT:
In the meantime, we managed to git clone the repository by addressing it with the ssh:// protocol instead of git://, so it doesn't seem like it is a problem of the rsa_public.key or something like that.
The iptables on the server are accepting connections through the port for git, but it keeps on giving the above mentioned error.
The OP herom initially commented that the developer used git://git#remote.server.com:port/repo.git as an address.
I asked if there was any firewall issue, preventing the use of the git port (9418), but the OP mentioned:
no, there shouldn't be a firewall issue as iptables is accepting traffic for the git port - the port is forwarded and appears to be another port when connecting from outside...
Now, the developer cloned the repo through ssh:// (and even connecting to the ssh-port!)
I note that the git port can sometime be blocked, as illustrated in this thread.
If not on the client side, maybe on the server side.

Git and http_proxy (SparkleShare on windows and http_proxy)

I've just successfully built SparkleShare for windows according to guide:
https://github.com/wimh/SparkleShare/wiki
and exported my ssh public key to a server.
The problem is that I can't connect from a client behind a http_proxy to a public server with ssh running on a custom port. I had also problem with cloning any git server. I need to switch git:// protocol to http:// one. Any suggestion? Does anyone have similar experience?
This is a log file:
15:25:13 [SSH] ssh-agent started, PID=4380 Identity added:
C:\Users\MYUSER\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key
(C:\Users\sg0922706\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key)
15:25:34 [Fetcher][C:\Users\MYUSER\Documents\SparkleShare.tmp\share]
Fetchin g folder: ssh://MYGITUSER#MYHOST/MYPATH 15:25:34 [Fetcher]
Disabled host key checking MYHOST 15:25:34 [Cmd] git clone --progress
"ssh://MYGITUSER#MYHOST/MYPATH" "C:\Us
ers\MYUSER\Documents\SparkleShare.tmp\share" 15:25:37 [Git] Exit code
128 15:25:37 [Fetcher] Failed 15:25:37 [Fetcher] Enabled host key
checking for MYHOST
To get SparkleShare to use your proxy you will need to modify the config of the msysgit that is installed as part of SparkleShare. Navigate to C:\Program Files (x86)\SparkleShare\msysgit\etc and edit the gitconfig file in notepad and add the following line under the [http] tag
proxy = http://user:pass#proxyurl:port
modifying the url as required to match your settings. You can then use the "On my own server" option to add the http url of your repository.
I have a work around on this particular problem. I guess that you already successfully connected to your server via a simple SSH client (i.e. PuTTY)? With PuTTY you can easily configure an ssh connection via any kind of proxy (such as HTTP, SOCKS, Telnet, ..)
What you can do now is to specify a local "tunnel" (an SSH port forwarding rule) like this: L22 127.0.01:22 (see attachment). If you are using a ssh command line add the following option: -L 22:127.0.01:22.
So now as soon as your terminal is open and running you'll be able to reach your git server via the server url: ssh://git#127.0.0.1.
If your local port 22 is busy you can define the tunnet on a other port. i.e. if the 44 is not occupied: L44 127.0.0.1:22. The url to use in SparkleShare become ssh://git#127.0.0.1:44.
But it's a work around. I'm looking for a better solution.

Git ssh connection refused with the following format

Whenever I use the following
url = ssh://user#dev.example.com:imageInfo.git
in .git/config for a remote repo I get the following error
ssh: connect to host port 22: Connection refused
fatal: The remote end hung up unexpectedly
but if use the following
ssh user#dev.example.com
outside of git I connect without a problem.
Git also connects to same server with a gitosis user using
url = gitosis#dev.example.com:imageInfo.git
in .git/config and it has not problems.
so to sum things up in short my .git/config file looks like this
[remote "production"]
url = ssh://user#dev.example.com:imageInfo.git
url = gitosis#dev.example.com:imageInfo.git
any ideas?
You have the format of the SSH URL wrong - you can either use the scp-style syntax, like:
user#dev.example.com:imageInfo.git
... or the true URL form, where you need a / after the host rather than a :, and an absolute path, which I can only guess at, e.g.:
ssh://user#dev.example.com/srv/git/imageInfo.git
The documentation for git's URLs is here, but kernel.org is down at the moment, so you may want to look at the cached version here.
I got this message due to not having sshd daemon installed and running. So I did 'sudo apt-get install ssh' and the issue was solved.

Resources