-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Exception running application com.neuronrobotics.bowlerstudio.BowlerStudio (and UnknownHostKey: github.com. RSA key) #339
Comments
When forcing my ssh known hosts to repopulate the RSA key this is using the following errors remain:
|
I think you need to generate a new key after updating to the latest ssh-keygen, and add that new ssh key to your github profile. Let me know if that fixes this issue? |
Hmm, where did |
You could also try erasing |
Thanks for taking the time to reply - I really appreciate that! I suspect the git problem was related to github changing their RSA key - I fixed that by adding their latest RSA keys to my known hosts as per https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints I did a completely fresh clone and install however Java still explodes so there's something up. No expectations on fixing this - it's not a big problem for me - the prioject just looked interesting so I wanted to try it out - completely understand if you want to just close this if I'm a special case 😅 $JAVA_HOME/bin/java -jar build/libs/BowlerStudio*.jar
No splash screen availible!
Splash Rendering 2 Testing Internet
Splash Rendering 5 Loging In...
Attempt to log in with disk credentials
No login ID found!
Splash Rendering 20 DL'ing Image Assets
Workspace: /Users/samm/bowler-workspace
Cloning files from: https://github.com/madhephaestus/BowlerStudioImageAssets.git
to: /Users/samm/bowler-workspace/gitcache/github.com/madhephaestus/BowlerStudioImageAssets
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:873)
Caused by: java.lang.RuntimeException: org.eclipse.jgit.api.errors.TransportException: git@github.com:madhephaestus/BowlerStudioImageAssets.git: java.lang.NullPointerException
at com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine.cloneRepo(ScriptingEngine.java:1598)
at com.neuronrobotics.bowlerstudio.BowlerStudio.main(BowlerStudio.java:396)
... 11 more
Caused by: org.eclipse.jgit.api.errors.TransportException: git@github.com:madhephaestus/BowlerStudioImageAssets.git: java.lang.NullPointerException
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:255)
at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:305)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:204)
at com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine.cloneRepoLocal(ScriptingEngine.java:203)
at com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine.cloneRepo(ScriptingEngine.java:1577)
... 12 more
Caused by: org.eclipse.jgit.errors.TransportException: git@github.com:madhephaestus/BowlerStudioImageAssets.git: java.lang.NullPointerException
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:191)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:138)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:124)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1293)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:244)
... 16 more
Caused by: com.jcraft.jsch.JSchException: java.lang.NullPointerException
at com.jcraft.jsch.Session.updateKeys(Session.java:1214)
at com.jcraft.jsch.Session.receive_newkeys(Session.java:1098)
at com.jcraft.jsch.Session.connect(Session.java:367)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:145)
... 23 more
Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.jcraft.jsch.Session.updateKeys(Session.java:1173)
... 26 more
Exception running application com.neuronrobotics.bowlerstudio.BowlerStudio Just FYI as to why git is used rather than HTTPS - my git client is setup to prefer git protocol over https for github.com (this is pretty common when working across a few github enterprise cloud accounts as it helps with authentication to private repos) - so git:// will be coming from my ~/.gitconfig:
|
Oh boy, yeah, thats going to mess up this stack :/ I need to process ssh connectetion differently than https and detecte it by the URL passed. I dont know how to get that alteration into my code, but i will look into it. It is good to have a specific config file to change to reproduce this issue. I have managed to reproduce that error now, and ill look into what it would take to make this use case work! |
I was able to get the clone to fail-over to the SSH credentials, but since this is not usually a feature thats used (clones using SSH generally happen outside of the BowlerStudio pipeline), that failed for a different reason. Since the URL is changed at the lowest layer, i cant detect it, just try the HTTPS way, fail, and try the SSH way. Turns out there is some bug in ssh cloning too, and thats just not working at all :/ This looks solvable, but not going to be a quick fix like i was hoping... Quick workaround, get rid of that .gitconfig line while trying out BowlerStudio for now? |
WELL! I was able to update the jgit library, change how the SSH client uses the underlaying SSH layer, add fail-retry as ssh all the places where the credential providers are used and was able to get my personal system to work with the given SSH config. I will pass the changes through review and release a fixed version tonight. |
Interesting! So it was a bug! I'm actually quite glad I wasn't just being an egg with a misconfigured ssh client - that would have been a bit embarrassing 😅 Well done figuring all that out - sounds like a fun one. When you've got a release (or branch) out I'll give it a go, again no rush at all! |
Nah, embarrassment is all my side im afraid. I was using a 2016 abandon-ware layer to manage the SSH connections for the Git subsystem. If you would like build it from source the branch with the fix thats in review is Otherwise it should be through review and published tonight or tomorrow morning. |
For those in the future that are having similar problems, this is the line that was changed: https://github.com/CommonWealthRobotics/bowler-script-kernel/pull/26/files#r1167308324 and the changes in the buildfile for the updated version of jgit: https://github.com/CommonWealthRobotics/bowler-script-kernel/pull/26/files#r1167309104 |
You and half the projects on Github 😛. Awesome to see such a response to logging a bug report by the way - it's always a fine line to tread between wanting to share feedback / issues and not coming off like you're expecting someone to fix something they made and provided for free. It looks like now it's trying to log into github.com - which I wouldn't have expected unless it was a private repo:
|
And if I completely remove my known hosts file:
Never seen anything like this! |
First guess is that while messing around you ended up with an ssh configuration that is not registered in github:
It looks like the ssh layer connected, but just failed to authenticate. in your ~/.gitconfig, do you have a full user section?
BTW Can you try to run in bash:
just to sanity check the environment? |
for reference, when this works, these INFO logs print:
|
Yep the gitconfig looks pretty normal - and it works with every other Github git repository I've tried it with (I have 138 repos cloned right now).
I can clone
I just temporarily removed the setting that makes sure Github uses the git protocol rather than an HTTPS URL and it worked! So I suspect the problem must be with how the app / Java is doing the git clone - I wonder if it's assuming people are using git over HTTPS? Also - is there any reason the git clone is run from within Java rather than during an install / run script? |
thats cool that its working! It accesses repos because it can be used to manage projects acrodd your github projects. Its fine to deny access to any current projects. It just needs to be able to make new repos, thats how it understands "projects" internally. Thus the admin permissions. I have some users that have sensitive stuff in their regular github account, so they just made burners for use in bowlerstudio. It is assuming https access, because all the internal access is via https and the token requested from github in the webflow step. You are teh first user to have had this substitution based change from https to ssh in a gitconfig. You are not wrong, so its just a matter of making the java git client, and in this case the Apache SSHD layer to play nice. |
as for the reason java layer is doing the git clones, for the most part it treats git as the filesystem to read and write from for the scripts. The cad layer uses this git filesystem to ensure saving your code, is actually making a commit and a push. This means that any code that calls another piece of code, does so by its git url and file path. any code that runs on my system, therefore, will run on anyone elses. This is meant to enable a sharing first mentality to CAD and put collaboration as a first class activity. It was meant as a teaching tool for students learning programming for the first time, or for developers familliar with programming that want a powerful cad package without learning complicated new UI's. Getting this working for someone with a sophisticated git setup is definantly a use-case i want to support. |
Oh, and without the API key the local source copy will not be able to log in, so i think if you just run the binary copy with the special case in the gitconfig turned off it should be able to login. |
CommonWealthRobotics/bowler-script-kernel@bdfb814
That's cool, makes sense! Awesome thanks for getting this working and explaining the internals a bit along the way. |
I was able to get the git@ override working for me, and tbh it may be something i use long term, its a great shortcut. I do not however get the failed authentication you get. can you open an issue with the place where it failed using the git@ overrides for you? |
Error when launching the app:
UnknownHostKey: github.com. RSA key
I'm assuming this relates to https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/
Installed Version
Latest (1.77.1)
OS type and version number
macOS 13.3.1
Expected behaviour
The app to launch
Actual Behaviour
The app crashes
Steps to reproduce the behaviour
Download the app, run it
The text was updated successfully, but these errors were encountered: