Bug 1451352
| Summary: | [Ansible Embedded] - Empty stdout after playbook execution | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Pavol Kotvan <pakotvan> | ||||||||
| Component: | UI - OPS | Assignee: | Harpreet Kataria <hkataria> | ||||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Dmitry Misharov <dmisharo> | ||||||||
| Severity: | high | Docs Contact: | |||||||||
| Priority: | high | ||||||||||
| Version: | 5.8.0 | CC: | abellott, cpelland, dclarizi, dmisharo, gmccullo, hkataria, jfrey, jhardy, jmarc, kkulkarn, lufu, mkanoor, mpovolny, obarenbo, pakotvan, simaishi, tfitzger | ||||||||
| Target Milestone: | GA | Keywords: | Regression, TestOnly | ||||||||
| Target Release: | 5.10.0 | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | ansible_embed:ui | ||||||||||
| Fixed In Version: | 5.10.0.0 | Doc Type: | If docs needed, set a value | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | |||||||||||
| : | 1451920 1515297 (view as bug list) | Environment: | |||||||||
| Last Closed: | 2018-06-21 20:19:32 UTC | Type: | Bug | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | Bug | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | Ansible | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 1451920, 1515297 | ||||||||||
| Attachments: |
|
||||||||||
|
Comment 3
Allen W
2017-05-16 13:32:50 UTC
Created attachment 1279338 [details]
Absent stdout for Opsui
Right on, so I checked out ops, looks like stdoutput is absent there as well, means this is likely not an SUI thing.
Lucy - BillW discuss an issue like this the other day, maybe check with him on the best way to validate stdout from the backend model. So it looks like we're not getting html, instead we're getting quazi html, which in this case looks like html with a bunch of escaped linebreaks... If ya take the output and run it through an html validator, https://validator.w3.org/nu/#textarea for instance, you'll see we got errors. Both the sui and the opsui use the ng-html-bind directive to display the output, when its not being given html, it cries and shows nothing. It should be noted, in the sui the following options are passed attributes: ['job_plays', 'stdout'], format_attributes: 'stdout=html'. TL;DR html isn't valid. Ops/s ui don't display invalid html. This was working as of https://github.com/ManageIQ/manageiq-ui-service/pull/691 Worked with DrewB on this yesterday and the output Lucy is seeing is just the embedded control characters in the ruby string. But if you print the string is displays exact the same as the output displayed from Tower UI. For example: irb(main):008:0> x = "Hello\nWorld" => "Hello\nWorld" # <- Here you see \n control character irb(main):009:0> puts x Hello World => nil We will continue to work with UI team to determine the proper resolution. Ok, took the plunge and loaded up the ansible db I have kicking around, on the following endpoint (the one that grabs plays and stdout) `http://localhost:3001/api/services/45/orchestration_stacks/412?attributes=job_plays%2Cstdout&format_attributes=stdout%3Dhtml` I see this error ``` error Object kind "internal_server_error" message "Embedded ansible is disabled" klass "MiqException::MiqOrchestrationStatusError" ``` after enabling "Embedded Ansible" I am able to see the correctly formatted stdout SO sui is fine, now we have to come together to ensure ops is happy <3 Created attachment 1279707 [details]
proof sui is fine, be sure to have ansible enabled
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/c2766036f3f8ebd6ae227fbe9e9fb564ebf9532d commit c2766036f3f8ebd6ae227fbe9e9fb564ebf9532d Author: Harpreet Kataria <hkataria> AuthorDate: Wed May 17 09:17:52 2017 -0400 Commit: Harpreet Kataria <hkataria> CommitDate: Wed May 17 16:13:48 2017 -0400 Need to gsub occurrences of {{ }} in the output Moved gsub logic into a helper method. Having ", ', {{, }} characters in the output was causing an issue while rendering html using ngSanitize directive, needed to escape these characters to get the output to be displayed correctly on screen. Have to gsub " on the first line and then gsub for rest of the characters in a one liner works fine. https://bugzilla.redhat.com/show_bug.cgi?id=1451352 https://bugzilla.redhat.com/show_bug.cgi?id=1444853 app/controllers/service_controller.rb | 13 +++++++++++++ app/views/service/_svcs_show.html.haml | 6 ++---- spec/controllers/service_controller_spec.rb | 7 +++++++ 3 files changed, 22 insertions(+), 4 deletions(-) Standard output is not visible in 5.9.0.2.20171010190026_0413a06. Fixed and verified in 5.9.0.7.20171107212356_ed87902. The standard output is shown. Created attachment 1350656 [details]
Screenshot-Lexer Error
Re-opening, I can still see error. To be precise, I ran playbook 4 times, 2 times I got the output and other 2 times I didn't. Console shows some kind of "Lexer Error".
See Screenshot.
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/daf9ddaed1742b7a95af829a2a5e256a7e52278f commit daf9ddaed1742b7a95af829a2a5e256a7e52278f Author: Harpreet Kataria <hkataria> AuthorDate: Fri Nov 17 14:00:39 2017 -0500 Commit: Harpreet Kataria <hkataria> CommitDate: Fri Nov 17 14:08:37 2017 -0500 escaped \\' in the output to get it to render/display output on screen. https://bugzilla.redhat.com/show_bug.cgi?id=1451352 app/controllers/service_controller.rb | 1 + spec/controllers/service_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) *** Bug 1515508 has been marked as a duplicate of this bug. *** |