Bug 1016393 - puppet:Command 'puppet agent --test' returned non-zero eixt status 1
puppet:Command 'puppet agent --test' returned non-zero eixt status 1
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ovirt-node (Show other bugs)
6.5
Unspecified Unspecified
high Severity high
: rc
: 6.5
Assigned To: Ryan Barry
Virtualization Bugs
:
Depends On: 1003440
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-08 01:59 EDT by haiyang,dong
Modified: 2014-01-21 14:52 EST (History)
18 users (show)

See Also:
Fixed In Version: ovirt-node-3.0.1-5.el6
Doc Type: Bug Fix
Doc Text:
Due to differences in file locations between Fedora and RHEL 6, the Puppet plugin patched an incorrect file location for Facter, and did not parse output properly, so a non-zero exit code was returned.
Story Points: ---
Clone Of: 1003440
Environment:
Last Closed: 2014-01-21 14:52:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description haiyang,dong 2013-10-08 01:59:46 EDT
+++ This bug was initially created as a clone of Bug #1003440 +++

Description of problem:
Using edit-node install ovirt-node-plugin-puppet into ovirt-node-iso and clean install this
iso .Login it and enter into puppet page, configure 
Puppet Server:master.example.com
Puppet Certificate Name: agent2.example.com

after clicking "Save" button to apply this configuration. check that: 
[root@agent2 admin]# cat /etc/puppet/puppet.conf |more
[main]
    server = "master.example.com"
    certname = "agent2.example.com"
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet
.....

But Configuring puppet page prompt that "Command 'puppet agent --test' returned non-zero eixt status 1"
(seen Configuring puppet page.png)

[root@agent2 admin]# puppet agent --test
Error: Could not autoload puppet/provider/user/useradd: undefined local variable or method `ovirt' for main:Object
Error: Could not autoload puppet/provider/user/hpux: Could not autoload puppet/provider/user/useradd: undefined local variable or method `ovirt' for main:Object
Error: Could not autoload puppet/type/user: Could not autoload puppet/provider/user/hpux: Could not autoload puppet/provider/user/useradd: undefined local variable or method `ovirt' for main:Object
Error: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: Could not autoload puppet/type/user: Could not autoload puppet/provider/user/hpux: Could not autoload puppet/provider/user/useradd: undefined local variable or method `ovirt' for main:Object
Error: Could not prepare for execution: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: Could not autoload puppet/type/user: Could not autoload puppet/provider/user/hpux: Could not autoload puppet/provider/user/useradd: undefined local variable or method `ovirt' for main:Object
Could not autoload puppet/type/user: Could not autoload puppet/provider/user/hpux: Could not autoload puppet/provider/user/useradd: undefined local variable or method `ovirt' for main:Object

Version-Release number of selected component (if applicable):
ovirt-node-iso-3.1.0-0.999.999.20130830222205git32d308e.480.fc18.iso
ovirt-node-plugin-puppet-3.1.0-0.999.20130830222205git32d308e.fc18.noarch.rpm

How reproducible:
100% 
 
Steps to Reproduce:

Actual result:
Command 'puppet agent --test' returned non-zero exit status 1

Expect result:
Command 'puppet agent --test' execute success and start service puppet success


Additional info:

--
Comment 1 haiyang,dong 2013-10-08 02:04:28 EDT
Could reproduce this bug on the follow version:
rhev-hypervisor6-6.5-20130930.0.auto665.el6.iso        
ovirt-node-3.0.1-3.el6.noarch
ovirt-node-plugin-puppet-3.0.1-3.el6.noarch.rpm
puppet-2.6.18-3.el6.noarch


[root@dhcp-9-230 admin]# puppet agent --test
err: /File[/var/lib/puppet/clientbucket]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/clientbucket
err: /File[/var/lib/puppet/ssl]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/ssl
notice: /File[/var/lib/puppet/ssl/private]: Dependency File[/var/lib/puppet/ssl] has failures: true
warning: /File[/var/lib/puppet/ssl/private]: Skipping because of failed dependencies
notice: /File[/var/lib/puppet/ssl/certificate_requests]: Dependency File[/var/lib/puppet/ssl] has failures: true
warning: /File[/var/lib/puppet/ssl/certificate_requests]: Skipping because of failed dependencies
notice: /File[/var/lib/puppet/ssl/certs]: Dependency File[/var/lib/puppet/ssl] has failures: true
warning: /File[/var/lib/puppet/ssl/certs]: Skipping because of failed dependencies
notice: /File[/var/lib/puppet/ssl/public_keys]: Dependency File[/var/lib/puppet/ssl] has failures: true
warning: /File[/var/lib/puppet/ssl/public_keys]: Skipping because of failed dependencies
notice: /File[/var/lib/puppet/ssl/private_keys]: Dependency File[/var/lib/puppet/ssl] has failures: true
warning: /File[/var/lib/puppet/ssl/private_keys]: Skipping because of failed dependencies
err: /File[/var/lib/puppet/lib]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/lib
err: /File[/var/lib/puppet/client_data]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/client_data
err: /File[/var/lib/puppet/client_yaml]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/client_yaml
err: /File[/var/lib/puppet/state]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/state
notice: /File[/var/lib/puppet/state/graphs]: Dependency File[/var/lib/puppet/state] has failures: true
warning: /File[/var/lib/puppet/state/graphs]: Skipping because of failed dependencies
Could not prepare for execution: Got 6 failure(s) while initializing: change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/clientbucket; change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/ssl; change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/lib; change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/client_data; change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/client_yaml; change from absent to directory failed: Could not set 'directory on ensure: Read-only file system - /var/lib/puppet/state
Comment 5 haiyang,dong 2013-10-27 03:07:26 EDT
Test version:
rhevh-6.5-20131024.1.0.iso
ovirt-node-3.0.1-6.el6.noarch
ovirt-node-tools-3.0.1-6.el6.noarch
ovirt-node-plugin-puppet-3.0.1-6.el6.noarch.rpm

