Issue #22224 has been reported by Patrick Hemmer.

----------------------------------------
Bug #22224: Exec scheduled for refresh never runs
https://projects.puppetlabs.com/issues/22224

* Author: Patrick Hemmer
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: agent
* Target version: 
* Affected Puppet version: 3.2.2
* Keywords: refresh, agent
* Branch: 
----------------------------------------
I have an exec resource which gets scheduled for a refresh due to a subscribe 
rule, however the exec never runs. It has no `unless`/`onlyif`/`creates` 
parameter, only `refreshonly`.

Below is an example of the `puppet agent` run output. Notice the last 3 lines.

<pre>
Info: Applying configuration version 'v g 
55af2aa10a16a0ddff20c656fb2eadcf16864dfb+2:aa3a8da'
Notice: 
/Stage[main]/Cloud::Db/Postgresql::Db[dashboard]/Postgresql::Database[dashboard]/Postgresql_psql[Check
 for existence of db 'dashboard']/command: command changed '' to 'SELECT 1'
Info: 
/Stage[main]/Cloud::Db/Postgresql::Db[dashboard]/Postgresql::Database[dashboard]/Postgresql_psql[Check
 for existence of db 'dashboard']: Scheduling refresh of 
Exec[/usr/lib/postgresql/9.1/bin/createdb --template=template0 --encoding 
'utf8' --locale=C 'dashboard']
Notice: 
/Stage[main]/Cloud::Db/Postgresql::Db[dashboard]/Postgresql::Database[dashboard]/Exec[/usr/lib/postgresql/9.1/bin/createdb
 --template=template0 --encoding 'utf8' --locale=C 'dashboard']: Triggered 
'refresh' from 1 events
Info: 
/Stage[main]/Cloud::Db/Postgresql::Db[dashboard]/Postgresql::Database[dashboard]/Exec[/usr/lib/postgresql/9.1/bin/createdb
 --template=template0 --encoding 'utf8' --locale=C 'dashboard']: Scheduling 
refresh of Postgresql_psql[REVOKE CONNECT ON DATABASE dashboard FROM public]
Notice: 
/Stage[main]/Cloud::Db/Postgresql::Db[dashboard]/Postgresql::Database[dashboard]/Postgresql_psql[REVOKE
 CONNECT ON DATABASE dashboard FROM public]: Triggered 'refresh' from 1 events
Notice: 
/Stage[main]/Cloud::Db/Postgresql::Db[dashboard]/Postgresql::Database_grant[GRANT
 dashboard - ALL - dashboard]/Postgresql_psql[GRANT ALL ON database dashboard 
TO dashboard]/command: command changed '' to 'GRANT ALL ON database dashboard 
TO dashboard'
Info: Postgresql::Db[dashboard]: Scheduling refresh of Exec[rake db:setup]
Notice: 
/Stage[main]/Cloud::Db/Cloud::Db::Extension[hstore]/Exec[postgres-dashboard 
extension hstore]/returns: executed successfully
Notice: Finished catalog run in 100.17 seconds
</pre>


I can reproduce this every time, however I have been unable to duplicate this 
in a small stripped down config, and I can't share my entire repo. So I can 
gather additional info as requested.

Attached is the `puppet agent -td --debug --evaltrace` output.

This is what the resource looks like:
<pre>
    exec { 'rake db:setup':
      provider    => 'shell',
      refreshonly => true,
      user        => $::cloud::app::base::user,
      cwd         => "/webapps/$app_name/current",
      environment => [ "HOME=/webapps/$app_name/current/tmp" ],
      command     => ". config/env; bundle exec rake $task",
      subscribe   => Postgresql::Db[$cloud::db::db_name],
      require     => [ Class['cloud::db'], Class[$app_class], ],
    }
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to