Bug 1468541 - Satellite is not allowing recreation of SSH-key in Users
Satellite is not allowing recreation of SSH-key in Users
Status: VERIFIED
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Users & Roles (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity high (vote)
: GA
: --
Assigned To: Marek Hulan
Jitendra Yejare
: Triaged
Depends On:
Blocks: 1493109
  Show dependency treegraph
 
Reported: 2017-07-07 07:20 EDT by Jitendra Yejare
Modified: 2017-09-19 08:05 EDT (History)
5 users (show)

See Also:
Fixed In Version: foreman-1.15.3
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshot Attached (57.07 KB, image/png)
2017-07-07 07:20 EDT, Jitendra Yejare
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 20306 None None None 2017-07-14 04:57 EDT

  None (edit)
Description Jitendra Yejare 2017-07-07 07:20:10 EDT
Created attachment 1295261 [details]
Screenshot Attached

Description of problem:
Satellite is not allowing the recreation of SSH key after deleting that SSH key once from satellite.
It throws an error notification of 'Fingerprint has already been taken'.

Version-Release number of selected component (if applicable):
Satellite 6.3.0 Snap 5

How reproducible:
Always

Steps to Reproduce:
1. Create SSH key in any users(i tried in Admin) template
2. Delete that SSH key from users template.
3. Attempt to add same SSH key is same user template.

Actual results:
1. Satellite UI throws error notification - Fingerprint has already been taken.
2. SSH key is not added to user template.

Expected results:
Recreation/Re-Addition of SSH key in user template should be successful for any number of times. Error notification should not be displayed for recreation of SSH key.

Additional info:
Comment 3 Jitendra Yejare 2017-07-11 06:20:52 EDT
Hi Marek,

One update is that, I am facing this issue only for Super Admin user.

Production logs:
2017-07-11 06:15:37 57a92fe1 [app] [I] Started GET "/users/3-admin/ssh_keys/new" for 10.65.223.122 at 2017-07-11 06:15:37 -0400
2017-07-11 06:15:37 57a92fe1 [app] [I] Processing by SshKeysController#new as HTML
2017-07-11 06:15:37 57a92fe1 [app] [I]   Parameters: {"user_id"=>"3-admin"}
2017-07-11 06:15:37 57a92fe1 [app] [I] Current user: admin (administrator)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered ssh_keys/_form.html.erb (4.7ms)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered ssh_keys/new.html.erb within layouts/application (7.5ms)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered layouts/_application_content.html.erb (0.3ms)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered home/_submenu.html.erb (2.0ms)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered home/_user_dropdown.html.erb (1.5ms)
2017-07-11 06:15:37 57a92fe1 [app] [I] Read fragment views/tabs_and_title_records-3 (0.1ms)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered home/_topbar.html.erb (5.0ms)
2017-07-11 06:15:37 57a92fe1 [app] [I]   Rendered layouts/base.html.erb (6.9ms)
2017-07-11 06:15:37 57a92fe1 [app] [I] Completed 200 OK in 32ms (Views: 20.6ms | ActiveRecord: 3.3ms)
2017-07-11 06:15:37 3c613444 [app] [I] Started GET "/users/3-admin/ssh_keys/new" for 10.65.223.122 at 2017-07-11 06:15:37 -0400
2017-07-11 06:15:37 3c613444 [app] [I] Processing by SshKeysController#new as HTML
2017-07-11 06:15:37 3c613444 [app] [I]   Parameters: {"user_id"=>"3-admin"}
2017-07-11 06:15:37 3c613444 [app] [I] Current user: admin (administrator)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered ssh_keys/_form.html.erb (3.2ms)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered ssh_keys/new.html.erb within layouts/application (6.1ms)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered layouts/_application_content.html.erb (0.3ms)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered home/_submenu.html.erb (2.0ms)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered home/_user_dropdown.html.erb (1.5ms)
2017-07-11 06:15:37 3c613444 [app] [I] Read fragment views/tabs_and_title_records-3 (0.1ms)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered home/_topbar.html.erb (4.8ms)
2017-07-11 06:15:37 3c613444 [app] [I]   Rendered layouts/base.html.erb (6.8ms)
2017-07-11 06:15:37 3c613444 [app] [I] Completed 200 OK in 25ms (Views: 14.7ms | ActiveRecord: 2.8ms)
2017-07-11 06:15:38 2d7dd4b5 [app] [I] Started GET "/notification_recipients" for 10.65.223.122 at 2017-07-11 06:15:38 -0400
2017-07-11 06:15:38 2d7dd4b5 [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-07-11 06:15:38 2d7dd4b5 [app] [I] Current user: admin (administrator)
2017-07-11 06:15:38 2d7dd4b5 [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.7ms)
2017-07-11 06:15:41 70f68e46 [app] [I] Started POST "/users/3-admin/ssh_keys" for 10.65.223.122 at 2017-07-11 06:15:41 -0400
2017-07-11 06:15:41 70f68e46 [app] [I] Processing by SshKeysController#create as HTML
2017-07-11 06:15:41 70f68e46 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"kofFJNQ0NX8ihQIIAA4ipij1DJ+NQwfhurTmwILpTfNXej8zVexu5tYnRMfYMz9hsDAprh1rUlqp/rzN0K31jA==", "ssh_key"=>{"key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXb0vgvmYwAeZ1SMMGBHK/+Mv0gx17URhnU26FBwb3PqDr1+KVzrs1lkeFWFVqSEQmWSANfb9QgEJ5xXUwuB0CjgURdpYQTj98C7wTwDcUw5lMxDaMYb1VES8hhG2ORDk1H1mb5pNNby5ghYEORkI43VOzOu6SsZpPuWkxJbhj7pRo++xiMCDsfnsktOXyeWoes0Ig1dLj2mlZe3HP5BtPhJLwrzO1bd3POSsJFuEwALUF0mWQ6TEqzA8vqID/dcjpzMnaiFl6IOswjrLboF1SMhk4/2qLFYMDkSHYjGQC0GvxuSA7Vvsk1J19UG9Hs5HAyGzHImNEw9ptzzOQcKut root@qeblade36.rhq.lab.eng.bos.redhat.com", "name"=>"root@qeblade36.rhq.lab.eng.bos.redhat.com"}, "commit"=>"Submit", "user_id"=>"3-admin"}
2017-07-11 06:15:41 70f68e46 [app] [I] Current user: admin (administrator)
2017-07-11 06:15:42 70f68e46 [app] [I] Failed to save: Fingerprint has already been taken
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered ssh_keys/_form.html.erb (3.0ms)
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered ssh_keys/new.html.erb within layouts/application (5.0ms)
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered layouts/_application_content.html.erb (0.3ms)
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered home/_submenu.html.erb (1.9ms)
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered home/_user_dropdown.html.erb (1.5ms)
2017-07-11 06:15:42 70f68e46 [app] [I] Read fragment views/tabs_and_title_records-3 (0.1ms)
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered home/_topbar.html.erb (4.8ms)
2017-07-11 06:15:42 70f68e46 [app] [I]   Rendered layouts/base.html.erb (6.8ms)
2017-07-11 06:15:42 70f68e46 [app] [I] Completed 200 OK in 30ms (Views: 13.2ms | ActiveRecord: 3.7ms)
2017-07-11 06:15:42 5b991f4c [app] [I] Started GET "/notification_recipients" for 10.65.223.122 at 2017-07-11 06:15:42 -0400
2017-07-11 06:15:42 5b991f4c [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-07-11 06:15:42 5b991f4c [app] [I] Current user: admin (administrator)
2017-07-11 06:15:42 5b991f4c [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.8ms)
2017-07-11 06:15:53 0bca123e [app] [I] Started GET "/notification_recipients" for 10.65.223.122 at 2017-07-11 06:15:53 -0400
2017-07-11 06:15:53 0bca123e [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-07-11 06:15:53 0bca123e [app] [I] Current user: admin (administrator)
2017-07-11 06:15:53 0bca123e [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.8ms)


Why I consider this as blocker ?
Answer - Because Once the ssh key is deleted from Admin user then there is no another way to add it, neither from CLI and nor from API. 
I know customer can copy paste the SSH key but thats really hectic for customer if he has tomes of host to copy ssh key.
Comment 4 Marek Hulan 2017-07-14 04:57:32 EDT
Created redmine issue http://projects.theforeman.org/issues/20306 from this bug
Comment 5 pm-sat@redhat.com 2017-07-14 06:11:38 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 6 pm-sat@redhat.com 2017-07-14 06:11:41 EDT
Upstream bug assigned to mhulan@redhat.com
Comment 7 pm-sat@redhat.com 2017-07-19 16:11:28 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20306 has been resolved.
Comment 8 Jitendra Yejare 2017-08-28 07:53:35 EDT
Verified!

Satelite 6.3.0 Snap 13

Steps:
1. Create SSH key in any Admin user
2. Delete that SSH key from Admin user
3. Attempt to add same SSH key Admin user

Actual results:
Satellite is now allowing to recreate the SSH-key

Note You need to log in before you can comment on or make changes to this bug.