Bug 1209557 - Emails triggered by CFME does not have anything in the body
Summary: Emails triggered by CFME does not have anything in the body
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Control
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.4.0
Assignee: mkanoor
QA Contact: Ramesh A
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-07 16:09 UTC by Ramesh A
Modified: 2016-09-13 06:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-16 12:57:05 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:
rananda: automate_bug-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1100 0 normal SHIPPED_LIVE CFME 5.4.0 bug fixes, and enhancement update 2015-06-16 16:28:42 UTC

Description Ramesh A 2015-04-07 16:09:17 UTC
Description of problem:
Emails triggered by CFME does not contain anything in the body

Version-Release number of selected component (if applicable):
5.4.0.0.14.20150325124454_9e339f3 

How reproducible:
100%

Steps to Reproduce:
Send/Trigger an email from CFME using any means.  For example from Control policies and actions or say from Cloud Intelligence ==> Reports ==> Schedule Reports


Actual results:
Email body is blank

Expected results:
Should contain the email body explaining the details.  For example, email details from alert trigger from policy profile used to display message something like this: 

Alert Triggered

Alert 'VM Silver and CPU > 1', triggered

Event:	Alert condition met
Entity:	(VmRedhat) test-ramesh-prov


Additional info:
No Error is found in the evm.log file for not sending the email

Comment 2 Milan Falešník 2015-04-07 17:59:16 UTC
I also noticed that the VM provisioning e-mails have no body while they used to have the body before.

Comment 3 Greg McCullough 2015-04-08 15:26:19 UTC
Madhu - I would suggest trying to triage this in Milan's environment if it is available.  Tina would be able to help with this as well.

Comment 4 mkanoor 2015-04-09 18:40:24 UTC
Hello,
Can we get a copy of the evm.log and automation.log file.
Thanks
Madhu

Comment 6 mkanoor 2015-04-13 13:41:58 UTC
This problem started happening since we converted from era's to haml's. The email body is sent using views defined in app/views/generic_mailer. When we converted from views defined in erb to haml, the only change that needs to be made is

require 'haml-rails'

Today we include this file only for the ui worker, defined in vmdb/lib/vmdb/initializer.rb

if MiqEnvironment::Process.is_web_server_worker?
          require 'haml-rails'

So only the web server worker can send emails with body, since all the other workers are still looking for the erb files, they can't send emails with body.

Deep inside the action mailer the UI worker shows the following handlers
  :handlers => {.erb,.builder,.jbuilder,.rjs,.haml,}
While the other workers show clearly missing the .haml file
  :handlers=>[:erb, :builder, :jbuilder, :rjs]}

Adding a require 'haml-rails' to the app/mailers/generic_mailer.rb solves the problem but the bigger question is can we fix the initializer.rb to do an unconditional 

require 'haml-rails'

Comment 7 CFME Bot 2015-04-14 18:06:46 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/62c2563fe3392ee24b2424ca5d432feb6c52926f

commit 62c2563fe3392ee24b2424ca5d432feb6c52926f
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Mon Apr 13 13:59:49 2015 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Mon Apr 13 13:59:49 2015 -0400

    Non UI workers can't send email bodies
    
    Only the UI worker had the require 'haml-rails' so emails sent from
    the UI had the body, but if a non ui worker like automate sent the
    email it wont have the body. The specs have the require 'haml-rails'
    so they always worked.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1209557

 vmdb/app/mailers/generic_mailer.rb | 1 +
 1 file changed, 1 insertion(+)

Comment 9 Ramesh A 2015-04-23 10:57:25 UTC
Good to go.  Verified and working fine in 5.4.0.0.22.20150420163946_26004d1

Comment 11 errata-xmlrpc 2015-06-16 12:57:05 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://rhn.redhat.com/errata/RHBA-2015-1100.html


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