Che: Git integration is broken

Created on 27 Aug 2018  路  7Comments  路  Source: eclipse/che

Description

It looks to me as if the git integration is broken again. Setting up a new project with Git doesn't work at all.

Reproduction Steps

  • Setup Che, on OKD, multiuser and HTTPS
  • Create a new workspace with Java stack (Ubuntu or CentOS). Add Git project. Enable Git credentials installer.
  • Open Workspace for the first time
  • BANG

The project is not importedl. Git information (username, e-mail) is empty.

OS and version:

  • OKD 3.10
  • CentOS 7

Diagnostics:

The terminal of the "dev-machine" shows:
~
2018-08-27 12:30:28,729[equestProcessor] [ERROR] [o.e.c.g.i.jgit.JGitConnection 2219] - Can't store ssh key. Unable get private ssh key
at org.eclipse.che.git.impl.jgit.JGitConnection.executeRemoteCommand(JGitConnection.java:2123)
at org.eclipse.che.git.impl.jgit.JGitConnection.clone(JGitConnection.java:621)
at org.eclipse.che.api.git.GitProjectImporter.cloneRepository(GitProjectImporter.java:264)
at org.eclipse.che.api.project.server.impl.ExecutiveProjectManager.doImport(ExecutiveProjectManager.java:390)
at org.eclipse.che.api.git.GitProjectImporter.doImport(GitProjectImporter.java:195)
at org.eclipse.che.api.project.server.impl.ProjectJsonRpcServiceBackEnd.doImportInternally(ProjectJsonRpcServiceBackEnd.java:240)
at org.eclipse.che.git.impl.jgit.JGitConnection.writePrivateKeyFile(JGitConnection.java:2215)
at org.eclipse.che.plugin.ssh.key.script.SshKeyProviderImpl.getPrivateKey(SshKeyProviderImpl.java:62)
at org.eclipse.che.api.core.jsonrpc.commons.RequestHandlerManager.handle(RequestHandlerManager.java:213)
at java.lang.Thread.run(Thread.java:748)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at org.eclipse.che.api.core.jsonrpc.commons.JsonRpcMessageReceiver.lambda$receive$0(JsonRpcMessageReceiver.java:73)
at org.eclipse.che.api.core.jsonrpc.commons.JsonRpcMessageReceiver.processRequest(JsonRpcMessageReceiver.java:98)
at org.eclipse.che.api.core.jsonrpc.commons.RequestDispatcher.dispatch(RequestDispatcher.java:52)
at org.eclipse.che.api.core.jsonrpc.commons.RequestHandlerManager$OneToOneHandler.access$1000(RequestHandlerManager.java:316)
at org.eclipse.che.api.project.server.impl.ProjectJsonRpcServiceBackEnd.perform(ProjectJsonRpcServiceBackEnd.java:313)
at org.eclipse.che.api.core.jsonrpc.commons.RequestHandlerManager$OneToOneHandler.handle(RequestHandlerManager.java:329)
at org.eclipse.che.api.project.server.impl.ValidatingProjectManager.doImport(ValidatingProjectManager.java:289)
at org.eclipse.che.api.project.server.impl.SynchronizingProjectManager.doImport(SynchronizingProjectManager.java:230)
at org.eclipse.che.api.project.server.impl.ProjectJsonRpcServiceBackEnd.doImport(ProjectJsonRpcServiceBackEnd.java:98)
org.eclipse.che.api.core.ServerException: Unable get private ssh key
at org.eclipse.che.api.project.server.impl.ProjectImportManager.doImport(ProjectImportManager.java:279)
at org.eclipse.che.api.project.server.impl.ProjectImportManager.doImportInternally(ProjectImportManager.java:303)
~

kinquestion

Most helpful comment

This is why I dont use che :(

All 7 comments

@ctron git installer syncs keys and git committer info between user preferences (when you generate keys in UI) and terminal git.

So maybe that workflow needs a bit more cleanup. I had keys, but not in the user preferences, but in the workspace preferences. Why aren't those taken instead?

And maybe you should print out a proper warning on how to fix this, instead of showing an exception. In addition I found it rather weird that I had to input the name of the target host in the preferences when creating a key. So maybe a little bit of help/info text in that dialog box would help as well.

@ctron if you want to clone a repo using UI Git you need to generate keys using UI

Ok, so what are the keys for that are pre-generated in the workspace?

In any case, I still think that the workflow is kind of weird. I would expect:

  • Create a new account with Che
  • Click on factory link
  • Che asks any information required
  • Che sets up my workspace

Right now the workflow is like this:

  • Create new account with Che
  • Create a new, dummy workspace
  • Edit preferences

    • Set git commiter info

    • Create new SSH key for "github.com"

  • Close workspace
  • Click on factory link

And the biggest issue with that is IHMO that Che asks you to enter a hostname for the SSH key, but expects this to be the target hostname. When you create an SSH key locally, then you create this for your "local" machine. So I really do think that you should put in a proper note, explaining that the hostname is not your local host/container, but really the hostname of the remote system: e.g. "github.com".

@ctron yes, configuring SSH keys right in user Dashboard would be a better flow than creating and starting a workspace and then generating keys.

As to providing a hostname for ssh keys, I think it's historical. It must be possible to have one key for all git hosting providers

Closing. Feel free to reopen this issue if you think it's still relevant for you.

This is why I dont use che :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesDrummond picture JamesDrummond  路  3Comments

skabashnyuk picture skabashnyuk  路  3Comments

vanzhiganov picture vanzhiganov  路  3Comments

dmytro-ndp picture dmytro-ndp  路  3Comments

amisevsk picture amisevsk  路  3Comments