Issue #16082 has been updated by Chris Price.

Eric S: I got bitten by this one this weekend as well.  I can repro it in 2.7.x 
and 3.0.1.  It's causing me problems trying to write a custom type/provider, 
but you can repro it with built-in types using a manifest like this one:

    notify { "hi": }

    exec { "/bin/foo":
        refreshonly => true,
        subscribe   => Notify["hi"],
    }

Then run that with `puppet apply --detailed-exitcodes`:

    $ puppet apply --detailed-exitcodes ./foo2.pp 
    No LSB modules are available.
    No LSB modules are available.
    hi
    /Stage[main]//Notify[hi]/message: defined 'message' as 'hi'
    Error: /Stage[main]//Exec[/bin/foo]: Failed to call refresh: Could not find 
command '/bin/foo'                                                              
                          
    Error: /Stage[main]//Exec[/bin/foo]: Could not find command '/bin/foo'
    Finished catalog run in 0.15 seconds
    $ echo $?
    2
    $ 

It definitely seems like the exit code there should be '4' or '6'.
----------------------------------------
Bug #16082: Puppet agent with --detailed-exitcodes returns exit code 2 even if 
errors are encountered applying the catalog.
https://projects.puppetlabs.com/issues/16082#change-75728

Author: Eric Pratt
Status: Needs More Information
Priority: Normal
Assignee: Eric Pratt
Category: usability
Target version: 
Affected Puppet version: 2.6.4
Keywords: errors
Branch: 


The command I run is:

`/usr/bin/puppet agent --onetime --verbose --ignorecache --no-daemonize 
--no-usecacheonfailure --color=false --detailed-exitcodes`

One of my execs executes a shell script which is returning a non-zero error 
code.  The verbose output shows this:

`err: 
/Stage[main]/Etp::Install/Etp::Deploy[discovery]/Exec[migrate-discovery-db]: 
Failed to call refresh: /usr/local/etp/bin/migrate_db.sh 
/home/etpdiscovery/conf /home/etpdiscovery/db /home/etpdiscovery/datagen 
disco.master.ben.xml returned 21 instead of one of [0] at 
/home/configmgr/puppet-trunk/etouchpoint-systems/src/main/puppet/modules/etp/manifests/deploy.pp:561`

Because a lot of changes are being made when this error happens, I expect to 
see an exit code of '6' but I get a '2' every time.  Even if no changes are 
made and this exec fails, I expect to see a '4'.


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to