nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

Problem connection to password protected SVN repo #59

Open markstickley opened 12 years ago

markstickley commented 12 years ago

Hi,

I'm trying to convert an SVN repo to git. The SVN repo sits on my home server which I have aliased in my hosts file to svnserver. When I run this command:

svn://svnserver/qkschool.org.uk -v --username markstickley

it just sits there showing only the following output:

Running command: git svn init --prefix=svn/ --username=markstickley --no-metadata --trunk=trunk --tags=tags --branches=branches svn://svnserver/qkschool.org.uk
Initialized empty Git repository in /Users/markstickley/workspace/qkschool.org.uk/.git/
Authentication realm: <svn://svnserver:3690> 2d1a41b5-b418-457c-9cb5-d753d313de4d

I left it along for hours in case it was doing something. Nada. When I press ctrl+c I get this, if it's any help:

/Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/lib/svn2git/migration.rb:295:in `each': Interrupt
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/lib/svn2git/migration.rb:295:in `block in run_command'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/lib/svn2git/migration.rb:294:in `popen'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/lib/svn2git/migration.rb:294:in `run_command'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/lib/svn2git/migration.rb:178:in `clone!'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/lib/svn2git/migration.rb:27:in `run!'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/gems/svn2git-2.2.1/bin/svn2git:26:in `<top (required)>'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/bin/svn2git:23:in `load'
    from /Users/markstickley/.rvm/gems/ruby-1.9.2-p320/bin/svn2git:23:in `<main>'

Thanks!

MZAWeb commented 12 years ago

Exactly the same issue here

steveswinsburg commented 12 years ago

Same issue here. How do we provide the password for the SVN repo?

steveswinsburg commented 12 years ago

I managed to get this working by running it in verbose mode -v and then when it prompts for the Authentication realm, entering my password. However I needed to enter it twice, as it appears to ignore the first one.

silvansky commented 12 years ago

It's not clear that you should enter your password in such situation, some promt would be great (in non-verbose mode).

kentnguyen commented 12 years ago

Same issue here, I didn't see anything and left i for hours and accidentally hit Enter then I knew it is waiting for password

riverock commented 12 years ago

I had the same issue with svn2git appearing to be hung up. Did not realize it was waiting for a password until I found this thread. Once I entered my svn password (several prompts), then svn2git worked correctly and created a git repo for me.

robj commented 12 years ago

same problem here... !

dshoreman commented 12 years ago

Same issue here, though I'd say the problem is probably an underlying one. Rather than having problems with auth it seems svn2git is failing to pass through prompts of any kind until it is too late - regardless of whether those prompts are asking for usernames/passwords, or adding exceptions for untrusted SSL certificate authorities.

In the case of passwords you have to guess what it's asking for (assuming --verbose), then you're prompted for what you just entered after the fact. When you're dealing with an SVN provider that uses different credentials for the repo and their apache auth, this gets very confusing.

guileen commented 12 years ago

same issue here

llbbl commented 12 years ago

same issue here. I can't seem to get it to accept the password after it silently prompts for it. Just going to make the repo public while I do the import.

rcio commented 12 years ago

silvansky is right.

It's actually waiting for your password.

AdamIsrael commented 12 years ago

Same issue. At the very least, the readme could be updated with the -v workaround.

nirvdrum commented 12 years ago

I was hoping someone that needed this would supply a patch. I'm really not sure if this ever worked or not. We just delegate to git-svn, so the underlying program may have changed. Passing through STDIN would probably make the most sense, if someone wanted to pull that together.

vbossica commented 12 years ago

I may have found a workaround:

btjones commented 12 years ago

I got this to work with steveswinsburg's suggestion of running in verbose mode (-v) and entering my password (twice!) after the Authentication realm displayed twice.

pajtai commented 12 years ago

@btjones - THANK YOU!

michaelsharman commented 12 years ago

Same as a few others, ran in verbose mode (-v) and entered password twice even though you get no prompt to do so.

stevenkling commented 12 years ago

yeah, that's super unfriendly. if not for this thread I would be lost.

YesThatAllen commented 12 years ago

I'm going to guess @btjones was logged in to his computer with an account which matched his repo's username

I was logged into an account called ahancock, but the repo's username was watchman

the second password request I got was being applied to the username ahancock and hence was failing.

Creating a user called "watchman" then logging in as it, allowed me to get svn2git working

Futher, I found that my password (which had two ! in a row) was being interpreted, thereby running the last command ( !! )in the middle of the operation, ha!

francisreyes commented 12 years ago

Yep this continues to be a problem. Spent over an hour trying to figure out what was wrong.

andrwj commented 11 years ago

It is waiting for password from STDIN, you can solve this by piping or redirecting.

e.g: svn2git http://URL/repository --username someone < ../password.txt

echo -n 'password' | svn2git http://URL/repository --username someone

shiroamada commented 11 years ago

@andrwj, can you show more clear about your example. I don't get your echo -n 'password' | svn2git http://URL/repository --username someone

Thanks!

When I did svn2git with password protected repo, it shows command failed: 2>&1 git svn init --prefix=svn/ --no-metadata --trunk=svn://192.168.1.1/svn/example

andrwj commented 11 years ago

sure, it really rather simple.

  1. make a file containing the password to connect protected repository, name it 'password.txt' on somewhere ( in this example, parent folder).
  2. supply your password by redirecting (this is what I did):

svn2git svn://url-to-subversion-server/repo --username your-id < ../password.txt

When I was struggling with converting, I just came up with this trick. It works for me. Then, I realized that something (subversion?) requires a password for connecting protected repository, waiting user input from STDIN.
I guess it will work when you feed the password through pipeline.

glaslos commented 11 years ago

Add --username your_user. Hit Return. Then type in your password. Return again. Works (for me, no locally stored password) svn2git's password dialog is just missing...

neraath commented 11 years ago

Also the same issue here. The resolution proposed by @steveswinsburg does temporarily fix the issue for me.

FeeJai commented 11 years ago

Just created a pull request that addresses this issue. Meanwhile you can use my version at: https://github.com/FeeJai/svn2git

chrisdembia commented 10 years ago

Hey all:

When I use the echo -n 'password' | trick, I get the following error:

...
Running command: git svn fetch 
Authentication realm: <https://simtk.org:443> Subversion Repository
Password for 'chrisdembia': 
Authentication realm: <https://simtk.org:443> Subversion Repository
Username: error: git-svn died of signal 11
command failed:
2>&1 git svn fetch

Is anyone else getting this?

glaslos commented 10 years ago

Does this help: http://stackoverflow.com/questions/14272634/error-git-credential-osxkeychain-died-of-signal-11 Can you provide some more details? Try git svn pull in the new directory...

nirvdrum commented 10 years ago

Can you guys try with the 2.3.0 release? It now passes STDIN through underlying git-svn process, which should allow you to respond to any password prompts.

maybeec commented 10 years ago

The problem is still there... Env: Gnome-Terminal Ubuntu 14.04 SVN over https (password protected)

nk9 commented 10 years ago

Wanted to report that I'm still seeing this on 2.3.2 running OS X 10.9. I have gotten it working using @steveswinsburg's double-entry trick.

nirvdrum commented 10 years ago

What form of authentication are you guys using? HTTP Basic?

nk9 commented 10 years ago

I'm sorry to say that I'm not sure. Is there a straightforward way to find that out?

benhocker commented 10 years ago

I'm experiencing this issue and here are my SVN httpd configs. Hopefully that helps.

<Location /example> DAV svn SVNPath /svnroot/repos/example AuthType Basic AuthBasicProvider ldap AuthzLDAPAuthoritative Off AuthLDAPURL ldap://server.example.com:389/ou=People,dc=example,dc=com AuthLDAPBindDN uid=testuser,ou=People,dc=example,dc=com AuthLDAPBindPassword mypass AuthzSVNAccessFile /svnroot/access/example.conf Require valid-user

nirvdrum commented 10 years ago

Thank you for that. Out of curiosity, are you using a non-English language locale when you run svn2git?

benhocker commented 10 years ago

I'm using English.

JesseKPhillips commented 9 years ago

When it asked for my password 4 times, I answered it 4 times. It finally worked. Maybe the way it is interacting with SVN it is asked for the password multiple times, maybe how many times it asks depends on the security of your SVN server.

MilkyWayJoe commented 8 years ago

I'm having this issue at the moment. It only asks the password once. When I hit return nothing happens. It just sits there until i command c

ghost commented 8 years ago

The way it worked for me was either first pressing Enter, then username, then enter, enter, then password. Or something like that. Finally I've given up and made sure my SVN password is saved/remembered BEFORE running svn2git. Easiest done by random svn checkout from nearby svn path. Not a fix, but a workaround.

andersondsouzaatcrimsoni commented 8 years ago

I have same issue as MilkyWayJoe. It asks for password and nothing happens even after entering it and pressing enter. it just sits there.

VirtuoUK commented 8 years ago

Same issue, prompts for password but does nothing after pressing enter, none of the above workarounds do anything for me.

Ishan1987 commented 6 years ago

@markstickley I faced the same issue while running "svn2git svn-url --metadata". It was asking to enter certification type but was not proceeding further post adding input P or t. So to resolve this issue, i had checked out svn repo manually using svn co svn-url that gave me a prompt to enter cert type ( P, T or R). I added p and it started checking out svn repo code in my local working directory. Then i ran svn2git svn-url --metadata in separate directory and found prior steps resolved my cert issue. Good luck.

jvitorinoj commented 6 years ago

Workaround: First run
git svn init --prefix=svn/ --username='user' --no-metadata --no-minimize-url --trunk='trunk' --tags='tags' --branches='branches' http://svnserver/projectA This will ask for login and password. Then run svn2git (no need for password this time)

desbest commented 6 years ago

There is a fork of svn2git called svn2gitnet that solves this issue that is a complete rewrite. It works on windows, mac and linux. Find out about svn2gitnet here