Bug #815

puppetmaster doesn't create complete environment on first startup

Added by David Schmitt over 4 years ago. Updated over 4 years ago.

Status:Closed Start date:
Priority:High Due date:
Assignee:Luke Kanies % Done:

0%

Category:-
Target version:0.24.0
Affected Puppet version:0.25.4 Branch:
Keywords:
Votes: 0

Description

Testing current HEAD on Debian etch.

When running puppetmasterd the first time with a new (non-existent) vardir, the directories “reports” and “rrd” are not created:

root@git-test:/tests/puppet-trunk# mkdir /new
root@git-test:/tests/puppet-trunk# puppetmasterd --debug --trace --confdir /new/conf --vardir /new/var
[...]
err: /puppetconfig/reporting/File[/new/var/reports]/ensure: change from absent to directory failed: Cannot create /new/var/reports; parent directory /new/var does not exist
[...]
err: /puppetconfig/metrics/File[/new/var/rrd]/ensure: change from absent to directory failed: Cannot create /new/var/rrd; parent directory /new/var does not exist
[...]

Actually $vardir is created later in the startup sequence and puppetmasterd runs fine afterwards, though I have not tried to use reports or graphing functionality.

On the second run, the directories are created without further troubles:

root@git-test:/tests/puppet-trunk# puppetmasterd --debug --trace --confdir /new/conf --vardir /new/var
[...]
debug: /puppetconfig/reporting/File[/new/var/reports]/ensure: created
[...]
debug: /puppetconfig/metrics/File[/new/var/rrd]/ensure: created
[...]

According to a comment in the config code, there are currently no provisions for inter-config-section dependencies, which could cause this problem. As a workaround, each section could create the necessary parent directories, fail after configuration iff some parts failed or fail fast immediately if something doesn’t work.

History

Updated by David Schmitt over 4 years ago

A fix is available in the

misspiggy/fix-815
branch of the repo at
git://git.black.co.at/puppet-bugfixes

Updated by Luke Kanies over 4 years ago

This commit causes test failures in spec/unit/util/settings.rb:

luke@phage(0) $ unit/util/settings.rb 
...........................................P..FPPP...PP.PPPP..FF

1)
Mocha::ExpectationError in 'Puppet::Util::Settings when being used to manage the host machine should be able to create needed directories in multiple sections'
#.mkdir('/otherdir', 493) - expected calls: 1, actual calls: 0
unit/util/settings.rb:427:
unit/util/settings.rb:390:

2)
[[RuntimeError]] in 'Puppet::Util::Settings when being used to manage the host machine should support a method for re-using all currently used sections'
Could not configure for running; got 2 failure(s)
/Users/luke/git/puppet/lib/puppet/util/settings.rb:664:in @use'
/Users/luke/git/puppet/lib/puppet/node/configuration.rb:103:in @apply'
/Users/luke/git/puppet/lib/puppet/util/settings.rb:662:in @use'
/Users/luke/git/puppet/lib/puppet/util/settings.rb:641:in @use'
unit/util/settings.rb:544:
unit/util/settings.rb:390:

3)
'Puppet::Util::Settings when being used to manage the host machine should fail if any resources fail' FAILED
expected [[RuntimeError]], got #.to_transportable(:main, [:whatever]) - expected calls: 0, actual calls: 1
Similar expectations:
to_transportable(:whatever)>
unit/util/settings.rb:552:
unit/util/settings.rb:390:

Finished in 0.280155 seconds

64 examples, 3 failures, 10 pending

Updated by David Schmitt over 4 years ago

(17:38:02) lak: DavidS: i think the main solution to the problem is just to make sure
                that metrics and reporting use :main in addition to :metrics/:reporting

Done in rest/fix-815-by-using-main-explicitly in git://git.black.co.at/puppet-bugfixes, commit: 61ef2893c57584ad3166241c6e412c1b4d014a4b

Updated by David Schmitt over 4 years ago

just went through the tickets reviewing status

Updated by Luke Kanies over 4 years ago

  • Status changed from 1 to Closed
  • 7 set to fixed

Also available in: Atom PDF