bozaro / git-lfs-migrate

Simple project for convert old repository for using git-lfs feature
MIT License
222 stars 29 forks source link

Exception in thread "main" java.io.FileNotFoundException: https://GHUser:GHPassword@github.com/objects #2

Closed CPlusPlus17 closed 9 years ago

CPlusPlus17 commented 9 years ago

Hello Again!

I'm currently struggling with the LFS-URL if LFS from github is used.

I tried different URLs but it seems I didn't got it right:

-l https://yyy:xxx@github.com/QuantumBytesinc/ROAC.git/info/lfs
-l https://yyy:xxx@github.com/QuantumBytesinc/ROAC/
-l https://yyy:xxx@github.com/QuantumBytesinc/
-l https://yyy:xxx@github.com

The stacktrace is:

Uploading 610fbe75bf02eef89f776aabd2508d581fbdc5057d21a80476d0f0189269eab0, size: 640 to: /QuantumBytesinc/ROAC.git/info/objects
Exception in thread "main" java.io.FileNotFoundException: https://yyy:xxx@github.com/QuantumBytesinc/ROAC.git/info/objects
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1889)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1884)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1883)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1456)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at git.lfs.migrate.GitConverter.upload(GitConverter.java:263)
    at git.lfs.migrate.GitConverter.lambda$convertLFS$2(GitConverter.java:206)
    at git.lfs.migrate.GitConverter$$Lambda$3/867398280.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convertLFS(GitConverter.java:188)
    at git.lfs.migrate.GitConverter.convertTree(GitConverter.java:151)
    at git.lfs.migrate.GitConverter.lambda$convert$0(GitConverter.java:70)
    at git.lfs.migrate.GitConverter$$Lambda$1/494586676.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convert(GitConverter.java:60)
    at git.lfs.migrate.GitConverter.convertTree(GitConverter.java:153)
    at git.lfs.migrate.GitConverter.lambda$convert$0(GitConverter.java:70)
    at git.lfs.migrate.GitConverter$$Lambda$1/494586676.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convert(GitConverter.java:60)
    at git.lfs.migrate.GitConverter.convertTree(GitConverter.java:153)
    at git.lfs.migrate.GitConverter.lambda$convert$0(GitConverter.java:70)
    at git.lfs.migrate.GitConverter$$Lambda$1/494586676.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convert(GitConverter.java:60)
    at git.lfs.migrate.GitConverter.convertTree(GitConverter.java:153)
    at git.lfs.migrate.GitConverter.lambda$convert$0(GitConverter.java:70)
    at git.lfs.migrate.GitConverter$$Lambda$1/494586676.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convert(GitConverter.java:60)
    at git.lfs.migrate.GitConverter.convertTree(GitConverter.java:153)
    at git.lfs.migrate.GitConverter.lambda$convert$0(GitConverter.java:70)
    at git.lfs.migrate.GitConverter$$Lambda$1/494586676.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convert(GitConverter.java:60)
    at git.lfs.migrate.GitConverter.convertTree(GitConverter.java:153)
    at git.lfs.migrate.GitConverter.lambda$convertTreeRoot$1(GitConverter.java:130)
    at git.lfs.migrate.GitConverter$$Lambda$2/322836221.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convertTreeRoot(GitConverter.java:128)
    at git.lfs.migrate.GitConverter.convertCommit(GitConverter.java:116)
    at git.lfs.migrate.GitConverter.lambda$convert$0(GitConverter.java:67)
    at git.lfs.migrate.GitConverter$$Lambda$1/494586676.apply(Unknown Source)
    at java.util.HashMap.computeIfAbsent(HashMap.java:1118)
    at git.lfs.migrate.GitConverter.convert(GitConverter.java:60)
    at git.lfs.migrate.Main.processRepository(Main.java:112)
    at git.lfs.migrate.Main.main(Main.java:89)
Caused by: java.io.FileNotFoundException: https://yyy:xxx@github.com/QuantumBytesinc/ROAC.git/info/objects
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1835)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at git.lfs.migrate.GitConverter.upload(GitConverter.java:256)
    ... 41 more

Thanks a lot for help!

bozaro commented 9 years ago

In my case url looks like:

https://bozaro:*****@api.github.com/lfs/bozaro/git-lfs-migrate

You can get correct URL by command like:

ssh git@github.com git-lfs-authenticate bozaro/git-lfs-migrate upload
CPlusPlus17 commented 9 years ago

Thanks you, this worked.

A site node, the URL must end with / else it's not working:

Wrong:
https://xxx:yyy@api.github.com/lfs/QuantumBytesInc/ROAC
Tries to access: api.github.com/QuantumBytesinc/objects

Right:
https://xxx:yyy@api.github.com/lfs/QuantumBytesInc/ROAC/
Tries to access: api.github.com/QuantumBytesinc/ROAC/objects

I would suggest to add a slash after the LFS-URL if not there.

bozaro commented 9 years ago

I add slash after URL (729f8daafacee0bd038caf8af0bec1d101361648), but not bump new build yet.