Bug 1465389

Summary: ssh key creation in User throws 'page doesn't exists' error
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Users & RolesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: dhlavacd, jyejare, mhulan, nkathole, sghai, sgraessl, tbrisker
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:43:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1493109    
Attachments:
Description Flags
Screenshot Attached
none
screenshot of UI before saving user
none
screenshot of UI ssh key create none

Description Jitendra Yejare 2017-06-27 11:09:46 UTC
Created attachment 1292268 [details]
Screenshot Attached

Description of problem:
While creating a ssh key from new user dialog, clicking and submitting 'create ssh key' button throws 'The page you were looking for doesn't exist.' error.

Version-Release number of selected component (if applicable):
Satellite 6.3.0 snap 4

How reproducible:
Always

Steps to Reproduce:
1. Go to Admin -> Users -> New User -> ssh keys tab
2. Click on 'create SSH key' button to create new ssh key.


Actual results:
Redirected to page showing an error 'The page you were looking for doesn't exist.'

Expected results:
The satellite should allow to create a new ssh key with user.

Additional info:

Comment 3 Jitendra Yejare 2017-06-27 14:47:34 UTC
Adding failure logs from production.log:

```
017-06-27 10:45:06 927a33fa [app] [I] Started GET "/notification_recipients" for 10.65.223.122 at 2017-06-27 10:45:06 -0400
2017-06-27 10:45:06 927a33fa [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-06-27 10:45:06 927a33fa [app] [I] Current user: admin (administrator)
2017-06-27 10:45:06 927a33fa [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.4ms)



2017-06-27 10:45:07 02f3beea [app] [I] Started GET "/users//ssh_keys/new" for 10.65.223.122 at 2017-06-27 10:45:07 -0400
2017-06-27 10:45:07 02f3beea [app] [F] 
 | ActionController::RoutingError (No route matches [GET] "/users/ssh_keys/new"):
 |   lib/middleware/tagged_logging.rb:18:in `call'
 | 
 | 
2017-06-27 10:45:08 f250b88e [app] [I] Started GET "/users//ssh_keys/new" for 10.65.223.122 at 2017-06-27 10:45:08 -0400
2017-06-27 10:45:08 f250b88e [app] [F] 
 | ActionController::RoutingError (No route matches [GET] "/users/ssh_keys/new"):
 |   lib/middleware/tagged_logging.rb:18:in `call'
 | 
 | 
2017-06-27 10:45:08 e1cba46f [app] [I] Started GET "/notification_recipients" for 10.65.223.122 at 2017-06-27 10:45:08 -0400
2017-06-27 10:45:08 e1cba46f [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-06-27 10:45:08 e1cba46f [app] [I] Current user: admin (administrator)
2017-06-27 10:45:08 e1cba46f [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.6ms)
```

Comment 4 Marek Hulan 2017-06-28 15:12:01 UTC
This happens only when the user is not saved yet. We shouldn't probably display create button until the user is already saved. Jitendra, I think this is not a blocker though. Could you please remove the blocker flag? Easy workaround is to create user, then edit him/her and create the ssh key from there.

Comment 5 Marek Hulan 2017-06-28 15:14:15 UTC
Created redmine issue http://projects.theforeman.org/issues/20137 from this bug

Comment 7 Jitendra Yejare 2017-06-28 16:02:34 UTC
Agree with comment 4.

Comment 8 Satellite Program 2017-06-28 16:09:19 UTC
Upstream bug assigned to mhulan

Comment 9 Satellite Program 2017-06-28 16:09:23 UTC
Upstream bug assigned to mhulan

Comment 10 Satellite Program 2017-06-29 12:09:52 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20137 has been resolved.

Comment 11 Nikhil Kathole 2017-08-10 06:34:14 UTC
Created attachment 1311603 [details]
screenshot of UI before saving user

VERIFIED

Version Tested:
Satellite-6.3 Snap 10

After saving user, 'create ssh key' redirects to respective page and before saving user, it shows "In order to create the SSH key, the user must be saved first".

Comment 12 Nikhil Kathole 2017-08-10 06:45:46 UTC
Created attachment 1311605 [details]
screenshot of UI ssh key create

screen shot of page redirect after clicking 'create user key'

Comment 13 Bryan Kearney 2018-02-21 16:40:39 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Comment 14 Bryan Kearney 2018-02-21 16:43:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336