Using edit-node install ovirt-node-plugin-puppet into rhevh-6.5-20131024.1.0.iso and clean install this
iso .Login it and configure puppet
with in follow steps in shell console:
1.edit /etc/puppet/puppet.conf
[main]
    server = "dhcp-10-214.nay.redhat.com"
    certname = "dhcp-9-200.nay.redhat.com"
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

2.Command 'puppet agent --test' execute:
[root@dhcp-9-200 admin]# puppet agent --test
info: Creating a new SSL key for dhcp-9-200.nay.redhat.com
info: Caching certificate for ca
info: Creating a new SSL certificate request for dhcp-9-200.nay.redhat.com
info: Certificate Request fingerprint (md5): 51:01:3D:70:89:17:E1:18:64:2B:85:39:25:2E:FA:EC
Exiting; no certificate found and waitforcert is disabled

3. Sign Node Certificates in puppet master server:
[root@dhcp-10-214 manifests]# puppet cert list
"dhcp-9-200.nay.redhat.com" (51:01:3D:70:89:17:E1:18:64:2B:85:39:25:2E:FA:EC)
[root@dhcp-10-214 manifests]# 
[root@dhcp-10-214 manifests]# puppet cert sign --all
notice: Signed certificate request for dhcp-9-200.nay.redhat.com
notice: Removing file Puppet::SSL::CertificateRequest dhcp-9-200.nay.redhat.com at '/var/lib/puppet/ssl/ca/requests/dhcp-9-200.nay.redhat.com.pem

4.Execute command 'puppet agent --test' in rhev-h shell console again:

[root@dhcp-9-200 admin]# puppet agent --test
info: Caching certificate for dhcp-9-200.nay.redhat.com
info: Loading facts in ovirt
info: Loading facts in ovirt
Could not retrieve operatingsystemrelease: uninitialized constant FileText
Could not retrieve operatingsystemrelease: uninitialized constant FileText
info: Caching certificate_revocation_list for ca
info: Caching catalog for dhcp-9-200.nay.redhat.com
info: Applying configuration version '1382570972'
notice: /Stage[main]//Node[default]/File[/tmp/test]/ensure: defined content as '{md5}b1946ac92492d2347c6235b4d2611184'
info: Creating state file /var/lib/puppet/state/state.yaml
notice: Finished catalog run in 0.01 seconds

5. start service puppet in rhev-h shell console
[root@dhcp-9-200 admin]# service puppet start
Starting puppet:                                           [  OK  ]

so the Command 'puppet agent --test' returned non-zero eixt status 1 issue has been fixed, but still met it when configuring puppet via TUI page, this is due to "Bug 1016373 - Met clear /etc/puppet/puppet.conf issue", need waiting for Bug 1016373 to been fixed to verify this bug.
Comment 8 Cheryn Tan 2013-11-07 19:34:24 EST
This bug is currently attached to errata RHBA-2013:15277. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.
Comment 9 haiyang,dong 2013-12-16 02:53:42 EST
Test version:
ovirt-node-3.0.1-9.el6_5.noarch.rpm
rhevh-6.5-20131213.0.0.iso

Follow https://bugzilla.redhat.com/show_bug.cgi?id=1016393#c5 test steps,the Command 'puppet agent --test' returned non-zero eixt status 1 issue has been fixed.
so change the status into "verified".
Comment 10 haiyang,dong 2014-01-16 05:12:52 EST
Also this bug was fixed in the follow version:
rhevh-6.5-20140110.1
ovirt-node-3.0.1-16.el6_5.noarch
ovirt-node-plugin-puppet-3.0.1-16.el6_5.noarch.rpm
Comment 12 errata-xmlrpc 2014-01-21 14:52:48 EST
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.

http://rhn.redhat.com/errata/RHBA-2014-0033.html

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