Bug 1684359
| Summary: | Cannot launch provision request from API from global region using LDAP user who never logged into the sub region | ||
|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Nikhil Gupta <ngupta> |
| Component: | API | Assignee: | Joe Vlcek <jvlcek> |
| Status: | CLOSED NOTABUG | QA Contact: | Parthvi Vala <pvala> |
| Severity: | high | Docs Contact: | Red Hat CloudForms Documentation <cloudforms-docs> |
| Priority: | medium | ||
| Version: | 5.10.0 | CC: | dmetzger, jvlcek, nchugh, ngupta, obarenbo, pvala |
| Target Milestone: | GA | ||
| Target Release: | 5.10.3 | ||
| 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: | 2019-03-25 17:39:40 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | Bug | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | CFME Core | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1692488 | ||
|
Description
Nikhil Gupta
2019-03-01 04:52:00 UTC
Nikhil,
Please provide the following information to help me diagnose this issue.
- When the user is created in the sub-regions are they auto-created
by logging into the UI as the new user or are they manually created
by logging in as admin and manually created them with the CFME UI?
- Has Red Hat support been able to recreate this failure inside the Red Hat
network? If so please post a private message to this BZ with the
credentials to the CFME systems.
- On the global and sub-regions please provide the information described in the
"Troubleshooting ManageIQ Authentication" blog post [1]
Specifically the data described in the Appendix titled:
* "Capturing ManageIQ Log Files" [2]
Please capture the logs immediately following the recreation of the failure,
so the logs will include the failures.
* "Capturing Authentication Data From ManageIQ DB" [3]
Please provide the output from each of the rails runner commands
from both the global and remote region when the failure is observed.
[1] http://manageiq.org/blog/2018/01/troubleshooting-auth/
[2] http://manageiq.org/blog/2018/01/troubleshooting-auth/#capturing-manageiq-log-files
[3] http://manageiq.org/blog/2018/01/troubleshooting-auth/#capturing-authentication-data-from-manageiq-db
Thank you! JoeV
Neha, I believe I have found the source of this failure. The bug description states: > 7- Make a create_provision_request using the API http://manageiq.org/docs/reference/fine/api/examples/provision_request I think the issue is rooted in this script. Can you please attach in a private message to this BZ with the version of this script being used in the Global/Sub-region setup? The version of this script available on the stand alone test system get's a token for the admin user then issues the provision request with the payload post_params that contain the "joev" user. In order for this to work the "joev" users credentials also need to be used on the initial request to get the token. To reproduce the "correct" behavior I logged into the stand alone system and updated the rest_check.rb script to use the joev user's credentials instead of the admin user's when getting the token: e.g.: Change from: 8 def create_provision_request_api(ip, post_params) 9 api_uri = "https://#{ip}/api" 10 url = URI.encode(api_uri + '/auth') 11 rest_return = RestClient::Request.execute( 12 :method => "get", 13 :url => url, 14 :user => "admin", 15 :password => "smartvm", 16 :headers => {:accept => :json}, 17 :verify_ssl => false 18 ) 19 auth_token = JSON.parse(rest_return)['auth_token'] Change to: 8 def create_provision_request_api(ip, post_params) 9 api_uri = "https://#{ip}/api" 10 url = URI.encode(api_uri + '/auth') 11 rest_return = RestClient::Request.execute( 12 :method => "get", 13 :url => url, 14 :user => "joev", 15 :password => < joev's password> , 16 :headers => {:accept => :json}, 17 :verify_ssl => false 18 ) 19 auth_token = JSON.parse(rest_return)['auth_token'] Leave everything else as it is and this will work. If the joev user does not yet exists it will be created. It is still not clear to me exactly what tooling is being used to perform the provision_request in the non-stand-alone setup but I suspect all that needs to be done in this case also will be to ensure the token being used is for the current user (User.current_userid) and not admin. Please let me know if this works for you and if not please provide more information regarding the tooling being used to perform the provision_request in the non-stand-alone setup. You can simply past the script in a private message to this BZ if need be. Hope this resolves the issue. Thank you, JoeV Since the associated customer case has been CLOSED I am going to close this BZ. It seems the problem was simply one of incorrect usage. The information I provided in comment #7 describes the correct usage. If it is felt this BZ should be reopened please provide justification. Thank you, JoeV |