Error in email reports: undefined method

after moving my foreman installation to rhel6 and foreman-0.4-0.2 i
can no longer send email reports. I am pretty lost with ruby and my
efforts to resolve the problem has been to no avail. Any suggestions
anyone?

··· -------------------------------------- email.yaml:

production:
delivery_method: :smtp
smtp_settings:
address: smtp.smhi.se
port: 25
domain: smhi.se
authentication: :none

[# root]# cd /usr/share/foreman;rake reports:summarize --trace
RAILS_ENV=“production” hours=24
(in /usr/share/foreman)
** Invoke reports:summarize (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute reports:summarize
rake aborted!
undefined method []' for #<Class:0x7f3d157e2cd8> /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ named_scopes/conditions.rb:81:inmethod_missing’
/usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/
named_scopes/association_conditions.rb:19:in method_missing' /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ named_scopes/association_ordering.rb:27:inmethod_missing’
/usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/
named_scopes/ordering.rb:30:in method_missing' /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ named_scopes/or_conditions.rb:28:inmethod_missing’
/usr/share/foreman/vendor/rails/activerecord/lib/active_record/base.rb:
1998:in method_missing_without_paginate' /usr/share/foreman/vendor/plugins/will_paginate/lib/will_paginate/ finder.rb:170:inmethod_missing’
/usr/share/foreman/app/models/host_mailer.rb:11:in summary' /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: 492:insend
/usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb:
492:in create!' /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: 485:ininitialize’
/usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb:
428:in new' /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: 428:inmethod_missing’
/usr/share/foreman/lib/tasks/reports.rake:78
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:inexecute’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:inexecute’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:insynchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:589:in
invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:582:ininvoke’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in
invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:intop_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:intop_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2022:intop_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:instandard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:inload’
/usr/bin/rake:19

Can the new server send email normally? I don't actually even have an
email.yaml at the moment, and my foreman reports seem to send just
fine:

rake reports:summarize --trace RAILS_ENV="production" hours=24 email=redacted

(in /usr/share/foreman.git)
** Invoke reports:summarize (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute reports:summarize

··· On 25 November 2011 13:35, AdamW wrote: > after moving my foreman installation to rhel6 and foreman-0.4-0.2 i > can no longer send email reports. I am pretty lost with ruby and my > efforts to resolve the problem has been to no avail. Any suggestions > anyone?

Did you figure it out? going over the trace it might look like your
database was never migrated?

Ohad

··· On Fri, Nov 25, 2011 at 3:35 PM, AdamW wrote: > after moving my foreman installation to rhel6 and foreman-0.4-0.2 i > can no longer send email reports. I am pretty lost with ruby and my > efforts to resolve the problem has been to no avail. Any suggestions > anyone? > > -------------------------------------- > email.yaml: > > production: > delivery_method: :smtp > smtp_settings: > address: smtp.smhi.se > port: 25 > domain: smhi.se > authentication: :none > -------------------------------------- > > [# root]# cd /usr/share/foreman;rake reports:summarize --trace > RAILS_ENV="production" hours=24 > (in /usr/share/foreman) > ** Invoke reports:summarize (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute reports:summarize > rake aborted! > undefined method `[]' for # > /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ > named_scopes/conditions.rb:81:in `method_missing' > /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ > named_scopes/association_conditions.rb:19:in `method_missing' > /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ > named_scopes/association_ordering.rb:27:in `method_missing' > /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ > named_scopes/ordering.rb:30:in `method_missing' > /usr/share/foreman/vendor/plugins/searchlogic/lib/searchlogic/ > named_scopes/or_conditions.rb:28:in `method_missing' > /usr/share/foreman/vendor/rails/activerecord/lib/active_record/base.rb: > 1998:in `method_missing_without_paginate' > /usr/share/foreman/vendor/plugins/will_paginate/lib/will_paginate/ > finder.rb:170:in `method_missing' > /usr/share/foreman/app/models/host_mailer.rb:11:in `summary' > /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: > 492:in `__send__' > /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: > 492:in `create!' > /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: > 485:in `initialize' > /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: > 428:in `new' > /usr/share/foreman/vendor/rails/actionmailer/lib/action_mailer/base.rb: > 428:in `method_missing' > /usr/share/foreman/lib/tasks/reports.rake:78 > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in `call' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in `execute' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in `each' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in `execute' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in > `invoke_with_call_chain' > /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:589:in > `invoke_with_call_chain' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:582:in `invoke' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in > `invoke_task' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `top_level' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `each' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `top_level' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in > `standard_exception_handling' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2022:in `top_level' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in > `standard_exception_handling' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:in `run' > /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 > /usr/bin/rake:19:in `load' > /usr/bin/rake:19 > > --

Thanks for the reply!

>
> Can the new server send email normally?
>

I can email fine from commandline and in that regard this server is
not set up different from the rhel5 on which i ran foreman before. I
would also believe that if the servers mailing capabilities were the
problem i would not get an 'undefined method' error from ruby, but i
may be mistaken.

> I don't actually even have an
> email.yaml at the moment, and my foreman reports seem to send just
> fine:

I have tried different setups in the email.yaml and now also tried to
remove it completely but still get the same trace output. Good test
though to rule out errors with my email.yaml config.

>
> Did you figure it out? going over the trace it might look like your
> database was never migrated?
>
> Ohad

I still have the same problem. Running a
"rake db:migrate RAILS_ENV="production"

executes with no problem and i dont have any other problems with the
foreman installation, except the mail reports. Could there still be
any problem with the database?

/Adam

>>
>> Did you figure it out? going over the trace it might look like your
>> database was never migrated?
>>
>> Ohad
>
> I still have the same problem. Running a
> "rake db:migrate RAILS_ENV="production"
>
> executes with no problem and i dont have any other problems with the
> foreman installation, except the mail reports. Could there still be
> any problem with the database?

probably not, does simply RAILS_ENV=production rake reports:summarize work?

··· On Mon, Nov 28, 2011 at 11:57 AM, AdamW wrote:

/Adam


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

>
> does simply RAILS_ENV=production rake reports:summarize work?
>

No, same error. I have made a small adjustment to the original code
though, in /usr/share/foreman/config/initializers/
new_rails_defaults.rb i have added:

··· --- def PGconn.quote_ident(name) %("#{name}") end --- since i run the db on postgres. if i remove it i get a different error: rake aborted! undefined method `quote_ident' for PGconn:Class

i dont feel like that should be relevant, but you never know.

> Still having this problem, no one else seeing this? Installed
> foreman-0.4.2 hoping it would disappear but no luck. :frowning:
>
> Grateful for any ideas i can try.
>
> //Adam

>>
>> does simply RAILS_ENV=production rake reports:summarize work?
>>
>
> No, same error. I have made a small adjustment to the original code
> though, in /usr/share/foreman/config/initializers/
> new_rails_defaults.rb i have added:
where does this file comes from? afaik, this is not part of foreman.

I would suggest that you try on another clean machine to see if this
still the issue.

Ohad

··· On Mon, Nov 28, 2011 at 12:30 PM, AdamW wrote: > --- > def PGconn.quote_ident(name) > %("#{name}") end > --- > since i run the db on postgres. if i remove it i get a different > error: > rake aborted! > undefined method `quote_ident' for PGconn:Class > > i dont feel like that should be relevant, but you never know. > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

well, the file is listed as part of the foreman rpm:

[root@lxserv293 ~]# rpm -qf
/usr/share/foreman/config/initializers/new_rails_defaults.rb
foreman-0.4.2-0.1.noarch
[root@lxserv293 ~]# rpm -qi foreman
Name : foreman Relocations: (not relocatable)
Version : 0.4.2 Vendor: (none)
Release : 0.1 Build Date: Wed 11 Jan 2012
10:02:47 AM UTC
Install Date: Wed 07 Mar 2012 11:43:56 AM UTC Build Host:
li242-203.members.linode.com
Group : Applications/System Source RPM:
foreman-0.4.2-0.1.src.rpm
Size : 9426513 License: GPLv3+
Signature : (none)
URL : http://theforeman.org
Summary : Systems Management web application
Description :
Foreman is aimed to be a Single Address For All Machines Life Cycle
Management.
Foreman is based on Ruby on Rails, and this package bundles Rails and all
plugins required for Foreman to work.

I will try a new install and see what happens.

//Adam

··· On 13 March 2012 08:19, Ohad Levy wrote:

On Mon, Nov 28, 2011 at 12:30 PM, AdamW adam.winberg@gmail.com wrote:

does simply RAILS_ENV=production rake reports:summarize work?

No, same error. I have made a small adjustment to the original code
though, in /usr/share/foreman/config/initializers/
new_rails_defaults.rb i have added:
where does this file comes from? afaik, this is not part of foreman.

I would suggest that you try on another clean machine to see if this
still the issue.

Ohad


def PGconn.quote_ident(name)
%("#{name}") end

since i run the db on postgres. if i remove it i get a different
error:
rake aborted!
undefined method `quote_ident’ for PGconn:Class

i dont feel like that should be relevant, but you never know.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

> well, the file is listed as part of the foreman rpm:

Yep, sorry about that, I only checked the latest develop code, which
does not include this file (this was removed as part of migrating from
rails2 to rails3).

Ohad

··· On Tue, Mar 13, 2012 at 9:53 AM, Adam Winberg wrote: > > [root@lxserv293 ~]# rpm -qf > /usr/share/foreman/config/initializers/new_rails_defaults.rb > foreman-0.4.2-0.1.noarch > [root@lxserv293 ~]# rpm -qi foreman > Name : foreman Relocations: (not relocatable) > Version : 0.4.2 Vendor: (none) > Release : 0.1 Build Date: Wed 11 Jan 2012 > 10:02:47 AM UTC > Install Date: Wed 07 Mar 2012 11:43:56 AM UTC Build Host: > li242-203.members.linode.com > Group : Applications/System Source RPM: > foreman-0.4.2-0.1.src.rpm > Size : 9426513 License: GPLv3+ > Signature : (none) > URL : http://theforeman.org > Summary : Systems Management web application > Description : > Foreman is aimed to be a Single Address For All Machines Life Cycle > Management. > Foreman is based on Ruby on Rails, and this package bundles Rails and all > plugins required for Foreman to work. > > > I will try a new install and see what happens. > > //Adam > > > On 13 March 2012 08:19, Ohad Levy wrote: >> >> On Mon, Nov 28, 2011 at 12:30 PM, AdamW wrote: >> >> >> >> does simply RAILS_ENV=production rake reports:summarize work? >> >> >> > >> > No, same error. I have made a small adjustment to the original code >> > though, in /usr/share/foreman/config/initializers/ >> > new_rails_defaults.rb i have added: >> where does this file comes from? afaik, this is not part of foreman. >> >> I would suggest that you try on another clean machine to see if this >> still the issue. >> >> Ohad >> > --- >> > def PGconn.quote_ident(name) >> > %("#{name}") end >> > --- >> > since i run the db on postgres. if i remove it i get a different >> > error: >> > rake aborted! >> > undefined method `quote_ident' for PGconn:Class >> > >> > i dont feel like that should be relevant, but you never know. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Foreman users" group. >> > To post to this group, send email to foreman-users@googlegroups.com. >> > To unsubscribe from this group, send email to >> > foreman-users+unsubscribe@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/foreman-users?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To post to this group, send email to foreman-users@googlegroups.com. >> To unsubscribe from this group, send email to >> foreman-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/foreman-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

i finally installed a new lab instance of foreman and email with rake
worked as expected. I have now been able to pinpoint exactly where things
go wrong in my production foreman instance. If I comment out line 4 in

/usr/share/foreman/app/models/setting.rb
(acts_as_audited :only => [:value], :on => [:update])

emailing works ( i should note that automated error report emails from
foreman has worked all along, but i had an old administrator mail address
in my config which confused me. However manual emailing with rake as
described in
Mail Notifications - Foreman did
not work).

I dont know what makes the above line crash the rake action but maybe you
guys with this more detailed information can help me out. What am I missing?

//Adam

··· On 13 March 2012 08:58, Ohad Levy wrote:

On Tue, Mar 13, 2012 at 9:53 AM, Adam Winberg adam.winberg@gmail.com > wrote:

well, the file is listed as part of the foreman rpm:

Yep, sorry about that, I only checked the latest develop code, which
does not include this file (this was removed as part of migrating from
rails2 to rails3).

Ohad

[root@lxserv293 ~]# rpm -qf
/usr/share/foreman/config/initializers/new_rails_defaults.rb
foreman-0.4.2-0.1.noarch
[root@lxserv293 ~]# rpm -qi foreman
Name : foreman Relocations: (not relocatable)
Version : 0.4.2 Vendor: (none)
Release : 0.1 Build Date: Wed 11 Jan 2012
10:02:47 AM UTC
Install Date: Wed 07 Mar 2012 11:43:56 AM UTC Build Host:
li242-203.members.linode.com
Group : Applications/System Source RPM:
foreman-0.4.2-0.1.src.rpm
Size : 9426513 License: GPLv3+
Signature : (none)
URL : http://theforeman.org
Summary : Systems Management web application
Description :
Foreman is aimed to be a Single Address For All Machines Life Cycle
Management.
Foreman is based on Ruby on Rails, and this package bundles Rails and all
plugins required for Foreman to work.

I will try a new install and see what happens.

//Adam

On 13 March 2012 08:19, Ohad Levy ohadlevy@gmail.com wrote:

On Mon, Nov 28, 2011 at 12:30 PM, AdamW adam.winberg@gmail.com wrote:

does simply RAILS_ENV=production rake reports:summarize work?

No, same error. I have made a small adjustment to the original code
though, in /usr/share/foreman/config/initializers/
new_rails_defaults.rb i have added:
where does this file comes from? afaik, this is not part of foreman.

I would suggest that you try on another clean machine to see if this
still the issue.

Ohad


def PGconn.quote_ident(name)
%("#{name}") end

since i run the db on postgres. if i remove it i get a different
error:
rake aborted!
undefined method `quote_ident’ for PGconn:Class

i dont feel like that should be relevant, but you never know.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google
Groups

“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

> i finally installed a new lab instance of foreman and email with rake
> worked as expected. I have now been able to pinpoint exactly where
> things go wrong in my production foreman instance. If I comment out
> line 4 in
>
> /usr/share/foreman/app/models/setting.rb
> (acts_as_audited :only => [:value], :on => [:update])
>
> emailing works ( i should note that automated error report emails from
> foreman has worked all along, but i had an old administrator mail
> address in my config which confused me. However manual emailing with
> rake as described in
> Mail Notifications - Foreman
> did not work).
>
> I dont know what makes the above line crash the rake action but maybe
> you guys with this more detailed information can help me out. What am
> I missing?

as its a bit hard for me to follow through, and since you already got a
test box running, do you mind upgrading your instance to 0.5rc that
found here http://people.redhat.com/jmontleo/foreman/ and see if you can
reproduce it?

thanks!
Ohad

··· On 05/14/2012 01:41 PM, Adam Winberg wrote: > > //Adam > > > On 13 March 2012 08:58, Ohad Levy > wrote: > > On Tue, Mar 13, 2012 at 9:53 AM, Adam Winberg > <adam.winberg@gmail.com > wrote: > > well, the file is listed as part of the foreman rpm: > > Yep, sorry about that, I only checked the latest develop code, which > does not include this file (this was removed as part of migrating from > rails2 to rails3). > > Ohad > > > > [root@lxserv293 ~]# rpm -qf > > /usr/share/foreman/config/initializers/new_rails_defaults.rb > > foreman-0.4.2-0.1.noarch > > [root@lxserv293 ~]# rpm -qi foreman > > Name : foreman Relocations: (not > relocatable) > > Version : 0.4.2 Vendor: (none) > > Release : 0.1 Build Date: Wed 11 > Jan 2012 > > 10:02:47 AM UTC > > Install Date: Wed 07 Mar 2012 11:43:56 AM UTC Build Host: > > li242-203.members.linode.com > > Group : Applications/System Source RPM: > > foreman-0.4.2-0.1.src.rpm > > Size : 9426513 License: GPLv3+ > > Signature : (none) > > URL : http://theforeman.org > > Summary : Systems Management web application > > Description : > > Foreman is aimed to be a Single Address For All Machines Life Cycle > > Management. > > Foreman is based on Ruby on Rails, and this package bundles > Rails and all > > plugins required for Foreman to work. > > > > > > I will try a new install and see what happens. > > > > //Adam > > > > > > On 13 March 2012 08:19, Ohad Levy > wrote: > >> > >> On Mon, Nov 28, 2011 at 12:30 PM, AdamW > wrote: > >> >> > >> >> does simply RAILS_ENV=production rake reports:summarize work? > >> >> > >> > > >> > No, same error. I have made a small adjustment to the > original code > >> > though, in /usr/share/foreman/config/initializers/ > >> > new_rails_defaults.rb i have added: > >> where does this file comes from? afaik, this is not part of > foreman. > >> > >> I would suggest that you try on another clean machine to see if > this > >> still the issue. > >> > >> Ohad > >> > --- > >> > def PGconn.quote_ident(name) > >> > %("#{name}") end > >> > --- > >> > since i run the db on postgres. if i remove it i get a different > >> > error: > >> > rake aborted! > >> > undefined method `quote_ident' for PGconn:Class > >> > > >> > i dont feel like that should be relevant, but you never know. > >> > > >> > -- > >> > You received this message because you are subscribed to the > Google > >> > Groups "Foreman users" group. > >> > To post to this group, send email to > foreman-users@googlegroups.com > . > >> > To unsubscribe from this group, send email to > >> > foreman-users+unsubscribe@googlegroups.com > . > >> > For more options, visit this group at > >> > http://groups.google.com/group/foreman-users?hl=en. > >> > > >> > >> -- > >> You received this message because you are subscribed to the > Google Groups > >> "Foreman users" group. > >> To post to this group, send email to > foreman-users@googlegroups.com > . > >> To unsubscribe from this group, send email to > >> foreman-users+unsubscribe@googlegroups.com > . > >> For more options, visit this group at > >> http://groups.google.com/group/foreman-users?hl=en. > >> > > > > -- > > You received this message because you are subscribed to the > Google Groups > > "Foreman users" group. > > To post to this group, send email to > foreman-users@googlegroups.com > . > > To unsubscribe from this group, send email to > > foreman-users+unsubscribe@googlegroups.com > . > > For more options, visit this group at > > http://groups.google.com/group/foreman-users?hl=en. > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To post to this group, send email to > foreman-users@googlegroups.com > . > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en. > > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

thanks for feedback!

well, emailing works fine on my test box, i havent been able to reproduce
the problem there. The problem only shows in my production box, and i cant
find whats different. I've tried reinstalling foreman and resetting
permissions/ownership but to no avail. i'm a bit reluctant to upgrading my
production box to 0.5 at this stage, since it is not in stable yet.

I guess i can live with my ugly workaround for the time being, since we
only use foreman for inventory the auditing function is not really
important for us. I will check again after upgrade to stable 0.5 if that
makes a difference.

//Adam

··· On 15 May 2012 07:37, Ohad Levy wrote:

On 05/14/2012 01:41 PM, Adam Winberg wrote:

i finally installed a new lab instance of foreman and email with rake
worked as expected. I have now been able to pinpoint exactly where things
go wrong in my production foreman instance. If I comment out line 4 in

/usr/share/foreman/app/models/setting.rb
(acts_as_audited :only => [:value], :on => [:update])

emailing works ( i should note that automated error report emails from
foreman has worked all along, but i had an old administrator mail address
in my config which confused me. However manual emailing with rake as
described in
Mail Notifications - Foreman did
not work).

I dont know what makes the above line crash the rake action but maybe you
guys with this more detailed information can help me out. What am I missing?

as its a bit hard for me to follow through, and since you already got a
test box running, do you mind upgrading your instance to 0.5rc that found
here http://people.redhat.com/jmontleo/foreman/ and see if you can
reproduce it?

thanks!
Ohad

//Adam

On 13 March 2012 08:58, Ohad Levy ohadlevy@gmail.com wrote:

On Tue, Mar 13, 2012 at 9:53 AM, Adam Winberg adam.winberg@gmail.com >> wrote:

well, the file is listed as part of the foreman rpm:

Yep, sorry about that, I only checked the latest develop code, which
does not include this file (this was removed as part of migrating from
rails2 to rails3).

Ohad

[root@lxserv293 ~]# rpm -qf
/usr/share/foreman/config/initializers/new_rails_defaults.rb
foreman-0.4.2-0.1.noarch
[root@lxserv293 ~]# rpm -qi foreman
Name : foreman Relocations: (not
relocatable)
Version : 0.4.2 Vendor: (none)
Release : 0.1 Build Date: Wed 11 Jan 2012
10:02:47 AM UTC
Install Date: Wed 07 Mar 2012 11:43:56 AM UTC Build Host:
li242-203.members.linode.com
Group : Applications/System Source RPM:
foreman-0.4.2-0.1.src.rpm
Size : 9426513 License: GPLv3+
Signature : (none)
URL : http://theforeman.org
Summary : Systems Management web application
Description :
Foreman is aimed to be a Single Address For All Machines Life Cycle
Management.
Foreman is based on Ruby on Rails, and this package bundles Rails and
all
plugins required for Foreman to work.

I will try a new install and see what happens.

//Adam

On 13 March 2012 08:19, Ohad Levy ohadlevy@gmail.com wrote:

On Mon, Nov 28, 2011 at 12:30 PM, AdamW adam.winberg@gmail.com >> wrote:

does simply RAILS_ENV=production rake reports:summarize work?

No, same error. I have made a small adjustment to the original code
though, in /usr/share/foreman/config/initializers/
new_rails_defaults.rb i have added:
where does this file comes from? afaik, this is not part of foreman.

I would suggest that you try on another clean machine to see if this
still the issue.

Ohad


def PGconn.quote_ident(name)
%("#{name}") end

since i run the db on postgres. if i remove it i get a different
error:
rake aborted!
undefined method `quote_ident’ for PGconn:Class

i dont feel like that should be relevant, but you never know.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google
Groups

“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google
Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.