Hello,
I'm trying to use git-lfs-migrate to migrate an internal Subversion repository to Git for use with Atlassian BitBucket 4.11. This repository has a lot of binary files and I'd like to remove them from the git history using git-lfs-migrate. I'm using Windows 7, Java 1.8.0_91, Git LFS 1.5.5, git 2.10.0.windows.1.
In the commands and output below, I've changed the repository name to repo.git, the BitBucket project to 'project', the BitBucket server name to somebitbucketserver.net and the BitBucket IP address to 111.111.111.111 for illustration purposes.
When I issue any of the following commands:
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git --lfs https://somebitbucketserver.net/myproject/repo.git/info/lfs --no-check-certificate --glob-file binaries.txt
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git --lfs https://somebitbucketserver.net --no-check-certificate --glob-file binaries.txt
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git --lfs https://user:[email protected]/myproject/repo.git/info/lfs --no-check-certificate --glob-file binaries.txt
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git --lfs https://user:[email protected] --no-check-certificate --glob-file binaries.txt
I always get this error:
[main] INFO git.lfs.migrate.Main - LFS server: Batch API request exception
org.apache.http.conn.HttpHostConnectException: Connect to somebitbucketserver.net:443 [somebitbucketserver.net/111.111.111.111] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at ru.bozaro.gitlfs.client.internal.HttpClientExecutor.executeMethod(HttpClientExecutor.java:26)
at ru.bozaro.gitlfs.client.Client.doRequest(Client.java:275)
at ru.bozaro.gitlfs.client.Client.lambda$postBatch$7(Client.java:118)
at ru.bozaro.gitlfs.client.Client.doWork(Client.java:252)
at ru.bozaro.gitlfs.client.Client.postBatch(Client.java:118)
at git.lfs.migrate.Main.checkLfsAuthenticate(Main.java:113)
at git.lfs.migrate.Main.main(Main.java:66)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:337)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
... 17 more
[main] ERROR git.lfs.migrate.Main - LFS server: Invalid base URL
I suspect it has something to do with authentication because in order to view the repository via HTTPS in a browser, I have to authenticated using our third-party SSO service. However, repos are fully accessible via SSH. Which led me to try the following in a git bash session after I added my SSH key to ssh-agent:
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git -g ssh://[email protected]:7999/project/repo.git --glob-file binaries.txt --no-check-certificate
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git -g [email protected]:project/repo.git --glob-file binaries.txt --no-check-certificate
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git -g ssh://[email protected]:7999/project/repo.git --glob-file binaries.txt
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git -g [email protected]:project/repo.git --glob-file binaries.txt
These commands always gives this error:
[main] INFO git.lfs.migrate.Main - LFS server: Batch API request exception
java.io.IOException: Command returned with non-zero exit code 255: [ssh, [email protected]:7999, -oBatchMode=yes, -C, git-lfs-authenticate, project/repo.git, upload]
at ru.bozaro.gitlfs.client.auth.ExternalAuthProvider.getAuthUncached(ExternalAuthProvider.java:82)
at ru.bozaro.gitlfs.client.auth.CachedAuthProvider.getAuth(CachedAuthProvider.java:38)
at ru.bozaro.gitlfs.client.Client.doWork(Client.java:248)
at ru.bozaro.gitlfs.client.Client.postBatch(Client.java:118)
at git.lfs.migrate.Main.checkLfsAuthenticate(Main.java:113)
at git.lfs.migrate.Main.main(Main.java:66)
[main] ERROR git.lfs.migrate.Main - LFS server: Invalid base URL
I also tried:
java -jar git-lfs-migrate.jar -s repo.git -d repo.lfs.git --lfs ssh://[email protected]:7999/project/repo.git --glob-file binaries.txt --no-check-certificate
Which errors with:
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {}->ssh://somebitbucketserver.net:7999: ssh protocol is not supported
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->ssh://somebitbucketserver.net:7999
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {}->ssh://somebitbucketserver.net:7999: ssh protocol is not supported
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->ssh://somebitbucketserver.net:7999
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {}->ssh://somebitbucketserver.net:7999: ssh protocol is not supported
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->ssh://somebitbucketserver.net:7999
[main] INFO git.lfs.migrate.Main - LFS server: Batch API request exception
org.apache.http.conn.UnsupportedSchemeException: ssh protocol is not supported
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:108)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at ru.bozaro.gitlfs.client.internal.HttpClientExecutor.executeMethod(HttpClientExecutor.java:26)
at ru.bozaro.gitlfs.client.Client.doRequest(Client.java:275)
at ru.bozaro.gitlfs.client.Client.lambda$postBatch$7(Client.java:118)
at ru.bozaro.gitlfs.client.Client.doWork(Client.java:252)
at ru.bozaro.gitlfs.client.Client.postBatch(Client.java:118)
at git.lfs.migrate.Main.checkLfsAuthenticate(Main.java:113)
at git.lfs.migrate.Main.main(Main.java:66)
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {}->ssh://somebitbucketserver.net:7999: ssh protocol is not supported
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->ssh://somebitbucketserver.net:7999
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {}->ssh://somebitbucketserver.net:7999: ssh protocol is not supported
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->ssh://somebitbucketserver.net:7999
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.conn.UnsupportedSchemeException) caught when processing request to {}->ssh://somebitbucketserver.net:7999: ssh protocol is not supported
Feb 02, 2017 5:22:28 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->ssh://somebitbucketserver.net:7999
[main] ERROR git.lfs.migrate.Main - LFS server: Invalid base URL
Is there some way to get this working other than resorting to filter-branch or cluttering my repo with .gitattributes files from bfg --convert-to-git-lfs?
Thanks,
Mike