fatal: unable to look up user#example.com:port during git clone? - windows

I'm trying to access a source code from a Windows 7 host using Git 2.23.0.windows.1. I have to use a Windows host and git:// protocol. Linux and other protocols are not allowed.
The error is:
$ git clone git://johndoe#source.example.com:22480/main
Cloning into 'main'...
fatal: unable to look up johndoe#source.example.com (port 22480)
(A non-recoverable error occurred during a database lookup. )
I'm finding hits for similar problems, like Cloning git repository Failure (fixed by switching to https://) and How to fix "fatal :unable to look up https (port 9418) (push problem). But I have not found my specific problem.
I believe git://johndoe#source.example.com:22480/main is well formed according to the git pull (1) man page. See the section Git Urls.
If I am parsing the error message correctly, it looks like Git is not separating the user from the url, port and protocol. That is, "unable to look up johndoe#source.example.com (port 22480)" should be "unable to look up source.example.com (port 22480)" (without the user part).
What is the problem and how do I fix it?
~/.gitconfig is pretty boring at the moment:
[user]
email = john.doe#example.com
name = John Doe
[winUpdater]
recentlySeenVersion = 2.23.0.windows.1
The only interesting thing is, the email address uses a dot john.doe#example.com, while the user in the url does not johndoe#source.example.com:22480. This is how the system is setup.

https://git-scm.com/docs/git-pull
The native transport (i.e. git:// URL) does no authentication…
I.e. the URL should be git://source.example.com:22480/main. Or switch to a different protocol that does authentication. Try ssh://johndoe#source.example.com:22480/main or https://johndoe#source.example.com:22480/main.

Related

Trouble connecting to Git server (bitbucket.org) via Win 10 Git Bash

I had to restart my machine but things were working before hand. I was using Git Bash with SSH and hoses on Win 10 to connect to BitBucket which was fine.
I then had to also connect with Git Bash (another instance) to GitHub. This required Putty and Pagent to get setup.
No I try to connect to BitBucket and get this:
git pull origin mybranch
FATAL ERROR: No supported authentication methods available (server sent: publickey)
fatal: Could not read from remote repository.
Is there a simple way to have both working in different shells?
I tried to do a plink.exe to bitbucket.org but that made things worse.
Is there a simple way to have both working in different shells?
Yes. You can use any single method (from both) for connecting to HG|BB. Just select preferred way (ssh + ssh-agent OR pageant) and perform needed steps according to relevant docs

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.

Eclipse ADT known hosts

I have trouble getting the official Windows ADT 21.1.0 distribution to connect to a git repository. No matter what I tried(details below) it complains about host key not present in the registry and shows me no option to accept the host key. The remote server is running Gitlab and is under my control. There's no problem with connectivity or firewalls.
What I tried so far:
connecting without giving a password, with user git
connecting while giving a password, with another user
adding manually the host key in the known_hosts file that is found in the ssh home directory(Preferences->General->Network Connections->SSH2->SSH2 home).
The message is always:
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 xx:xx:xx...
Connection abandoned.
RSE works without any problems, only egit gives me problems.
You could workaround the problem by not using the ssh protocol with the git server, but instead the git or http protocol.
One reason for the above message can be using a folder called "ssh" instead of ".ssh" (note the dot). Some colleague of mine experienced that, and this can easily happen when using Windows explorer, as it will silently remove the dot, when creating a folder called ".ssh". You have to use the command line instead.

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 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