Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt new ssh invalid private key #548

Open
chepk opened this issue May 4, 2021 · 6 comments
Open

sbt new ssh invalid private key #548

chepk opened this issue May 4, 2021 · 6 comments

Comments

@chepk
Copy link

chepk commented May 4, 2021

steps

$ sbt -version
sbt version in this project: 1.5.1
sbt script version: 1.5.1

problem

Can't create project from private Gitlab repository using ssh.

  • ssh connection succeed
ssh -p 7999 -T [email protected]
Welcome to GitLab, @chepk!
  • git clone ssh://.. execution succeed
git clone ssh://[email protected]:7999/performance/gatling-template.g8.git
  • sbt new https://... execution succeed
sbt new https://my-gitlab.com:7999/performance/gatling-template.g8.git
  • sbt new ssh://... execution crashes with invalid privatekey message
sbt new ssh://[email protected]:7999/performance/gatling-template.g8.git
stack trace
$ sbt new ssh://[email protected]:7999/performance/gatling-template.g8.git
[info] welcome to sbt 1.5.1 (N/A Java 15.0.2)
[info] loading project definition from /Users/chepk/work/temp/project
[info] set current project to temp (in build file:/Users/chepk/work/temp/)
[info] set current project to temp (in build file:/Users/chepk/work/temp/)

ssh://[email protected]:7999/performance/gatling-template.g8.git : invalid privatekey: [B@718f3088

The private key was generated using ssh-keygen -t rsa

expectation

Project is created successfully using sbt new ssh://..

notes

@TonioGela
Copy link
Member

Have you tested it with bare g8? I'm asking just to understand if it is sbt or g8 related

@chepk
Copy link
Author

chepk commented Jun 18, 2021

Have you tested it with bare g8? I'm asking just to understand if it is sbt or g8 related

No, only with sbt

@TonioGela
Copy link
Member

TonioGela commented Jun 18, 2021

Okay, can you test it with the g8 version of this branch?
The first comment should contain the instructions to build it locally, but I can help you out if you need it. It should fix authentication errors by simply reading the .ssh/conf file and using it to pick the correct ssh key.

@TonioGela
Copy link
Member

Just in case, the instructions are these:

checkout repo and publish local dependency

git clone https://github.com/TonioGela/giter8.git
cd giter8
git checkout SSH_FIX
sbt publishLocal

install Coursier

curl -fLo cs https://git.io/coursier-cli-"$(uname | tr LD ld)"
chmod +x cs
./cs install cs
rm cs

or install Coursier on Windows (using cmd.exe, not PowerShell)

bitsadmin /transfer cs-cli https://git.io/coursier-cli-windows-exe "%cd%\cs.exe"
.\cs --help

and then install locally the fixed version of giter8

cs bootstrap org.foundweekends.giter8:giter8-launcher_2.12:0.13.1-SNAPSHOT --main giter8.LauncherMain -f -o <custom-g8-path>

then you can run the custom version of g8 using the executable that you find at <custom-g8-path> like ./<custom-g8-path> or .\<custom-g8-path>.exe if you are on windows.

I hope that ./<custom-g8-path> ssh://[email protected]:7999/performance/gatling-template.g8.git won't cause the private key error

@TonioGela
Copy link
Member

@chepk version 0.14.0 should have solved the issue. Can you check?

@chepk
Copy link
Author

chepk commented Feb 17, 2022

Sorry, I missed your comments. Asked colleagues to check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants