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

ssh: delete key pair not working #14332

Closed
5 of 23 tasks
SDAdham opened this issue Aug 25, 2019 · 26 comments · Fixed by #14557
Closed
5 of 23 tasks

ssh: delete key pair not working #14332

SDAdham opened this issue Aug 25, 2019 · 26 comments · Fixed by #14557
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. status/in-progress This issue has been taken by an engineer and is under active development.
Milestone

Comments

@SDAdham
Copy link

SDAdham commented Aug 25, 2019

Describe the bug

When creating a new workspace with git projects added, they don't get cloned upon workspace creation:

Looking for git in: git
Using git 2.20.1 from git
> git rev-parse --show-toplevel
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
> git rev-parse --show-toplevel
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

trying to delete a key that was generated, it's not working

>ssh: delete key pair

Deleted it manually via k8s secretes and tried to generate a new one but i can't anymore

Che version

  • latest
  • nightly
  • other: please specify
Che-Theia@e358e2f using Theia@e358e2f
Built 8/14/2019, 7:53:02 AM
List of extensions:
@theia/core 0.8.0
@theia/output 0.8.0
@theia/process 0.8.0
@theia/filesystem 0.8.0
@theia/variable-resolver 0.8.0
@theia/workspace 0.8.0
@theia/languages 0.8.0
@theia/editor 0.8.0
@theia/callhierarchy 0.8.0
@theia/console 0.8.0
@theia/json 0.8.0
@theia/userstorage 0.8.0
@theia/preferences 0.8.0
@theia/navigator 0.8.0
@theia/markers 0.8.0
@theia/terminal 0.8.0
@theia/task 0.8.0
@theia/cpp 0.8.0
@theia/debug 0.8.0
@theia/debug-nodejs 0.8.0
@theia/editorconfig 0.8.0
@theia/file-search 0.8.0
@theia/keymaps 0.8.0
@theia/merge-conflicts 0.8.0
@theia/messages 0.8.0
@theia/mini-browser 0.8.0
@theia/outline-view 0.8.0
@theia/scm 0.8.0
@theia/search-in-workspace 0.8.0
@theia/plugin-ext 0.8.0
@theia/plugin-dev 0.8.0
@theia/plugin-ext-vscode 0.8.0
@theia/preview 0.8.0
@theia/textmate-grammars 0.8.0
@eclipse-che/theia-remote 0.0.1
@eclipse-che/theia-plugin-ext 0.0.1
@eclipse-che/theia-terminal 0.0.1
@eclipse-che/theia-user-preferences-synchronizer 0.0.1
@eclipse-che/che-theia-hosted-plugin-manager-extension 0.0.1
@eclipse-che/theia-dashboard-extension 0.0.1
@eclipse-che/theia-activity-tracker 1.0.0
@eclipse-che/theia-about 0.0.1
@eclipse-che/theia-preferences-provider-extension 0.0.1

Steps to reproduce

A newly deployed che environment today
followed the steps of https://www.eclipse.org/che/docs/che-7/version-control/

ssh: delete key pair (nothing happens clicking it)

Expected behavior

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-21T15:34:43Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T17:06:39Z", GoVersion:"go1.12.7", Compiler:"gc", Platform:"linux/amd64"}

Screenshots

Installation method

  • chectl
  • che-operator
  • minishift-addon
  • I don't know
chectl/7.0.0 linux-x64 node-v10.16.2

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: please specify

Private cloud

Additional context

@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Aug 25, 2019
@SDAdham
Copy link
Author

SDAdham commented Aug 25, 2019

I tried both methods, generating ssh key for all hosts and particular host, and nothing works, always get:

Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

The issue is that the host ip changed and i can't re-generate the key for the new host

@SDAdham SDAdham changed the title git is not working ssh: delete key pair not working Aug 25, 2019
@gorkem
Copy link
Contributor

gorkem commented Aug 25, 2019

I think it is because of the known_hosts is not updated by the IDE. Can you do the initial git clone from the command line and see if git works afterwards ?

@SDAdham
Copy link
Author

SDAdham commented Aug 25, 2019

Yes, i did try that, same problem

@SDAdham
Copy link
Author

SDAdham commented Aug 25, 2019

Is ssh delete key generally works? Or is it buggy?

@gorkem
Copy link
Contributor

gorkem commented Aug 25, 2019

Delete has worked for me but you may want to restart your workspace after adding/removing ssh keys. Che keeps SSH keys as k8s secrets and mounts them to the proper path so path to the key will not be removed until the restart.

@ibuziuk ibuziuk added this to the 7.1.0 milestone Aug 26, 2019
@ibuziuk ibuziuk added kind/bug Outline of a bug - must adhere to the bug report template. team/ide2 and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Aug 26, 2019
@ibuziuk
Copy link
Member

ibuziuk commented Aug 26, 2019

@vinokurig could you please confirm that restart is required for deleting ssh? should we add a similar warning as we currently have for ssh key generation (e.g. ssh keys will be removed after workspace restart)?

@SDAdham
Copy link
Author

SDAdham commented Aug 26, 2019

Restart doesnt fix anything, infact clicking delete ssh key doesnt do anything as well

@gorkem
Copy link
Contributor

gorkem commented Aug 26, 2019

@vparfonov can you check if this is a regression?

@ibuziuk
Copy link
Member

ibuziuk commented Aug 26, 2019

Vitalli is on PTO, @azatsarynnyy could you please take a look?

