palominolabs / gradle-git-clone-task

Gradle task to clone a git repo
Other
25 stars 3 forks source link

com.jcraft.jsch.JschException: invalid privatekey: [B@428571 #10

Open SJrX opened 5 years ago

SJrX commented 5 years ago
Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@77799695
        at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
        at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
        at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
        at com.jcraft.jsch.JSch.addIdentity(JSch.java:406)
        at com.jcraft.jsch.JSch.addIdentity(JSch.java:366)
        at com.jcraft.jsch.JSch$addIdentity.call(Unknown Source)
        at com.palominolabs.gradle.task.git.clone.SshAgentSshSessionFactory.getSession(SshAgentSshSessionFactory.groovy:55)
        at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
        at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
        at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1111)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:76)
        at java_util_concurrent_Callable$call.call(Unknown Source)
        at com.palominolabs.gradle.task.git.clone.GitCloneTask.setUpRepo(GitCloneTask.groovy:102)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        ... 86 more

Maybe Jsch should be updated?

SJrX commented 5 years ago

A work around is here: https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch

marshallpierce commented 5 years ago

Thanks for the report; I'll look into it.

marshallpierce commented 4 years ago

It seems like in the case where the text header is different we could hypothetically fix that on the fly, but for key types jsch doesn't support I'm not sure what we can do.