Report emails not working - Missing host to link to!

After upgrading foreman (1.9.3) we stopped receiving email reports -
Summaries, host build notices, etc. The errors in cron.log and
production.log consistently show this error:

'Missing host to link to! Please provide the :host parameter, set
default_url_options[:host], or set :only_path to true"

The email.yaml I'm using is pretty simple:

production:
delivery_method: :smtp
smtp_settings:
address: localhost
port: 25
domain: example.com (changed this to our actual domain)
authentication: :none

This worked previously. I gather from looking around a bit this is Rails
problem, but I just can't seem to find the fix.

Any ideas on what might be causing this? Thanks!

You don't say if you upgraded to 1.9 or from 1.9 to a newer version. If
the former, 1.9 changed the email system substantially, so you may have
some changes to make in how you call email tasks.

··· On 14 April 2016 at 18:59, wrote:

After upgrading foreman (1.9.3) we stopped receiving email reports

Can you check under Administer > Settings, that the "foreman_url"
setting is correctly configured? It must be a full URL, e.g.
https://foreman.example.com.

··· On 14/04/16 18:59, matthewhmiller@gmail.com wrote: > > After upgrading foreman (1.9.3) we stopped receiving email reports - > Summaries, host build notices, etc. The errors in cron.log and > production.log consistently show this error: > > 'Missing host to link to! Please provide the :host parameter, set > default_url_options[:host], or set :only_path to true"


Dominic Cleal
dominic@cleal.org

Apologies for the lack of clarity on my part. From 1.8.x to 1.9.3. Every
email task fails with the same error. The "/usr/sbin/foreman-rake
reports:daily" task in cron, and the host build notifications both exhibit
this behavior. It appears that the configuration of email.yaml is
unchanged between versions, what changes are you referring to?

··· On Thursday, April 14, 2016 at 12:59:59 PM UTC-6, Greg Sutcliffe wrote: > > On 14 April 2016 at 18:59, <matthew...@gmail.com > wrote: > >> >> After upgrading foreman (1.9.3) we stopped receiving email reports >> > > You don't say if you upgraded *to* 1.9 or *from* 1.9 to a newer version. > If the former, 1.9 changed the email system substantially, so you may have > some changes to make in how you call email tasks. >

item. The way they're sent is unchanged, so the file is the same, but the
configuration in the UI changed substantially - emails are now per user
and/or host, and need configuring as per
http://www.theforeman.org/manuals/1.9/index.html#4.6EmailManagement

Greg

··· On 14 April 2016 at 20:14, wrote:

Apologies for the lack of clarity on my part. From 1.8.x to 1.9.3. Every
email task fails with the same error. The “/usr/sbin/foreman-rake
reports:daily” task in cron, and the host build notifications both exhibit
this behavior. It appears that the configuration of email.yaml is
unchanged between versions, what changes are you referring to?

http://www.theforeman.org/manuals/1.9/index.html#Headlinefeatures, last

That was it. Just had the hostname in there and not the correct URL.

Thanks for the help guys.

··· On Friday, April 15, 2016 at 1:27:25 AM UTC-6, Dominic Cleal wrote: > > On 14/04/16 18:59, matthew...@gmail.com wrote: > > > > After upgrading foreman (1.9.3) we stopped receiving email reports - > > Summaries, host build notices, etc. The errors in cron.log and > > production.log consistently show this error: > > > > 'Missing host to link to! Please provide the :host parameter, set > > default_url_options[:host], or set :only_path to true" > > Can you check under Administer > Settings, that the "foreman_url" > setting is correctly configured? It must be a full URL, e.g. > https://foreman.example.com. > > -- > Dominic Cleal > dom...@cleal.org >