@azatsarynnyy
Copy link
Member

I believe the issue is caused by the missing entry for a remote host in known_hosts file.
@SDAdham could you please try the following steps, with ssh key pair already generated:

  • open a terminal into theia-ide container
  • update the known_hosts with the following command:
    ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
  • try to clone a repo again

Make sure that github.com in the command is replaced with the required host if needed.

@gorkem
Copy link
Contributor

gorkem commented Aug 30, 2019

@azatsarynnyy All the calls to delete/view ssh keys are failing at the moment. Here is what I see from the logs

root ERROR Request getAllSshKey failed with error: Request failed with status code 403 
root ERROR [hosted-plugin: 44] Promise rejection not handled in one second: Error: Request getAllSshKey failed with message: Request failed with status code 403
root ERROR [hosted-plugin: 44] With stack trace: Error: Request 'getAllSshKey' failed
    at Proxy.<anonymous> (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:1787832)
    at e.<anonymous> (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:2947499)
    at https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:2946670
    at Object.next (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:2946775)
    at https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:2945688
    at new Promise (<anonymous>)
    at r (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:2945465)
    at e.$getAll (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:2947413)
    at e.doInvokeHandler (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:827569)
    at e.invokeHandler (https://static.developers.redhat.com/che/theia_artifacts/theia.fb4ce1ef4bb91a367691.js:1:827297)

@gorkem gorkem added the severity/P1 Has a major impact to usage or development of the system. label Aug 30, 2019
@gorkem
Copy link
Contributor

gorkem commented Aug 30, 2019

I am elevating the severity of the issue.

@SDAdham
Copy link
Author

SDAdham commented Aug 30, 2019

@azatsarynnyy I'll try your suggestion soon, I am deploying a new environment now

@azatsarynnyy
Copy link
Member

Some notes after investigating an issue of deleting a key pair.

Looks odd that request for generating a key pair is always successful but fetching a key is failed.
WebSocket messages from browser's console:

{"kind":"data","id":14,"content":"{\"jsonrpc\":\"2.0\",\"id\":11,\"method\":\"getAllSshKey\",\"params\":\"vcs\"}"}

{"kind":"data","id":14,"content":"{\"jsonrpc\":\"2.0\",\"id\":11,\"error\":{\"code\":-32603,\"message\":\"Request getAllSshKey failed with message: Request failed with status code 403\"}}"}

SSH: delete key pair... and SSH: view public key... commands rely on the getAllSshKey API call which is the reason for failing these commands.

Note, not reproducible on minikube but on hosted Che only.

@ibuziuk
Copy link
Member

ibuziuk commented Sep 5, 2019

@azatsarynnyy according to the issue reporter the issue was reproduced on k8s environment. Why do you think it is Hosted Che specific?

@azatsarynnyy
Copy link
Member

@ibuziuk I mean that I cannot reproduce the issue of deleting key pair in Che running on minikube but it's reproducible on che.openshift.io

BTW, the keys verification issue should be fixed by the PR #14418

@ibuziuk
Copy link
Member

ibuziuk commented Sep 5, 2019

@azatsarynnyy but che.openshift.io is still RC 1.1 - I'm not sure it is fair to compare it with master ;-)

@gorkem
Copy link
Contributor

gorkem commented Sep 11, 2019

This is not hosted Che specific. I think this is an issue on any multi-user Che installation but for me it is reproducible on every Openshift 4.x cluster. And yes they are all multi-user installs

@vinokurig
Copy link
Contributor

This is not hosted Che specific. I think this is an issue on any multi-user Che installation but for me it is reproducible on every Openshift 4.x cluster. And yes they are all multi-user installs

Yes, reproduced the bug on minikube with multiuser Che, investigating ...

@vinokurig vinokurig self-assigned this Sep 12, 2019
@SDAdham
Copy link
Author

SDAdham commented Sep 12, 2019

I just deployed a new che installation just now, i can't seem to find > SSH: command list, has it been removed?

@SDAdham
Copy link
Author

SDAdham commented Sep 12, 2019

  • ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

No luck:

bash-4.4 /projects $ ssh-keyscan -t rsa <myHost> >> ~/.ssh/known_hosts      
bash: /home/user/.ssh/known_hosts: No such file or directory
bash-4.4 /projects $ 

@SDAdham
Copy link
Author

SDAdham commented Sep 13, 2019

I am currently using https as a workaround for the time being, is there any way that I can store my username and password for git?

@vinokurig vinokurig added the status/in-progress This issue has been taken by an engineer and is under active development. label Sep 13, 2019
@SDAdham
Copy link
Author

SDAdham commented Sep 17, 2019

@vinokurig : is this issue fixed? And do you know when I can get the fix?

@vinokurig
Copy link
Contributor

@SDAdham It is fixed, It must be applied in the eclipse/che-server:nightly docker image

@SDAdham
Copy link
Author

SDAdham commented Sep 17, 2019

@vinokurig : the image of my che's container is eclipse/che-server:7.1.0 but for my development pods

quay.io/eclipse/che-php-7:nightly
docker.io/eclipse/che-machine-exec:7.1.0
docker.io/eclipse/che-theia:7.1.0
docker.io/eclipse/che-remote-plugin-php7:7.1.0
docker.io/eclipse/che-remote-plugin-php7:7.1.0

None of them could get this fix any sooner, right?

@vinokurig
Copy link
Contributor

Unfortunately no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. status/in-progress This issue has been taken by an engineer and is under active development.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants